AWS SDK

AWS SDK

rev. db10d8b7d1ddffb641e5651cb5b4c7c7d63bda6a (ignoring whitespace)

Files changed:

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

@@ -75,75 +134,135 @@
   95     95   
            ConverseStreamResponseDeserializer,
   96     96   
        ));
   97     97   
   98     98   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   99     99   
            crate::config::auth::Params::builder()
  100    100   
                .operation_name("ConverseStream")
  101    101   
                .build()
  102    102   
                .expect("required fields set"),
  103    103   
        ));
  104    104   
         105  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
  105    106   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  106    107   
            "ConverseStream",
  107    108   
            "Bedrock Runtime",
  108    109   
        ));
  109    110   
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
  110    111   
        signing_options.double_uri_encode = true;
  111    112   
        signing_options.content_sha256_header = false;
  112    113   
        signing_options.normalize_uri_path = true;
  113    114   
        signing_options.payload_override = None;
  114    115   
@@ -251,252 +461,475 @@
  271    272   
  272    273   
// The get_* functions below are generated from JMESPath expressions in the
  273    274   
// operationContextParams trait. They target the operation's input shape.
  274    275   
  275    276   
/// Error type for the `ConverseStreamError` operation.
  276    277   
#[non_exhaustive]
  277    278   
#[derive(::std::fmt::Debug)]
  278    279   
pub enum ConverseStreamError {
  279    280   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
  280    281   
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
  281         -
    /// <p>The request is denied because of missing access permissions.</p>
         282  +
    /// <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>
  282    283   
    AccessDeniedException(crate::types::error::AccessDeniedException),
  283         -
    /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
         284  +
    /// <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>
  284    285   
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
  285         -
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
         286  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
  286    287   
    ThrottlingException(crate::types::error::ThrottlingException),
  287         -
    /// <p>An internal server error occurred. Retry your request.</p>
         288  +
    /// <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>
         289  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
         290  +
    /// <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>
  288    291   
    InternalServerException(crate::types::error::InternalServerException),
  289    292   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
  290    293   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
  291         -
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
         294  +
    /// <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>
  292    295   
    ValidationException(crate::types::error::ValidationException),
  293         -
    /// <p>The model specified in the request is not ready to serve inference requests.</p>
         296  +
    /// <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>
  294    297   
    ModelNotReadyException(crate::types::error::ModelNotReadyException),
  295    298   
    /// <p>The request failed due to an error while processing the model.</p>
  296    299   
    ModelErrorException(crate::types::error::ModelErrorException),
  297    300   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  298    301   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  299    302   
    variable wildcard pattern and check `.code()`:
  300    303   
     \
  301    304   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  302    305   
     \
  303    306   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseStreamError) for what information is available for the error.")]
  304    307   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  305    308   
}
  306    309   
impl ConverseStreamError {
  307    310   
    /// Creates the `ConverseStreamError::Unhandled` variant from any error type.
  308    311   
    pub fn unhandled(
  309    312   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  310    313   
    ) -> Self {
  311    314   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  312    315   
            source: err.into(),
  313    316   
            meta: ::std::default::Default::default(),
  314    317   
        })
  315    318   
    }
  316    319   
  317    320   
    /// Creates the `ConverseStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  318    321   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  319    322   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  320    323   
            source: err.clone().into(),
  321    324   
            meta: err,
  322    325   
        })
  323    326   
    }
  324    327   
    ///
  325    328   
    /// Returns error metadata, which includes the error code, message,
  326    329   
    /// request ID, and potentially additional information.
  327    330   
    ///
  328    331   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  329    332   
        match self {
  330    333   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  331    334   
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  332    335   
            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  333    336   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         337  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  334    338   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  335    339   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  336    340   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  337    341   
            Self::ModelNotReadyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  338    342   
            Self::ModelErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  339    343   
            Self::Unhandled(e) => &e.meta,
  340    344   
        }
  341    345   
    }
  342    346   
    /// Returns `true` if the error kind is `ConverseStreamError::ModelTimeoutException`.
  343    347   
    pub fn is_model_timeout_exception(&self) -> bool {
  344    348   
        matches!(self, Self::ModelTimeoutException(_))
  345    349   
    }
  346    350   
    /// Returns `true` if the error kind is `ConverseStreamError::AccessDeniedException`.
  347    351   
    pub fn is_access_denied_exception(&self) -> bool {
  348    352   
        matches!(self, Self::AccessDeniedException(_))
  349    353   
    }
  350    354   
    /// Returns `true` if the error kind is `ConverseStreamError::ResourceNotFoundException`.
  351    355   
    pub fn is_resource_not_found_exception(&self) -> bool {
  352    356   
        matches!(self, Self::ResourceNotFoundException(_))
  353    357   
    }
  354    358   
    /// Returns `true` if the error kind is `ConverseStreamError::ThrottlingException`.
  355    359   
    pub fn is_throttling_exception(&self) -> bool {
  356    360   
        matches!(self, Self::ThrottlingException(_))
  357    361   
    }
         362  +
    /// Returns `true` if the error kind is `ConverseStreamError::ServiceUnavailableException`.
         363  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         364  +
        matches!(self, Self::ServiceUnavailableException(_))
         365  +
    }
  358    366   
    /// Returns `true` if the error kind is `ConverseStreamError::InternalServerException`.
  359    367   
    pub fn is_internal_server_exception(&self) -> bool {
  360    368   
        matches!(self, Self::InternalServerException(_))
  361    369   
    }
  362    370   
    /// Returns `true` if the error kind is `ConverseStreamError::ModelStreamErrorException`.
  363    371   
    pub fn is_model_stream_error_exception(&self) -> bool {
  364    372   
        matches!(self, Self::ModelStreamErrorException(_))
  365    373   
    }
  366    374   
    /// Returns `true` if the error kind is `ConverseStreamError::ValidationException`.
  367    375   
    pub fn is_validation_exception(&self) -> bool {
  368    376   
        matches!(self, Self::ValidationException(_))
  369    377   
    }
  370    378   
    /// Returns `true` if the error kind is `ConverseStreamError::ModelNotReadyException`.
  371    379   
    pub fn is_model_not_ready_exception(&self) -> bool {
  372    380   
        matches!(self, Self::ModelNotReadyException(_))
  373    381   
    }
  374    382   
    /// Returns `true` if the error kind is `ConverseStreamError::ModelErrorException`.
  375    383   
    pub fn is_model_error_exception(&self) -> bool {
  376    384   
        matches!(self, Self::ModelErrorException(_))
  377    385   
    }
  378    386   
}
  379    387   
impl ::std::error::Error for ConverseStreamError {
  380    388   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  381    389   
        match self {
  382    390   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  383    391   
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
  384    392   
            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
  385    393   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         394  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  386    395   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  387    396   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  388    397   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  389    398   
            Self::ModelNotReadyException(_inner) => ::std::option::Option::Some(_inner),
  390    399   
            Self::ModelErrorException(_inner) => ::std::option::Option::Some(_inner),
  391    400   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  392    401   
        }
  393    402   
    }
  394    403   
}
  395    404   
impl ::std::fmt::Display for ConverseStreamError {
  396    405   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  397    406   
        match self {
  398    407   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  399    408   
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
  400    409   
            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
  401    410   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         411  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  402    412   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  403    413   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  404    414   
            Self::ValidationException(_inner) => _inner.fmt(f),
  405    415   
            Self::ModelNotReadyException(_inner) => _inner.fmt(f),
  406    416   
            Self::ModelErrorException(_inner) => _inner.fmt(f),
  407    417   
            Self::Unhandled(_inner) => {
  408    418   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  409    419   
                    write!(f, "unhandled error ({code})")
  410    420   
                } else {
  411    421   
                    f.write_str("unhandled error")
  412    422   
                }
  413    423   
            }
  414    424   
        }
  415    425   
    }
  416    426   
}
  417    427   
impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseStreamError {
  418    428   
    fn code(&self) -> ::std::option::Option<&str> {
  419    429   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  420    430   
    }
  421    431   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  422         -
        ::std::option::Option::None
         432  +
        match self {
         433  +
            Self::ModelNotReadyException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
         434  +
            _ => ::std::option::Option::None,
         435  +
        }
  423    436   
    }
  424    437   
}
  425    438   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseStreamError {
  426    439   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  427    440   
        match self {
  428    441   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  429    442   
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  430    443   
            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  431    444   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         445  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  432    446   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  433    447   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  434    448   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  435    449   
            Self::ModelNotReadyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  436    450   
            Self::ModelErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  437    451   
            Self::Unhandled(_inner) => &_inner.meta,
  438    452   
        }
  439    453   
    }
  440    454   
}
  441    455   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseStreamError {

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

@@ -1,1 +0,439 @@
    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         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    5      5   
pub struct ConverseStreamInput {
    6         -
    /// <p>The ID for the model.</p>
    7         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
           6  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
    8      7   
    /// <ul>
    9      8   
    /// <li>
   10      9   
    /// <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>
   11     10   
    /// <li>
          11  +
    /// <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>
          12  +
    /// <li>
   12     13   
    /// <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>
   13     14   
    /// <li>
   14     15   
    /// <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>
          16  +
    /// <li>
          17  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
   15     18   
    /// </ul>
          19  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
   16     20   
    pub model_id: ::std::option::Option<::std::string::String>,
   17     21   
    /// <p>The messages that you want to send to the model.</p>
   18     22   
    pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
   19         -
    /// <p>A system prompt to send to the model.</p>
          23  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
   20     24   
    pub system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
   21         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
          25  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
   22     26   
    pub inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
   23         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
   24         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
   25         -
    /// </note>
          27  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
          28  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
   26     29   
    pub tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
   27         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
          30  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
          31  +
    pub guardrail_config: ::std::option::Option<crate::types::GuardrailStreamConfiguration>,
          32  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
   28     33   
    pub additional_model_request_fields: ::std::option::Option<::aws_smithy_types::Document>,
   29         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
          34  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
          35  +
    pub prompt_variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
          36  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
   30     37   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   31     38   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
   32         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
          39  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
   33     40   
    pub additional_model_response_field_paths: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          41  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
          42  +
    pub request_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          43  +
    /// <p>Model performance settings for the request.</p>
          44  +
    pub performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
   34     45   
}
   35     46   
impl ConverseStreamInput {
   36         -
    /// <p>The ID for the model.</p>
   37         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
          47  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
   38     48   
    /// <ul>
   39     49   
    /// <li>
   40     50   
    /// <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>
   41     51   
    /// <li>
          52  +
    /// <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>
          53  +
    /// <li>
   42     54   
    /// <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>
   43     55   
    /// <li>
   44     56   
    /// <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>
          57  +
    /// <li>
          58  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
   45     59   
    /// </ul>
          60  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
   46     61   
    pub fn model_id(&self) -> ::std::option::Option<&str> {
   47     62   
        self.model_id.as_deref()
   48     63   
    }
   49     64   
    /// <p>The messages that you want to send to the model.</p>
   50     65   
    ///
   51     66   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.messages.is_none()`.
   52     67   
    pub fn messages(&self) -> &[crate::types::Message] {
   53     68   
        self.messages.as_deref().unwrap_or_default()
   54     69   
    }
   55         -
    /// <p>A system prompt to send to the model.</p>
          70  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
   56     71   
    ///
   57     72   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.system.is_none()`.
   58     73   
    pub fn system(&self) -> &[crate::types::SystemContentBlock] {
   59     74   
        self.system.as_deref().unwrap_or_default()
   60     75   
    }
   61         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
          76  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
   62     77   
    pub fn inference_config(&self) -> ::std::option::Option<&crate::types::InferenceConfiguration> {
   63     78   
        self.inference_config.as_ref()
   64     79   
    }
   65         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
   66         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
   67         -
    /// </note>
          80  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
          81  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
   68     82   
    pub fn tool_config(&self) -> ::std::option::Option<&crate::types::ToolConfiguration> {
   69     83   
        self.tool_config.as_ref()
   70     84   
    }
   71         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
          85  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
          86  +
    pub fn guardrail_config(&self) -> ::std::option::Option<&crate::types::GuardrailStreamConfiguration> {
          87  +
        self.guardrail_config.as_ref()
          88  +
    }
          89  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
   72     90   
    pub fn additional_model_request_fields(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
   73     91   
        self.additional_model_request_fields.as_ref()
   74     92   
    }
   75         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
          93  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
          94  +
    pub fn prompt_variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
          95  +
        self.prompt_variables.as_ref()
          96  +
    }
          97  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
   76     98   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
   77     99   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
   78         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         100  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
   79    101   
    ///
   80    102   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_model_response_field_paths.is_none()`.
   81    103   
    pub fn additional_model_response_field_paths(&self) -> &[::std::string::String] {
   82    104   
        self.additional_model_response_field_paths.as_deref().unwrap_or_default()
   83    105   
    }
         106  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         107  +
    pub fn request_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         108  +
        self.request_metadata.as_ref()
         109  +
    }
         110  +
    /// <p>Model performance settings for the request.</p>
         111  +
    pub fn performance_config(&self) -> ::std::option::Option<&crate::types::PerformanceConfiguration> {
         112  +
        self.performance_config.as_ref()
         113  +
    }
         114  +
}
         115  +
impl ::std::fmt::Debug for ConverseStreamInput {
         116  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         117  +
        let mut formatter = f.debug_struct("ConverseStreamInput");
         118  +
        formatter.field("model_id", &self.model_id);
         119  +
        formatter.field("messages", &self.messages);
         120  +
        formatter.field("system", &self.system);
         121  +
        formatter.field("inference_config", &self.inference_config);
         122  +
        formatter.field("tool_config", &self.tool_config);
         123  +
        formatter.field("guardrail_config", &self.guardrail_config);
         124  +
        formatter.field("additional_model_request_fields", &self.additional_model_request_fields);
         125  +
        formatter.field("prompt_variables", &"*** Sensitive Data Redacted ***");
         126  +
        formatter.field("additional_model_response_field_paths", &self.additional_model_response_field_paths);
         127  +
        formatter.field("request_metadata", &"*** Sensitive Data Redacted ***");
         128  +
        formatter.field("performance_config", &self.performance_config);
         129  +
        formatter.finish()
         130  +
    }
   84    131   
}
   85    132   
impl ConverseStreamInput {
   86    133   
    /// Creates a new builder-style object to manufacture [`ConverseStreamInput`](crate::operation::converse_stream::ConverseStreamInput).
   87    134   
    pub fn builder() -> crate::operation::converse_stream::builders::ConverseStreamInputBuilder {
   88    135   
        crate::operation::converse_stream::builders::ConverseStreamInputBuilder::default()
   89    136   
    }
   90    137   
}
   91    138   
   92    139   
/// A builder for [`ConverseStreamInput`](crate::operation::converse_stream::ConverseStreamInput).
   93         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         140  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   94    141   
#[non_exhaustive]
   95    142   
pub struct ConverseStreamInputBuilder {
   96    143   
    pub(crate) model_id: ::std::option::Option<::std::string::String>,
   97    144   
    pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
   98    145   
    pub(crate) system: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>,
   99    146   
    pub(crate) inference_config: ::std::option::Option<crate::types::InferenceConfiguration>,
  100    147   
    pub(crate) tool_config: ::std::option::Option<crate::types::ToolConfiguration>,
         148  +
    pub(crate) guardrail_config: ::std::option::Option<crate::types::GuardrailStreamConfiguration>,
  101    149   
    pub(crate) additional_model_request_fields: ::std::option::Option<::aws_smithy_types::Document>,
         150  +
    pub(crate) prompt_variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
  102    151   
    pub(crate) additional_model_response_field_paths: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         152  +
    pub(crate) request_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         153  +
    pub(crate) performance_config: ::std::option::Option<crate::types::PerformanceConfiguration>,
  103    154   
}
  104    155   
impl ConverseStreamInputBuilder {
  105         -
    /// <p>The ID for the model.</p>
  106         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         156  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  107    157   
    /// <ul>
  108    158   
    /// <li>
  109    159   
    /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
  110    160   
    /// <li>
         161  +
    /// <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>
         162  +
    /// <li>
  111    163   
    /// <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>
  112    164   
    /// <li>
  113    165   
    /// <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>
         166  +
    /// <li>
         167  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  114    168   
    /// </ul>
         169  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  115    170   
    /// This field is required.
  116    171   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  117    172   
        self.model_id = ::std::option::Option::Some(input.into());
  118    173   
        self
  119    174   
    }
  120         -
    /// <p>The ID for the model.</p>
  121         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         175  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  122    176   
    /// <ul>
  123    177   
    /// <li>
  124    178   
    /// <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>
  125    179   
    /// <li>
         180  +
    /// <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>
         181  +
    /// <li>
  126    182   
    /// <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>
  127    183   
    /// <li>
  128    184   
    /// <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>
         185  +
    /// <li>
         186  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  129    187   
    /// </ul>
         188  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  130    189   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  131    190   
        self.model_id = input;
  132    191   
        self
  133    192   
    }
  134         -
    /// <p>The ID for the model.</p>
  135         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         193  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  136    194   
    /// <ul>
  137    195   
    /// <li>
  138    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>
  139    197   
    /// <li>
         198  +
    /// <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>
         199  +
    /// <li>
  140    200   
    /// <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>
  141    201   
    /// <li>
  142    202   
    /// <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>
         203  +
    /// <li>
         204  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  143    205   
    /// </ul>
         206  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  144    207   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  145    208   
        &self.model_id
  146    209   
    }
  147    210   
    /// Appends an item to `messages`.
  148    211   
    ///
  149    212   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  150    213   
    ///
  151    214   
    /// <p>The messages that you want to send to the model.</p>
  152    215   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  153    216   
        let mut v = self.messages.unwrap_or_default();
  154    217   
        v.push(input);
  155    218   
        self.messages = ::std::option::Option::Some(v);
  156    219   
        self
  157    220   
    }
  158    221   
    /// <p>The messages that you want to send to the model.</p>
  159    222   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  160    223   
        self.messages = input;
  161    224   
        self
  162    225   
    }
  163    226   
    /// <p>The messages that you want to send to the model.</p>
  164    227   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  165    228   
        &self.messages
  166    229   
    }
  167    230   
    /// Appends an item to `system`.
  168    231   
    ///
  169    232   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  170    233   
    ///
  171         -
    /// <p>A system prompt to send to the model.</p>
         234  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  172    235   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  173    236   
        let mut v = self.system.unwrap_or_default();
  174    237   
        v.push(input);
  175    238   
        self.system = ::std::option::Option::Some(v);
  176    239   
        self
  177    240   
    }
  178         -
    /// <p>A system prompt to send to the model.</p>
         241  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  179    242   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  180    243   
        self.system = input;
  181    244   
        self
  182    245   
    }
  183         -
    /// <p>A system prompt to send to the model.</p>
         246  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  184    247   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  185    248   
        &self.system
  186    249   
    }
  187         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         250  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  188    251   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  189    252   
        self.inference_config = ::std::option::Option::Some(input);
  190    253   
        self
  191    254   
    }
  192         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         255  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  193    256   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  194    257   
        self.inference_config = input;
  195    258   
        self
  196    259   
    }
  197         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         260  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  198    261   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  199    262   
        &self.inference_config
  200    263   
    }
  201         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  202         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  203         -
    /// </note>
         264  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         265  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  204    266   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  205    267   
        self.tool_config = ::std::option::Option::Some(input);
  206    268   
        self
  207    269   
    }
  208         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  209         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  210         -
    /// </note>
         270  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         271  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  211    272   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  212    273   
        self.tool_config = input;
  213    274   
        self
  214    275   
    }
  215         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  216         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  217         -
    /// </note>
         276  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         277  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  218    278   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  219    279   
        &self.tool_config
  220    280   
    }
  221         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         281  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         282  +
    pub fn guardrail_config(mut self, input: crate::types::GuardrailStreamConfiguration) -> Self {
         283  +
        self.guardrail_config = ::std::option::Option::Some(input);
         284  +
        self
         285  +
    }
         286  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         287  +
    pub fn set_guardrail_config(mut self, input: ::std::option::Option<crate::types::GuardrailStreamConfiguration>) -> Self {
         288  +
        self.guardrail_config = input;
         289  +
        self
         290  +
    }
         291  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         292  +
    pub fn get_guardrail_config(&self) -> &::std::option::Option<crate::types::GuardrailStreamConfiguration> {
         293  +
        &self.guardrail_config
         294  +
    }
         295  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  222    296   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  223    297   
        self.additional_model_request_fields = ::std::option::Option::Some(input);
  224    298   
        self
  225    299   
    }
  226         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         300  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  227    301   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  228    302   
        self.additional_model_request_fields = input;
  229    303   
        self
  230    304   
    }
  231         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         305  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  232    306   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  233    307   
        &self.additional_model_request_fields
  234    308   
    }
         309  +
    /// Adds a key-value pair to `prompt_variables`.
         310  +
    ///
         311  +
    /// To override the contents of this collection use [`set_prompt_variables`](Self::set_prompt_variables).
         312  +
    ///
         313  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         314  +
    pub fn prompt_variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PromptVariableValues) -> Self {
         315  +
        let mut hash_map = self.prompt_variables.unwrap_or_default();
         316  +
        hash_map.insert(k.into(), v);
         317  +
        self.prompt_variables = ::std::option::Option::Some(hash_map);
         318  +
        self
         319  +
    }
         320  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         321  +
    pub fn set_prompt_variables(
         322  +
        mut self,
         323  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
         324  +
    ) -> Self {
         325  +
        self.prompt_variables = input;
         326  +
        self
         327  +
    }
         328  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         329  +
    pub fn get_prompt_variables(
         330  +
        &self,
         331  +
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
         332  +
        &self.prompt_variables
         333  +
    }
  235    334   
    /// Appends an item to `additional_model_response_field_paths`.
  236    335   
    ///
  237    336   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  238    337   
    ///
  239         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         338  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  240    339   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  241    340   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  242         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         341  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  243    342   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  244    343   
        let mut v = self.additional_model_response_field_paths.unwrap_or_default();
  245    344   
        v.push(input.into());
  246    345   
        self.additional_model_response_field_paths = ::std::option::Option::Some(v);
  247    346   
        self
  248    347   
    }
  249         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         348  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  250    349   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  251    350   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  252         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         351  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  253    352   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  254    353   
        self.additional_model_response_field_paths = input;
  255    354   
        self
  256    355   
    }
  257         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         356  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  258    357   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  259    358   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  260         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         359  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  261    360   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  262    361   
        &self.additional_model_response_field_paths
  263    362   
    }
         363  +
    /// Adds a key-value pair to `request_metadata`.
         364  +
    ///
         365  +
    /// To override the contents of this collection use [`set_request_metadata`](Self::set_request_metadata).
         366  +
    ///
         367  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         368  +
    pub fn request_metadata(
         369  +
        mut self,
         370  +
        k: impl ::std::convert::Into<::std::string::String>,
         371  +
        v: impl ::std::convert::Into<::std::string::String>,
         372  +
    ) -> Self {
         373  +
        let mut hash_map = self.request_metadata.unwrap_or_default();
         374  +
        hash_map.insert(k.into(), v.into());
         375  +
        self.request_metadata = ::std::option::Option::Some(hash_map);
         376  +
        self
         377  +
    }
         378  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         379  +
    pub fn set_request_metadata(
         380  +
        mut self,
         381  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         382  +
    ) -> Self {
         383  +
        self.request_metadata = input;
         384  +
        self
         385  +
    }
         386  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         387  +
    pub fn get_request_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         388  +
        &self.request_metadata
         389  +
    }
         390  +
    /// <p>Model performance settings for the request.</p>
         391  +
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
         392  +
        self.performance_config = ::std::option::Option::Some(input);
         393  +
        self
         394  +
    }
         395  +
    /// <p>Model performance settings for the request.</p>
         396  +
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
         397  +
        self.performance_config = input;
         398  +
        self
         399  +
    }
         400  +
    /// <p>Model performance settings for the request.</p>
         401  +
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
         402  +
        &self.performance_config
         403  +
    }
  264    404   
    /// Consumes the builder and constructs a [`ConverseStreamInput`](crate::operation::converse_stream::ConverseStreamInput).
  265    405   
    pub fn build(
  266    406   
        self,
  267    407   
    ) -> ::std::result::Result<crate::operation::converse_stream::ConverseStreamInput, ::aws_smithy_types::error::operation::BuildError> {
  268    408   
        ::std::result::Result::Ok(crate::operation::converse_stream::ConverseStreamInput {
  269    409   
            model_id: self.model_id,
  270    410   
            messages: self.messages,
  271    411   
            system: self.system,
  272    412   
            inference_config: self.inference_config,
  273    413   
            tool_config: self.tool_config,
         414  +
            guardrail_config: self.guardrail_config,
  274    415   
            additional_model_request_fields: self.additional_model_request_fields,
         416  +
            prompt_variables: self.prompt_variables,
  275    417   
            additional_model_response_field_paths: self.additional_model_response_field_paths,
         418  +
            request_metadata: self.request_metadata,
         419  +
            performance_config: self.performance_config,
  276    420   
        })
  277    421   
    }
  278    422   
}
         423  +
impl ::std::fmt::Debug for ConverseStreamInputBuilder {
         424  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         425  +
        let mut formatter = f.debug_struct("ConverseStreamInputBuilder");
         426  +
        formatter.field("model_id", &self.model_id);
         427  +
        formatter.field("messages", &self.messages);
         428  +
        formatter.field("system", &self.system);
         429  +
        formatter.field("inference_config", &self.inference_config);
         430  +
        formatter.field("tool_config", &self.tool_config);
         431  +
        formatter.field("guardrail_config", &self.guardrail_config);
         432  +
        formatter.field("additional_model_request_fields", &self.additional_model_request_fields);
         433  +
        formatter.field("prompt_variables", &"*** Sensitive Data Redacted ***");
         434  +
        formatter.field("additional_model_response_field_paths", &self.additional_model_response_field_paths);
         435  +
        formatter.field("request_metadata", &"*** Sensitive Data Redacted ***");
         436  +
        formatter.field("performance_config", &self.performance_config);
         437  +
        formatter.finish()
         438  +
    }
         439  +
}

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

@@ -1,1 +58,67 @@
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     16   
        >,
   17     17   
    > {
   18     18   
        let mut fluent_builder = client.converse_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 `ConverseStream`.
   24     24   
///
   25         -
/// <p>Sends messages to the specified Amazon Bedrock model and returns the response in a stream. <code>ConverseStream</code> provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model. 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>
   26         -
/// <p>To find out 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>
   27         -
/// <p>For example code, see <i>Invoke model with streaming code example</i> in the <i>Amazon Bedrock User Guide</i>.</p>
   28         -
/// <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
          25  +
/// <p>Sends messages to the specified Amazon Bedrock model and returns the response in a stream. <code>ConverseStream</code> provides a consistent API that works with all Amazon Bedrock models that support messages. This allows you to write code once and use it with different models. Should a model have unique inference parameters, you can also pass those unique parameters to the model.</p>
          26  +
/// <p>To find out 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>ConverseStream</code>.</p>
          28  +
/// </note>
          29  +
/// <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p>
          30  +
/// <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p>
          31  +
/// <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p>
          32  +
/// <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i></p>
          33  +
/// <p>For example code, see <i>Conversation streaming example</i> in the <i>Amazon Bedrock User Guide</i>.</p>
          34  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p><important>
          35  +
/// <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 base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</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>
          36  +
/// </important>
          37  +
/// <p>For troubleshooting some of the common errors you might encounter when using the <code>ConverseStream</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>
   29     38   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   30     39   
pub struct ConverseStreamFluentBuilder {
   31     40   
    handle: ::std::sync::Arc<crate::client::Handle>,
   32     41   
    inner: crate::operation::converse_stream::builders::ConverseStreamInputBuilder,
   33     42   
    config_override: ::std::option::Option<crate::config::Builder>,
   34     43   
}
   35     44   
impl
   36     45   
    crate::client::customize::internal::CustomizableSend<
   37     46   
        crate::operation::converse_stream::ConverseStreamOutput,
   38     47   
        crate::operation::converse_stream::ConverseStreamError,
@@ -84,93 +269,365 @@
  104    113   
    }
  105    114   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  106    115   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  107    116   
        self
  108    117   
    }
  109    118   
  110    119   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  111    120   
        self.config_override = config_override;
  112    121   
        self
  113    122   
    }
  114         -
    /// <p>The ID for the model.</p>
  115         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         123  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  116    124   
    /// <ul>
  117    125   
    /// <li>
  118    126   
    /// <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>
  119    127   
    /// <li>
         128  +
    /// <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>
         129  +
    /// <li>
  120    130   
    /// <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>
  121    131   
    /// <li>
  122    132   
    /// <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>
         133  +
    /// <li>
         134  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  123    135   
    /// </ul>
         136  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  124    137   
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  125    138   
        self.inner = self.inner.model_id(input.into());
  126    139   
        self
  127    140   
    }
  128         -
    /// <p>The ID for the model.</p>
  129         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         141  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  130    142   
    /// <ul>
  131    143   
    /// <li>
  132    144   
    /// <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>
  133    145   
    /// <li>
         146  +
    /// <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>
         147  +
    /// <li>
  134    148   
    /// <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>
  135    149   
    /// <li>
  136    150   
    /// <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>
         151  +
    /// <li>
         152  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  137    153   
    /// </ul>
         154  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  138    155   
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  139    156   
        self.inner = self.inner.set_model_id(input);
  140    157   
        self
  141    158   
    }
  142         -
    /// <p>The ID for the model.</p>
  143         -
    /// <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
         159  +
    /// <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
  144    160   
    /// <ul>
  145    161   
    /// <li>
  146    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>
  147    163   
    /// <li>
         164  +
    /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
         165  +
    /// <li>
  148    166   
    /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
  149    167   
    /// <li>
  150    168   
    /// <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>
         169  +
    /// <li>
         170  +
    /// <p>To include a prompt that was defined in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html">Prompt management</a>, specify the ARN of the prompt version to use.</p></li>
  151    171   
    /// </ul>
         172  +
    /// <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
  152    173   
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
  153    174   
        self.inner.get_model_id()
  154    175   
    }
  155    176   
    ///
  156    177   
    /// Appends an item to `messages`.
  157    178   
    ///
  158    179   
    /// To override the contents of this collection use [`set_messages`](Self::set_messages).
  159    180   
    ///
  160    181   
    /// <p>The messages that you want to send to the model.</p>
  161    182   
    pub fn messages(mut self, input: crate::types::Message) -> Self {
  162    183   
        self.inner = self.inner.messages(input);
  163    184   
        self
  164    185   
    }
  165    186   
    /// <p>The messages that you want to send to the model.</p>
  166    187   
    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
  167    188   
        self.inner = self.inner.set_messages(input);
  168    189   
        self
  169    190   
    }
  170    191   
    /// <p>The messages that you want to send to the model.</p>
  171    192   
    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
  172    193   
        self.inner.get_messages()
  173    194   
    }
  174    195   
    ///
  175    196   
    /// Appends an item to `system`.
  176    197   
    ///
  177    198   
    /// To override the contents of this collection use [`set_system`](Self::set_system).
  178    199   
    ///
  179         -
    /// <p>A system prompt to send to the model.</p>
         200  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  180    201   
    pub fn system(mut self, input: crate::types::SystemContentBlock) -> Self {
  181    202   
        self.inner = self.inner.system(input);
  182    203   
        self
  183    204   
    }
  184         -
    /// <p>A system prompt to send to the model.</p>
         205  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  185    206   
    pub fn set_system(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>>) -> Self {
  186    207   
        self.inner = self.inner.set_system(input);
  187    208   
        self
  188    209   
    }
  189         -
    /// <p>A system prompt to send to the model.</p>
         210  +
    /// <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
  190    211   
    pub fn get_system(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SystemContentBlock>> {
  191    212   
        self.inner.get_system()
  192    213   
    }
  193         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         214  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  194    215   
    pub fn inference_config(mut self, input: crate::types::InferenceConfiguration) -> Self {
  195    216   
        self.inner = self.inner.inference_config(input);
  196    217   
        self
  197    218   
    }
  198         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         219  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  199    220   
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::InferenceConfiguration>) -> Self {
  200    221   
        self.inner = self.inner.set_inference_config(input);
  201    222   
        self
  202    223   
    }
  203         -
    /// <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
         224  +
    /// <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base set of inference parameters. If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field.</p>
  204    225   
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::InferenceConfiguration> {
  205    226   
        self.inner.get_inference_config()
  206    227   
    }
  207         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  208         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  209         -
    /// </note>
         228  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         229  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  210    230   
    pub fn tool_config(mut self, input: crate::types::ToolConfiguration) -> Self {
  211    231   
        self.inner = self.inner.tool_config(input);
  212    232   
        self
  213    233   
    }
  214         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  215         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  216         -
    /// </note>
         234  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         235  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  217    236   
    pub fn set_tool_config(mut self, input: ::std::option::Option<crate::types::ToolConfiguration>) -> Self {
  218    237   
        self.inner = self.inner.set_tool_config(input);
  219    238   
        self
  220    239   
    }
  221         -
    /// <p>Configuration information for the tools that the model can use when generating a response.</p><note>
  222         -
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
  223         -
    /// </note>
         240  +
    /// <p>Configuration information for the tools that the model can use when generating a response.</p>
         241  +
    /// <p>For information about models that support streaming tool use, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features">Supported models and model features</a>.</p>
  224    242   
    pub fn get_tool_config(&self) -> &::std::option::Option<crate::types::ToolConfiguration> {
  225    243   
        self.inner.get_tool_config()
  226    244   
    }
  227         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         245  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         246  +
    pub fn guardrail_config(mut self, input: crate::types::GuardrailStreamConfiguration) -> Self {
         247  +
        self.inner = self.inner.guardrail_config(input);
         248  +
        self
         249  +
    }
         250  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         251  +
    pub fn set_guardrail_config(mut self, input: ::std::option::Option<crate::types::GuardrailStreamConfiguration>) -> Self {
         252  +
        self.inner = self.inner.set_guardrail_config(input);
         253  +
        self
         254  +
    }
         255  +
    /// <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
         256  +
    pub fn get_guardrail_config(&self) -> &::std::option::Option<crate::types::GuardrailStreamConfiguration> {
         257  +
        self.inner.get_guardrail_config()
         258  +
    }
         259  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  228    260   
    pub fn additional_model_request_fields(mut self, input: ::aws_smithy_types::Document) -> Self {
  229    261   
        self.inner = self.inner.additional_model_request_fields(input);
  230    262   
        self
  231    263   
    }
  232         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         264  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  233    265   
    pub fn set_additional_model_request_fields(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  234    266   
        self.inner = self.inner.set_additional_model_request_fields(input);
  235    267   
        self
  236    268   
    }
  237         -
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code> field.</p>
         269  +
    /// <p>Additional inference parameters that the model supports, beyond the base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
  238    270   
    pub fn get_additional_model_request_fields(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  239    271   
        self.inner.get_additional_model_request_fields()
  240    272   
    }
  241    273   
    ///
         274  +
    /// Adds a key-value pair to `promptVariables`.
         275  +
    ///
         276  +
    /// To override the contents of this collection use [`set_prompt_variables`](Self::set_prompt_variables).
         277  +
    ///
         278  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         279  +
    pub fn prompt_variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PromptVariableValues) -> Self {
         280  +
        self.inner = self.inner.prompt_variables(k.into(), v);
         281  +
        self
         282  +
    }
         283  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         284  +
    pub fn set_prompt_variables(
         285  +
        mut self,
         286  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>>,
         287  +
    ) -> Self {
         288  +
        self.inner = self.inner.set_prompt_variables(input);
         289  +
        self
         290  +
    }
         291  +
    /// <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
         292  +
    pub fn get_prompt_variables(
         293  +
        &self,
         294  +
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PromptVariableValues>> {
         295  +
        self.inner.get_prompt_variables()
         296  +
    }
         297  +
    ///
  242    298   
    /// Appends an item to `additionalModelResponseFieldPaths`.
  243    299   
    ///
  244    300   
    /// To override the contents of this collection use [`set_additional_model_response_field_paths`](Self::set_additional_model_response_field_paths).
  245    301   
    ///
  246         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         302  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  247    303   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  248    304   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  249         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         305  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  250    306   
    pub fn additional_model_response_field_paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  251    307   
        self.inner = self.inner.additional_model_response_field_paths(input.into());
  252    308   
        self
  253    309   
    }
  254         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         310  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  255    311   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  256    312   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  257         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         313  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  258    314   
    pub fn set_additional_model_response_field_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  259    315   
        self.inner = self.inner.set_additional_model_response_field_paths(input);
  260    316   
        self
  261    317   
    }
  262         -
    /// <p>Additional model parameters field paths to return in the response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
         318  +
    /// <p>Additional model parameters field paths to return in the response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
  263    319   
    /// <p><code>\[ "/stop_sequence" \]</code></p>
  264    320   
    /// <p>For information about the JSON Pointer syntax, see the <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
  265         -
    /// <p><code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
         321  +
    /// <p><code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested field is not in the model response, it is ignored by <code>Converse</code>.</p>
  266    322   
    pub fn get_additional_model_response_field_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  267    323   
        self.inner.get_additional_model_response_field_paths()
  268    324   
    }
         325  +
    ///
         326  +
    /// Adds a key-value pair to `requestMetadata`.
         327  +
    ///
         328  +
    /// To override the contents of this collection use [`set_request_metadata`](Self::set_request_metadata).
         329  +
    ///
         330  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         331  +
    pub fn request_metadata(
         332  +
        mut self,
         333  +
        k: impl ::std::convert::Into<::std::string::String>,
         334  +
        v: impl ::std::convert::Into<::std::string::String>,
         335  +
    ) -> Self {
         336  +
        self.inner = self.inner.request_metadata(k.into(), v.into());
         337  +
        self
         338  +
    }
         339  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         340  +
    pub fn set_request_metadata(
         341  +
        mut self,
         342  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         343  +
    ) -> Self {
         344  +
        self.inner = self.inner.set_request_metadata(input);
         345  +
        self
         346  +
    }
         347  +
    /// <p>Key-value pairs that you can use to filter invocation logs.</p>
         348  +
    pub fn get_request_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         349  +
        self.inner.get_request_metadata()
         350  +
    }
         351  +
    /// <p>Model performance settings for the request.</p>
         352  +
    pub fn performance_config(mut self, input: crate::types::PerformanceConfiguration) -> Self {
         353  +
        self.inner = self.inner.performance_config(input);
         354  +
        self
         355  +
    }
         356  +
    /// <p>Model performance settings for the request.</p>
         357  +
    pub fn set_performance_config(mut self, input: ::std::option::Option<crate::types::PerformanceConfiguration>) -> Self {
         358  +
        self.inner = self.inner.set_performance_config(input);
         359  +
        self
         360  +
    }
         361  +
    /// <p>Model performance settings for the request.</p>
         362  +
    pub fn get_performance_config(&self) -> &::std::option::Option<crate::types::PerformanceConfiguration> {
         363  +
        self.inner.get_performance_config()
         364  +
    }
  269    365   
}

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

@@ -0,1 +0,403 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `GetAsyncInvoke`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct GetAsyncInvoke;
           6  +
impl GetAsyncInvoke {
           7  +
    /// Creates a new `GetAsyncInvoke`
           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::get_async_invoke::GetAsyncInvokeInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::get_async_invoke::GetAsyncInvokeOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::get_async_invoke::GetAsyncInvokeError,
          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::get_async_invoke::GetAsyncInvokeError>()
          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::get_async_invoke::GetAsyncInvokeOutput>()
          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::get_async_invoke::GetAsyncInvokeInput,
          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", "GetAsyncInvoke", 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.GetAsyncInvoke",
          59  +
                "rpc.service" = "Bedrock Runtime",
          60  +
                "rpc.method" = "GetAsyncInvoke",
          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 GetAsyncInvoke {
          88  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          89  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetAsyncInvoke");
          90  +
          91  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          92  +
            GetAsyncInvokeRequestSerializer,
          93  +
        ));
          94  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
          95  +
            GetAsyncInvokeResponseDeserializer,
          96  +
        ));
          97  +
          98  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
          99  +
            crate::config::auth::Params::builder()
         100  +
                .operation_name("GetAsyncInvoke")
         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  +
            "GetAsyncInvoke",
         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("GetAsyncInvoke")
         130  +
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
         131  +
            .with_interceptor(GetAsyncInvokeEndpointParamsInterceptor)
         132  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         133  +
                crate::operation::get_async_invoke::GetAsyncInvokeError,
         134  +
            >::new())
         135  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         136  +
                crate::operation::get_async_invoke::GetAsyncInvokeError,
         137  +
            >::new())
         138  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         139  +
                crate::operation::get_async_invoke::GetAsyncInvokeError,
         140  +
            >::new());
         141  +
         142  +
        ::std::borrow::Cow::Owned(rcb)
         143  +
    }
         144  +
}
         145  +
         146  +
#[derive(Debug)]
         147  +
struct GetAsyncInvokeResponseDeserializer;
         148  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetAsyncInvokeResponseDeserializer {
         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_get_async_invoke::de_get_async_invoke_http_error(status, headers, body)
         161  +
        } else {
         162  +
            crate::protocol_serde::shape_get_async_invoke::de_get_async_invoke_http_response(status, headers, body)
         163  +
        };
         164  +
        crate::protocol_serde::type_erase_result(parse_result)
         165  +
    }
         166  +
}
         167  +
#[derive(Debug)]
         168  +
struct GetAsyncInvokeRequestSerializer;
         169  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetAsyncInvokeRequestSerializer {
         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::get_async_invoke::GetAsyncInvokeInput>()
         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::get_async_invoke::GetAsyncInvokeInput,
         186  +
                output: &mut ::std::string::String,
         187  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         188  +
                use ::std::fmt::Write as _;
         189  +
                let input_1 = &_input.invocation_arn;
         190  +
                let input_1 = input_1
         191  +
                    .as_ref()
         192  +
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("invocation_arn", "cannot be empty or unset"))?;
         193  +
                let invocation_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
         194  +
                if invocation_arn.is_empty() {
         195  +
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
         196  +
                        "invocation_arn",
         197  +
                        "cannot be empty or unset",
         198  +
                    ));
         199  +
                }
         200  +
                ::std::write!(output, "/async-invoke/{invocationArn}", invocationArn = invocation_arn).expect("formatting should succeed");
         201  +
                ::std::result::Result::Ok(())
         202  +
            }
         203  +
            #[allow(clippy::unnecessary_wraps)]
         204  +
            fn update_http_builder(
         205  +
                input: &crate::operation::get_async_invoke::GetAsyncInvokeInput,
         206  +
                builder: ::http::request::Builder,
         207  +
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         208  +
                let mut uri = ::std::string::String::new();
         209  +
                uri_base(input, &mut uri)?;
         210  +
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         211  +
            }
         212  +
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         213  +
            builder
         214  +
        };
         215  +
        let body = ::aws_smithy_types::body::SdkBody::from("");
         216  +
         217  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         218  +
    }
         219  +
}
         220  +
#[derive(Debug)]
         221  +
struct GetAsyncInvokeEndpointParamsInterceptor;
         222  +
         223  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAsyncInvokeEndpointParamsInterceptor {
         224  +
    fn name(&self) -> &'static str {
         225  +
        "GetAsyncInvokeEndpointParamsInterceptor"
         226  +
    }
         227  +
         228  +
    fn read_before_execution(
         229  +
        &self,
         230  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         231  +
            '_,
         232  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         233  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         234  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         235  +
        >,
         236  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         237  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         238  +
        let _input = context
         239  +
            .input()
         240  +
            .downcast_ref::<GetAsyncInvokeInput>()
         241  +
            .ok_or("failed to downcast to GetAsyncInvokeInput")?;
         242  +
         243  +
        let params = crate::config::endpoint::Params::builder()
         244  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         245  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         246  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         247  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         248  +
            .build()
         249  +
            .map_err(|err| {
         250  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         251  +
            })?;
         252  +
        cfg.interceptor_state()
         253  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         254  +
        ::std::result::Result::Ok(())
         255  +
    }
         256  +
}
         257  +
         258  +
// The get_* functions below are generated from JMESPath expressions in the
         259  +
// operationContextParams trait. They target the operation's input shape.
         260  +
         261  +
/// Error type for the `GetAsyncInvokeError` operation.
         262  +
#[non_exhaustive]
         263  +
#[derive(::std::fmt::Debug)]
         264  +
pub enum GetAsyncInvokeError {
         265  +
    /// <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>
         266  +
    AccessDeniedException(crate::types::error::AccessDeniedException),
         267  +
    /// <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>
         268  +
    InternalServerException(crate::types::error::InternalServerException),
         269  +
    /// <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>
         270  +
    ThrottlingException(crate::types::error::ThrottlingException),
         271  +
    /// <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>
         272  +
    ValidationException(crate::types::error::ValidationException),
         273  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         274  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         275  +
    variable wildcard pattern and check `.code()`:
         276  +
     \
         277  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         278  +
     \
         279  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetAsyncInvokeError) for what information is available for the error.")]
         280  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         281  +
}
         282  +
impl GetAsyncInvokeError {
         283  +
    /// Creates the `GetAsyncInvokeError::Unhandled` variant from any error type.
         284  +
    pub fn unhandled(
         285  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         286  +
    ) -> Self {
         287  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         288  +
            source: err.into(),
         289  +
            meta: ::std::default::Default::default(),
         290  +
        })
         291  +
    }
         292  +
         293  +
    /// Creates the `GetAsyncInvokeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         294  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         295  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         296  +
            source: err.clone().into(),
         297  +
            meta: err,
         298  +
        })
         299  +
    }
         300  +
    ///
         301  +
    /// Returns error metadata, which includes the error code, message,
         302  +
    /// request ID, and potentially additional information.
         303  +
    ///
         304  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         305  +
        match self {
         306  +
            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         307  +
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         308  +
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         309  +
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         310  +
            Self::Unhandled(e) => &e.meta,
         311  +
        }
         312  +
    }
         313  +
    /// Returns `true` if the error kind is `GetAsyncInvokeError::AccessDeniedException`.
         314  +
    pub fn is_access_denied_exception(&self) -> bool {
         315  +
        matches!(self, Self::AccessDeniedException(_))
         316  +
    }
         317  +
    /// Returns `true` if the error kind is `GetAsyncInvokeError::InternalServerException`.
         318  +
    pub fn is_internal_server_exception(&self) -> bool {
         319  +
        matches!(self, Self::InternalServerException(_))
         320  +
    }
         321  +
    /// Returns `true` if the error kind is `GetAsyncInvokeError::ThrottlingException`.
         322  +
    pub fn is_throttling_exception(&self) -> bool {
         323  +
        matches!(self, Self::ThrottlingException(_))
         324  +
    }
         325  +
    /// Returns `true` if the error kind is `GetAsyncInvokeError::ValidationException`.
         326  +
    pub fn is_validation_exception(&self) -> bool {
         327  +
        matches!(self, Self::ValidationException(_))
         328  +
    }
         329  +
}
         330  +
