aws-sdk-bedrock 1.145.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 CreateEvaluationJobInput {
    /// <p>A name for the evaluation job. Names must unique with your Amazon Web Services account, and your account's Amazon Web Services region.</p>
    pub job_name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the evaluation job.</p>
    pub job_description: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub client_request_token: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. To learn more about the required permissions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required permissions for model evaluations</a>.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
    pub customer_encryption_key_id: ::std::option::Option<::std::string::String>,
    /// <p>Tags to attach to the model evaluation job.</p>
    pub job_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
    pub application_type: ::std::option::Option<crate::types::ApplicationType>,
    /// <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
    pub evaluation_config: ::std::option::Option<crate::types::EvaluationConfig>,
    /// <p>Contains the configuration details of the inference model for the evaluation job.</p>
    /// <p>For model evaluation jobs, automated jobs support a single model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support two models or inference profiles.</p>
    pub inference_config: ::std::option::Option<crate::types::EvaluationInferenceConfig>,
    /// <p>Contains the configuration details of the Amazon S3 bucket for storing the results of the evaluation job.</p>
    pub output_data_config: ::std::option::Option<crate::types::EvaluationOutputDataConfig>,
}
impl CreateEvaluationJobInput {
    /// <p>A name for the evaluation job. Names must unique with your Amazon Web Services account, and your account's Amazon Web Services region.</p>
    pub fn job_name(&self) -> ::std::option::Option<&str> {
        self.job_name.as_deref()
    }
    /// <p>A description of the evaluation job.</p>
    pub fn job_description(&self) -> ::std::option::Option<&str> {
        self.job_description.as_deref()
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. To learn more about the required permissions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required permissions for model evaluations</a>.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
    pub fn customer_encryption_key_id(&self) -> ::std::option::Option<&str> {
        self.customer_encryption_key_id.as_deref()
    }
    /// <p>Tags to attach to the model evaluation job.</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 `.job_tags.is_none()`.
    pub fn job_tags(&self) -> &[crate::types::Tag] {
        self.job_tags.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
    pub fn application_type(&self) -> ::std::option::Option<&crate::types::ApplicationType> {
        self.application_type.as_ref()
    }
    /// <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
    pub fn evaluation_config(&self) -> ::std::option::Option<&crate::types::EvaluationConfig> {
        self.evaluation_config.as_ref()
    }
    /// <p>Contains the configuration details of the inference model for the evaluation job.</p>
    /// <p>For model evaluation jobs, automated jobs support a single model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support two models or inference profiles.</p>
    pub fn inference_config(&self) -> ::std::option::Option<&crate::types::EvaluationInferenceConfig> {
        self.inference_config.as_ref()
    }
    /// <p>Contains the configuration details of the Amazon S3 bucket for storing the results of the evaluation job.</p>
    pub fn output_data_config(&self) -> ::std::option::Option<&crate::types::EvaluationOutputDataConfig> {
        self.output_data_config.as_ref()
    }
}
impl ::std::fmt::Debug for CreateEvaluationJobInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEvaluationJobInput");
        formatter.field("job_name", &self.job_name);
        formatter.field("job_description", &"*** Sensitive Data Redacted ***");
        formatter.field("client_request_token", &self.client_request_token);
        formatter.field("role_arn", &self.role_arn);
        formatter.field("customer_encryption_key_id", &self.customer_encryption_key_id);
        formatter.field("job_tags", &self.job_tags);
        formatter.field("application_type", &self.application_type);
        formatter.field("evaluation_config", &self.evaluation_config);
        formatter.field("inference_config", &self.inference_config);
        formatter.field("output_data_config", &self.output_data_config);
        formatter.finish()
    }
}
impl CreateEvaluationJobInput {
    /// Creates a new builder-style object to manufacture [`CreateEvaluationJobInput`](crate::operation::create_evaluation_job::CreateEvaluationJobInput).
    pub fn builder() -> crate::operation::create_evaluation_job::builders::CreateEvaluationJobInputBuilder {
        crate::operation::create_evaluation_job::builders::CreateEvaluationJobInputBuilder::default()
    }
}

