aws-sdk-bedrock 1.143.0

AWS SDK for Amazon Bedrock
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreatePromptRouterInput {
    /// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
    pub client_request_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
    pub prompt_router_name: ::std::option::Option<::std::string::String>,
    /// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
    pub models: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>,
    /// <p>An optional description of the prompt router to help identify its purpose.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
    pub routing_criteria: ::std::option::Option<crate::types::RoutingCriteria>,
    /// <p>The default model to use when the routing criteria is not met.</p>
    pub fallback_model: ::std::option::Option<crate::types::PromptRouterTargetModel>,
    /// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreatePromptRouterInput {
    /// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
    /// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
    pub fn prompt_router_name(&self) -> ::std::option::Option<&str> {
        self.prompt_router_name.as_deref()
    }
    /// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.models.is_none()`.
    pub fn models(&self) -> &[crate::types::PromptRouterTargetModel] {
        self.models.as_deref().unwrap_or_default()
    }
    /// <p>An optional description of the prompt router to help identify its purpose.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
    pub fn routing_criteria(&self) -> ::std::option::Option<&crate::types::RoutingCriteria> {
        self.routing_criteria.as_ref()
    }
    /// <p>The default model to use when the routing criteria is not met.</p>
    pub fn fallback_model(&self) -> ::std::option::Option<&crate::types::PromptRouterTargetModel> {
        self.fallback_model.as_ref()
    }
    /// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for CreatePromptRouterInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreatePromptRouterInput");
        formatter.field("client_request_token", &self.client_request_token);
        formatter.field("prompt_router_name", &self.prompt_router_name);
        formatter.field("models", &self.models);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("routing_criteria", &self.routing_criteria);
        formatter.field("fallback_model", &self.fallback_model);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl CreatePromptRouterInput {
    /// Creates a new builder-style object to manufacture [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
    pub fn builder() -> crate::operation::create_prompt_router::builders::CreatePromptRouterInputBuilder {
        crate::operation::create_prompt_router::builders::CreatePromptRouterInputBuilder::default()
    }
}

/// A builder for [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreatePromptRouterInputBuilder {
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
    pub(crate) prompt_router_name: ::std::option::Option<::std::string::String>,
    pub(crate) models: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) routing_criteria: ::std::option::Option<crate::types::RoutingCriteria>,
    pub(crate) fallback_model: ::std::option::Option<crate::types::PromptRouterTargetModel>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreatePromptRouterInputBuilder {
    /// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_request_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_token
    }
    /// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
    /// This field is required.
    pub fn prompt_router_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prompt_router_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
    pub fn set_prompt_router_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prompt_router_name = input;
        self
    }
    /// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
    pub fn get_prompt_router_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.prompt_router_name
    }
    /// Appends an item to `models`.
    ///
    /// To override the contents of this collection use [`set_models`](Self::set_models).
    ///
    /// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
    pub fn models(mut self, input: crate::types::PromptRouterTargetModel) -> Self {
        let mut v = self.models.unwrap_or_default();
        v.push(input);
        self.models = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
    pub fn set_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>) -> Self {
        self.models = input;
        self
    }
    /// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
    pub fn get_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>> {
        &self.models
    }
    /// <p>An optional description of the prompt router to help identify its purpose.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional description of the prompt router to help identify its purpose.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>An optional description of the prompt router to help identify its purpose.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
    /// This field is required.
    pub fn routing_criteria(mut self, input: crate::types::RoutingCriteria) -> Self {
        self.routing_criteria = ::std::option::Option::Some(input);
        self
    }
    /// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
    pub fn set_routing_criteria(mut self, input: ::std::option::Option<crate::types::RoutingCriteria>) -> Self {
        self.routing_criteria = input;
        self
    }
    /// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
    pub fn get_routing_criteria(&self) -> &::std::option::Option<crate::types::RoutingCriteria> {
        &self.routing_criteria
    }
    /// <p>The default model to use when the routing criteria is not met.</p>
    /// This field is required.
    pub fn fallback_model(mut self, input: crate::types::PromptRouterTargetModel) -> Self {
        self.fallback_model = ::std::option::Option::Some(input);
        self
    }
    /// <p>The default model to use when the routing criteria is not met.</p>
    pub fn set_fallback_model(mut self, input: ::std::option::Option<crate::types::PromptRouterTargetModel>) -> Self {
        self.fallback_model = input;
        self
    }
    /// <p>The default model to use when the routing criteria is not met.</p>
    pub fn get_fallback_model(&self) -> &::std::option::Option<crate::types::PromptRouterTargetModel> {
        &self.fallback_model
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_prompt_router::CreatePromptRouterInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_prompt_router::CreatePromptRouterInput {
            client_request_token: self.client_request_token,
            prompt_router_name: self.prompt_router_name,
            models: self.models,
            description: self.description,
            routing_criteria: self.routing_criteria,
            fallback_model: self.fallback_model,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for CreatePromptRouterInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreatePromptRouterInputBuilder");
        formatter.field("client_request_token", &self.client_request_token);
        formatter.field("prompt_router_name", &self.prompt_router_name);
        formatter.field("models", &self.models);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("routing_criteria", &self.routing_criteria);
        formatter.field("fallback_model", &self.fallback_model);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}