impl ::std::error::Error for GetAsyncInvokeError {
         331  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         332  +
        match self {
         333  +
            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
         334  +
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
         335  +
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         336  +
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
         337  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         338  +
        }
         339  +
    }
         340  +
}
         341  +
impl ::std::fmt::Display for GetAsyncInvokeError {
         342  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         343  +
        match self {
         344  +
            Self::AccessDeniedException(_inner) => _inner.fmt(f),
         345  +
            Self::InternalServerException(_inner) => _inner.fmt(f),
         346  +
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         347  +
            Self::ValidationException(_inner) => _inner.fmt(f),
         348  +
            Self::Unhandled(_inner) => {
         349  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         350  +
                    write!(f, "unhandled error ({code})")
         351  +
                } else {
         352  +
                    f.write_str("unhandled error")
         353  +
                }
         354  +
            }
         355  +
        }
         356  +
    }
         357  +
}
         358  +
impl ::aws_smithy_types::retry::ProvideErrorKind for GetAsyncInvokeError {
         359  +
    fn code(&self) -> ::std::option::Option<&str> {
         360  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         361  +
    }
         362  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         363  +
        ::std::option::Option::None
         364  +
    }
         365  +
}
         366  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetAsyncInvokeError {
         367  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         368  +
        match self {
         369  +
            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         370  +
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         371  +
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         372  +
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         373  +
            Self::Unhandled(_inner) => &_inner.meta,
         374  +
        }
         375  +
    }
         376  +
}
         377  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetAsyncInvokeError {
         378  +
    fn create_unhandled_error(
         379  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         380  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         381  +
    ) -> Self {
         382  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         383  +
            source,
         384  +
            meta: meta.unwrap_or_default(),
         385  +
        })
         386  +
    }
         387  +
}
         388  +