/// A builder for [`CreateEvaluationJobInput`](crate::operation::create_evaluation_job::CreateEvaluationJobInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateEvaluationJobInputBuilder {
    pub(crate) job_name: ::std::option::Option<::std::string::String>,
    pub(crate) job_description: ::std::option::Option<::std::string::String>,
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) customer_encryption_key_id: ::std::option::Option<::std::string::String>,
    pub(crate) job_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) application_type: ::std::option::Option<crate::types::ApplicationType>,
    pub(crate) evaluation_config: ::std::option::Option<crate::types::EvaluationConfig>,
    pub(crate) inference_config: ::std::option::Option<crate::types::EvaluationInferenceConfig>,
    pub(crate) output_data_config: ::std::option::Option<crate::types::EvaluationOutputDataConfig>,
}
impl CreateEvaluationJobInputBuilder {
    /// <p>A name for the evaluation job. Names must unique with your Amazon Web Services account, and your account's Amazon Web Services region.</p>
    /// This field is required.
    pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for the evaluation job. Names must unique with your Amazon Web Services account, and your account's Amazon Web Services region.</p>
    pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_name = input;
        self
    }
    /// <p>A name for the evaluation job. Names must unique with your Amazon Web Services account, and your account's Amazon Web Services region.</p>
    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_name
    }
    /// <p>A description of the evaluation job.</p>
    pub fn job_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the evaluation job.</p>
    pub fn set_job_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_description = input;
        self
    }
    /// <p>A description of the evaluation job.</p>
    pub fn get_job_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_description
    }
    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</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 to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</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 to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_token
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. To learn more about the required permissions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required permissions for model evaluations</a>.</p>
    /// This field is required.
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. To learn more about the required permissions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required permissions for model evaluations</a>.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. To learn more about the required permissions, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required permissions for model evaluations</a>.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
    pub fn customer_encryption_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.customer_encryption_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
    pub fn set_customer_encryption_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.customer_encryption_key_id = input;
        self
    }
    /// <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
    pub fn get_customer_encryption_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.customer_encryption_key_id
    }
    /// Appends an item to `job_tags`.
    ///
    /// To override the contents of this collection use [`set_job_tags`](Self::set_job_tags).
    ///
    /// <p>Tags to attach to the model evaluation job.</p>
    pub fn job_tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.job_tags.unwrap_or_default();
        v.push(input);
        self.job_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Tags to attach to the model evaluation job.</p>
    pub fn set_job_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.job_tags = input;
        self
    }
    /// <p>Tags to attach to the model evaluation job.</p>
    pub fn get_job_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.job_tags
    }
    /// <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
    pub fn application_type(mut self, input: crate::types::ApplicationType) -> Self {
        self.application_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
    pub fn set_application_type(mut self, input: ::std::option::Option<crate::types::ApplicationType>) -> Self {
        self.application_type = input;
        self
    }
    /// <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
    pub fn get_application_type(&self) -> &::std::option::Option<crate::types::ApplicationType> {
        &self.application_type
    }
    /// <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
    /// This field is required.
    pub fn evaluation_config(mut self, input: crate::types::EvaluationConfig) -> Self {
        self.evaluation_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
    pub fn set_evaluation_config(mut self, input: ::std::option::Option<crate::types::EvaluationConfig>) -> Self {
        self.evaluation_config = input;
        self
    }
    /// <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
    pub fn get_evaluation_config(&self) -> &::std::option::Option<crate::types::EvaluationConfig> {
        &self.evaluation_config
    }
    /// <p>Contains the configuration details of the inference model for the evaluation job.</p>
    /// <p>For model evaluation jobs, automated jobs support a single model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support two models or inference profiles.</p>
    /// This field is required.
    pub fn inference_config(mut self, input: crate::types::EvaluationInferenceConfig) -> Self {
        self.inference_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains the configuration details of the inference model for the evaluation job.</p>
    /// <p>For model evaluation jobs, automated jobs support a single model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support two models or inference profiles.</p>
    pub fn set_inference_config(mut self, input: ::std::option::Option<crate::types::EvaluationInferenceConfig>) -> Self {
        self.inference_config = input;
        self
    }
    /// <p>Contains the configuration details of the inference model for the evaluation job.</p>
    /// <p>For model evaluation jobs, automated jobs support a single model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support two models or inference profiles.</p>
    pub fn get_inference_config(&self) -> &::std::option::Option<crate::types::EvaluationInferenceConfig> {
        &self.inference_config
    }
    /// <p>Contains the configuration details of the Amazon S3 bucket for storing the results of the evaluation job.</p>
    /// This field is required.
    pub fn output_data_config(mut self, input: crate::types::EvaluationOutputDataConfig) -> Self {
        self.output_data_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains the configuration details of the Amazon S3 bucket for storing the results of the evaluation job.</p>
    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::EvaluationOutputDataConfig>) -> Self {
        self.output_data_config = input;
        self
    }
    /// <p>Contains the configuration details of the Amazon S3 bucket for storing the results of the evaluation job.</p>
    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::EvaluationOutputDataConfig> {
        &self.output_data_config
    }
    /// Consumes the builder and constructs a [`CreateEvaluationJobInput`](crate::operation::create_evaluation_job::CreateEvaluationJobInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_evaluation_job::CreateEvaluationJobInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_evaluation_job::CreateEvaluationJobInput {
            job_name: self.job_name,
            job_description: self.job_description,
            client_request_token: self.client_request_token,
            role_arn: self.role_arn,
            customer_encryption_key_id: self.customer_encryption_key_id,
            job_tags: self.job_tags,
            application_type: self.application_type,
            evaluation_config: self.evaluation_config,
            inference_config: self.inference_config,
            output_data_config: self.output_data_config,
        })
    }
}
impl ::std::fmt::Debug for CreateEvaluationJobInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEvaluationJobInputBuilder");
        formatter.field("job_name", &self.job_name);
        formatter.field("job_description", &"*** Sensitive Data Redacted ***");
        formatter.field("client_request_token", &self.client_request_token);
        formatter.field("role_arn", &self.role_arn);
        formatter.field("customer_encryption_key_id", &self.customer_encryption_key_id);
        formatter.field("job_tags", &self.job_tags);
        formatter.field("application_type", &self.application_type);
        formatter.field("evaluation_config", &self.evaluation_config);
        formatter.field("inference_config", &self.inference_config);
        formatter.field("output_data_config", &self.output_data_config);
        formatter.finish()
    }
}