impl ::aws_types::request_id::RequestId for crate::operation::get_async_invoke::GetAsyncInvokeError {
         389  +
    fn request_id(&self) -> Option<&str> {
         390  +
        self.meta().request_id()
         391  +
    }
         392  +
}
         393  +
         394  +
pub use crate::operation::get_async_invoke::_get_async_invoke_output::GetAsyncInvokeOutput;
         395  +
         396  +
pub use crate::operation::get_async_invoke::_get_async_invoke_input::GetAsyncInvokeInput;
         397  +
         398  +
mod _get_async_invoke_input;
         399  +
         400  +
mod _get_async_invoke_output;
         401  +
         402  +
/// Builders
         403  +
pub mod builders;

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

@@ -0,1 +0,52 @@
           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 GetAsyncInvokeInput {
           6  +
    /// <p>The invocation's ARN.</p>
           7  +
    pub invocation_arn: ::std::option::Option<::std::string::String>,
           8  +
}
           9  +
impl GetAsyncInvokeInput {
          10  +
    /// <p>The invocation's ARN.</p>
          11  +
    pub fn invocation_arn(&self) -> ::std::option::Option<&str> {
          12  +
        self.invocation_arn.as_deref()
          13  +
    }
          14  +
}
          15  +
impl GetAsyncInvokeInput {
          16  +
    /// Creates a new builder-style object to manufacture [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
          17  +
    pub fn builder() -> crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder {
          18  +
        crate::operation::get_async_invoke::builders::GetAsyncInvokeInputBuilder::default()
          19  +
    }
          20  +
}
          21  +
          22  +
/// A builder for [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
          23  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
#[non_exhaustive]
          25  +
pub struct GetAsyncInvokeInputBuilder {
          26  +
    pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
          27  +
}
          28  +
impl GetAsyncInvokeInputBuilder {
          29  +
    /// <p>The invocation's ARN.</p>
          30  +
    /// This field is required.
          31  +
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          32  +
        self.invocation_arn = ::std::option::Option::Some(input.into());
          33  +
        self
          34  +
    }
          35  +
    /// <p>The invocation's ARN.</p>
          36  +
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          37  +
        self.invocation_arn = input;
          38  +
        self
          39  +
    }
          40  +
    /// <p>The invocation's ARN.</p>
          41  +
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
          42  +
        &self.invocation_arn
          43  +
    }
          44  +
    /// Consumes the builder and constructs a [`GetAsyncInvokeInput`](crate::operation::get_async_invoke::GetAsyncInvokeInput).
          45  +
    pub fn build(
          46  +
        self,
          47  +
    ) -> ::std::result::Result<crate::operation::get_async_invoke::GetAsyncInvokeInput, ::aws_smithy_types::error::operation::BuildError> {
          48  +
        ::std::result::Result::Ok(crate::operation::get_async_invoke::GetAsyncInvokeInput {
          49  +
            invocation_arn: self.invocation_arn,
          50  +
        })
          51  +
    }
          52  +
}

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

@@ -0,1 +0,308 @@
           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)]
           5  +
pub struct GetAsyncInvokeOutput {
           6  +
    /// <p>The invocation's ARN.</p>
           7  +
    pub invocation_arn: ::std::string::String,
           8  +
    /// <p>The invocation's model ARN.</p>
           9  +
    pub model_arn: ::std::string::String,
          10  +
    /// <p>The invocation's idempotency token.</p>
          11  +
    pub client_request_token: ::std::option::Option<::std::string::String>,
          12  +
    /// <p>The invocation's status.</p>
          13  +
    pub status: crate::types::AsyncInvokeStatus,
          14  +
    /// <p>An error message.</p>
          15  +
    pub failure_message: ::std::option::Option<::std::string::String>,
          16  +
    /// <p>When the invocation request was submitted.</p>
          17  +
    pub submit_time: ::aws_smithy_types::DateTime,
          18  +
    /// <p>The invocation's last modified time.</p>
          19  +
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
          20  +
    /// <p>When the invocation ended.</p>
          21  +
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
          22  +
    /// <p>Output data settings.</p>
          23  +
    pub output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
          24  +
    _request_id: Option<String>,
          25  +
}
          26  +
impl GetAsyncInvokeOutput {
          27  +
    /// <p>The invocation's ARN.</p>
          28  +
    pub fn invocation_arn(&self) -> &str {
          29  +
        use std::ops::Deref;
          30  +
        self.invocation_arn.deref()
          31  +
    }
          32  +
    /// <p>The invocation's model ARN.</p>
          33  +
    pub fn model_arn(&self) -> &str {
          34  +
        use std::ops::Deref;
          35  +
        self.model_arn.deref()
          36  +
    }
          37  +
    /// <p>The invocation's idempotency token.</p>
          38  +
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
          39  +
        self.client_request_token.as_deref()
          40  +
    }
          41  +
    /// <p>The invocation's status.</p>
          42  +
    pub fn status(&self) -> &crate::types::AsyncInvokeStatus {
          43  +
        &self.status
          44  +
    }
          45  +
    /// <p>An error message.</p>
          46  +
    pub fn failure_message(&self) -> ::std::option::Option<&str> {
          47  +
        self.failure_message.as_deref()
          48  +
    }
          49  +
    /// <p>When the invocation request was submitted.</p>
          50  +
    pub fn submit_time(&self) -> &::aws_smithy_types::DateTime {
          51  +
        &self.submit_time
          52  +
    }
          53  +
    /// <p>The invocation's last modified time.</p>
          54  +
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          55  +
        self.last_modified_time.as_ref()
          56  +
    }
          57  +
    /// <p>When the invocation ended.</p>
          58  +
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          59  +
        self.end_time.as_ref()
          60  +
    }
          61  +
    /// <p>Output data settings.</p>
          62  +
    pub fn output_data_config(&self) -> ::std::option::Option<&crate::types::AsyncInvokeOutputDataConfig> {
          63  +
        self.output_data_config.as_ref()
          64  +
    }
          65  +
}
          66  +
impl ::std::fmt::Debug for GetAsyncInvokeOutput {
          67  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          68  +
        let mut formatter = f.debug_struct("GetAsyncInvokeOutput");
          69  +
        formatter.field("invocation_arn", &self.invocation_arn);
          70  +
        formatter.field("model_arn", &self.model_arn);
          71  +
        formatter.field("client_request_token", &self.client_request_token);
          72  +
        formatter.field("status", &self.status);
          73  +
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
          74  +
        formatter.field("submit_time", &self.submit_time);
          75  +
        formatter.field("last_modified_time", &self.last_modified_time);
          76  +
        formatter.field("end_time", &self.end_time);
          77  +
        formatter.field("output_data_config", &self.output_data_config);
          78  +
        formatter.field("_request_id", &self._request_id);
          79  +
        formatter.finish()
          80  +
    }
          81  +
}
          82  +
impl ::aws_types::request_id::RequestId for GetAsyncInvokeOutput {
          83  +
    fn request_id(&self) -> Option<&str> {
          84  +
        self._request_id.as_deref()
          85  +
    }
          86  +
}
          87  +
impl GetAsyncInvokeOutput {
          88  +
    /// Creates a new builder-style object to manufacture [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
          89  +
    pub fn builder() -> crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder {
          90  +
        crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::default()
          91  +
    }
          92  +
}
          93  +
          94  +
/// A builder for [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
          95  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
          96  +
#[non_exhaustive]
          97  +
pub struct GetAsyncInvokeOutputBuilder {
          98  +
    pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
          99  +
    pub(crate) model_arn: ::std::option::Option<::std::string::String>,
         100  +
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
         101  +
    pub(crate) status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
         102  +
    pub(crate) failure_message: ::std::option::Option<::std::string::String>,
         103  +
    pub(crate) submit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         104  +
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         105  +
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         106  +
    pub(crate) output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
         107  +
    _request_id: Option<String>,
         108  +
}
         109  +
impl GetAsyncInvokeOutputBuilder {
         110  +
    /// <p>The invocation's ARN.</p>
         111  +
    /// This field is required.
         112  +
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.invocation_arn = ::std::option::Option::Some(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>The invocation's ARN.</p>
         117  +
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.invocation_arn = input;
         119  +
        self
         120  +
    }
         121  +
    /// <p>The invocation's ARN.</p>
         122  +
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        &self.invocation_arn
         124  +
    }
         125  +
    /// <p>The invocation's model ARN.</p>
         126  +
    /// This field is required.
         127  +
    pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         128  +
        self.model_arn = ::std::option::Option::Some(input.into());
         129  +
        self
         130  +
    }
         131  +
    /// <p>The invocation's model ARN.</p>
         132  +
    pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         133  +
        self.model_arn = input;
         134  +
        self
         135  +
    }
         136  +
    /// <p>The invocation's model ARN.</p>
         137  +
    pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
         138  +
        &self.model_arn
         139  +
    }
         140  +
    /// <p>The invocation's idempotency token.</p>
         141  +
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         142  +
        self.client_request_token = ::std::option::Option::Some(input.into());
         143  +
        self
         144  +
    }
         145  +
    /// <p>The invocation's idempotency token.</p>
         146  +
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         147  +
        self.client_request_token = input;
         148  +
        self
         149  +
    }
         150  +
    /// <p>The invocation's idempotency token.</p>
         151  +
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
         152  +
        &self.client_request_token
         153  +
    }
         154  +
    /// <p>The invocation's status.</p>
         155  +
    /// This field is required.
         156  +
    pub fn status(mut self, input: crate::types::AsyncInvokeStatus) -> Self {
         157  +
        self.status = ::std::option::Option::Some(input);
         158  +
        self
         159  +
    }
         160  +
    /// <p>The invocation's status.</p>
         161  +
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AsyncInvokeStatus>) -> Self {
         162  +
        self.status = input;
         163  +
        self
         164  +
    }
         165  +
    /// <p>The invocation's status.</p>
         166  +
    pub fn get_status(&self) -> &::std::option::Option<crate::types::AsyncInvokeStatus> {
         167  +
        &self.status
         168  +
    }
         169  +
    /// <p>An error message.</p>
         170  +
    pub fn failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         171  +
        self.failure_message = ::std::option::Option::Some(input.into());
         172  +
        self
         173  +
    }
         174  +
    /// <p>An error message.</p>
         175  +
    pub fn set_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         176  +
        self.failure_message = input;
         177  +
        self
         178  +
    }
         179  +
    /// <p>An error message.</p>
         180  +
    pub fn get_failure_message(&self) -> &::std::option::Option<::std::string::String> {
         181  +
        &self.failure_message
         182  +
    }
         183  +
    /// <p>When the invocation request was submitted.</p>
         184  +
    /// This field is required.
         185  +
    pub fn submit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         186  +
        self.submit_time = ::std::option::Option::Some(input);
         187  +
        self
         188  +
    }
         189  +
    /// <p>When the invocation request was submitted.</p>
         190  +
    pub fn set_submit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         191  +
        self.submit_time = input;
         192  +
        self
         193  +
    }
         194  +
    /// <p>When the invocation request was submitted.</p>
         195  +
    pub fn get_submit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         196  +
        &self.submit_time
         197  +
    }
         198  +
    /// <p>The invocation's last modified time.</p>
         199  +
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         200  +
        self.last_modified_time = ::std::option::Option::Some(input);
         201  +
        self
         202  +
    }
         203  +
    /// <p>The invocation's last modified time.</p>
         204  +
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         205  +
        self.last_modified_time = input;
         206  +
        self
         207  +
    }
         208  +
    /// <p>The invocation's last modified time.</p>
         209  +
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         210  +
        &self.last_modified_time
         211  +
    }
         212  +
    /// <p>When the invocation ended.</p>
         213  +
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         214  +
        self.end_time = ::std::option::Option::Some(input);
         215  +
        self
         216  +
    }
         217  +
    /// <p>When the invocation ended.</p>
         218  +
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         219  +
        self.end_time = input;
         220  +
        self
         221  +
    }
         222  +
    /// <p>When the invocation ended.</p>
         223  +
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         224  +
        &self.end_time
         225  +
    }
         226  +
    /// <p>Output data settings.</p>
         227  +
    /// This field is required.
         228  +
    pub fn output_data_config(mut self, input: crate::types::AsyncInvokeOutputDataConfig) -> Self {
         229  +
        self.output_data_config = ::std::option::Option::Some(input);
         230  +
        self
         231  +
    }
         232  +
    /// <p>Output data settings.</p>
         233  +
    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>) -> Self {
         234  +
        self.output_data_config = input;
         235  +
        self
         236  +
    }
         237  +
    /// <p>Output data settings.</p>
         238  +
    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::AsyncInvokeOutputDataConfig> {
         239  +
        &self.output_data_config
         240  +
    }
         241  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         242  +
        self._request_id = Some(request_id.into());
         243  +
        self
         244  +
    }
         245  +
         246  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         247  +
        self._request_id = request_id;
         248  +
        self
         249  +
    }
         250  +
    /// Consumes the builder and constructs a [`GetAsyncInvokeOutput`](crate::operation::get_async_invoke::GetAsyncInvokeOutput).
         251  +
    /// This method will fail if any of the following fields are not set:
         252  +
    /// - [`invocation_arn`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::invocation_arn)
         253  +
    /// - [`model_arn`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::model_arn)
         254  +
    /// - [`status`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::status)
         255  +
    /// - [`submit_time`](crate::operation::get_async_invoke::builders::GetAsyncInvokeOutputBuilder::submit_time)
         256  +
    pub fn build(
         257  +
        self,
         258  +
    ) -> ::std::result::Result<crate::operation::get_async_invoke::GetAsyncInvokeOutput, ::aws_smithy_types::error::operation::BuildError> {
         259  +
        ::std::result::Result::Ok(crate::operation::get_async_invoke::GetAsyncInvokeOutput {
         260  +
            invocation_arn: self.invocation_arn.ok_or_else(|| {
         261  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         262  +
                    "invocation_arn",
         263  +
                    "invocation_arn was not specified but it is required when building GetAsyncInvokeOutput",
         264  +
                )
         265  +
            })?,
         266  +
            model_arn: self.model_arn.ok_or_else(|| {
         267  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         268  +
                    "model_arn",
         269  +
                    "model_arn was not specified but it is required when building GetAsyncInvokeOutput",
         270  +
                )
         271  +
            })?,
         272  +
            client_request_token: self.client_request_token,
         273  +
            status: self.status.ok_or_else(|| {
         274  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         275  +
                    "status",
         276  +
                    "status was not specified but it is required when building GetAsyncInvokeOutput",
         277  +
                )
         278  +
            })?,
         279  +
            failure_message: self.failure_message,
         280  +
            submit_time: self.submit_time.ok_or_else(|| {
         281  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         282  +
                    "submit_time",
         283  +
                    "submit_time was not specified but it is required when building GetAsyncInvokeOutput",
         284  +
                )
         285  +
            })?,
         286  +
            last_modified_time: self.last_modified_time,
         287  +
            end_time: self.end_time,
         288  +
            output_data_config: self.output_data_config,
         289  +
            _request_id: self._request_id,
         290  +
        })
         291  +
    }
         292  +
}
         293  +
impl ::std::fmt::Debug for GetAsyncInvokeOutputBuilder {
         294  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         295  +
        let mut formatter = f.debug_struct("GetAsyncInvokeOutputBuilder");
         296  +
        formatter.field("invocation_arn", &self.invocation_arn);
         297  +
        formatter.field("model_arn", &self.model_arn);
         298  +
        formatter.field("client_request_token", &self.client_request_token);
         299  +
        formatter.field("status", &self.status);
         300  +
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
         301  +
        formatter.field("submit_time", &self.submit_time);
         302  +
        formatter.field("last_modified_time", &self.last_modified_time);
         303  +
        formatter.field("end_time", &self.end_time);
         304  +
        formatter.field("output_data_config", &self.output_data_config);
         305  +
        formatter.field("_request_id", &self._request_id);
         306  +
        formatter.finish()
         307  +
    }
         308  +
}