aws-sdk-sagemaker 1.193.0

AWS SDK for Amazon SageMaker Service
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, ::std::fmt::Debug)]
pub struct CreateCompilationJobInput {
    /// <p>A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.</p>
    pub compilation_job_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
    /// <p>During model compilation, Amazon SageMaker AI needs your permission to:</p>
    /// <ul>
    /// <li>
    /// <p>Read input data from an S3 bucket</p></li>
    /// <li>
    /// <p>Write model artifacts to an S3 bucket</p></li>
    /// <li>
    /// <p>Write logs to Amazon CloudWatch Logs</p></li>
    /// <li>
    /// <p>Publish metrics to Amazon CloudWatch</p></li>
    /// </ul>
    /// <p>You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">Amazon SageMaker AI Roles.</a></p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of a versioned model package. Provide either a <code>ModelPackageVersionArn</code> or an <code>InputConfig</code> object in the request syntax. The presence of both objects in the <code>CreateCompilationJob</code> request will return an exception.</p>
    pub model_package_version_arn: ::std::option::Option<::std::string::String>,
    /// <p>Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.</p>
    pub input_config: ::std::option::Option<crate::types::InputConfig>,
    /// <p>Provides information about the output location for the compiled model and the target device the model runs on.</p>
    pub output_config: ::std::option::Option<crate::types::OutputConfig>,
    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html">Protect Compilation Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
    pub vpc_config: ::std::option::Option<crate::types::NeoVpcConfig>,
    /// <p>Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.</p>
    pub stopping_condition: ::std::option::Option<crate::types::StoppingCondition>,
    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateCompilationJobInput {
    /// <p>A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.</p>
    pub fn compilation_job_name(&self) -> ::std::option::Option<&str> {
        self.compilation_job_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
    /// <p>During model compilation, Amazon SageMaker AI needs your permission to:</p>
    /// <ul>
    /// <li>
    /// <p>Read input data from an S3 bucket</p></li>
    /// <li>
    /// <p>Write model artifacts to an S3 bucket</p></li>
    /// <li>
    /// <p>Write logs to Amazon CloudWatch Logs</p></li>
    /// <li>
    /// <p>Publish metrics to Amazon CloudWatch</p></li>
    /// </ul>
    /// <p>You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">Amazon SageMaker AI Roles.</a></p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of a versioned model package. Provide either a <code>ModelPackageVersionArn</code> or an <code>InputConfig</code> object in the request syntax. The presence of both objects in the <code>CreateCompilationJob</code> request will return an exception.</p>
    pub fn model_package_version_arn(&self) -> ::std::option::Option<&str> {
        self.model_package_version_arn.as_deref()
    }
    /// <p>Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.</p>
    pub fn input_config(&self) -> ::std::option::Option<&crate::types::InputConfig> {
        self.input_config.as_ref()
    }
    /// <p>Provides information about the output location for the compiled model and the target device the model runs on.</p>
    pub fn output_config(&self) -> ::std::option::Option<&crate::types::OutputConfig> {
        self.output_config.as_ref()
    }
    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html">Protect Compilation Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::NeoVpcConfig> {
        self.vpc_config.as_ref()
    }
    /// <p>Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.</p>
    pub fn stopping_condition(&self) -> ::std::option::Option<&crate::types::StoppingCondition> {
        self.stopping_condition.as_ref()
    }
    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</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 CreateCompilationJobInput {
    /// Creates a new builder-style object to manufacture [`CreateCompilationJobInput`](crate::operation::create_compilation_job::CreateCompilationJobInput).
    pub fn builder() -> crate::operation::create_compilation_job::builders::CreateCompilationJobInputBuilder {
        crate::operation::create_compilation_job::builders::CreateCompilationJobInputBuilder::default()
    }
}

/// A builder for [`CreateCompilationJobInput`](crate::operation::create_compilation_job::CreateCompilationJobInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCompilationJobInputBuilder {
    pub(crate) compilation_job_name: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) model_package_version_arn: ::std::option::Option<::std::string::String>,
    pub(crate) input_config: ::std::option::Option<crate::types::InputConfig>,
    pub(crate) output_config: ::std::option::Option<crate::types::OutputConfig>,
    pub(crate) vpc_config: ::std::option::Option<crate::types::NeoVpcConfig>,
    pub(crate) stopping_condition: ::std::option::Option<crate::types::StoppingCondition>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateCompilationJobInputBuilder {
    /// <p>A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.</p>
    /// This field is required.
    pub fn compilation_job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.compilation_job_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.</p>
    pub fn set_compilation_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.compilation_job_name = input;
        self
    }
    /// <p>A name for the model compilation job. The name must be unique within the Amazon Web Services Region and within your Amazon Web Services account.</p>
    pub fn get_compilation_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.compilation_job_name
    }
    /// <p>The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
    /// <p>During model compilation, Amazon SageMaker AI needs your permission to:</p>
    /// <ul>
    /// <li>
    /// <p>Read input data from an S3 bucket</p></li>
    /// <li>
    /// <p>Write model artifacts to an S3 bucket</p></li>
    /// <li>
    /// <p>Write logs to Amazon CloudWatch Logs</p></li>
    /// <li>
    /// <p>Publish metrics to Amazon CloudWatch</p></li>
    /// </ul>
    /// <p>You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">Amazon SageMaker AI Roles.</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 role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
    /// <p>During model compilation, Amazon SageMaker AI needs your permission to:</p>
    /// <ul>
    /// <li>
    /// <p>Read input data from an S3 bucket</p></li>
    /// <li>
    /// <p>Write model artifacts to an S3 bucket</p></li>
    /// <li>
    /// <p>Write logs to Amazon CloudWatch Logs</p></li>
    /// <li>
    /// <p>Publish metrics to Amazon CloudWatch</p></li>
    /// </ul>
    /// <p>You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">Amazon SageMaker AI Roles.</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 role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
    /// <p>During model compilation, Amazon SageMaker AI needs your permission to:</p>
    /// <ul>
    /// <li>
    /// <p>Read input data from an S3 bucket</p></li>
    /// <li>
    /// <p>Write model artifacts to an S3 bucket</p></li>
    /// <li>
    /// <p>Write logs to Amazon CloudWatch Logs</p></li>
    /// <li>
    /// <p>Publish metrics to Amazon CloudWatch</p></li>
    /// </ul>
    /// <p>You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">Amazon SageMaker AI Roles.</a></p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>The Amazon Resource Name (ARN) of a versioned model package. Provide either a <code>ModelPackageVersionArn</code> or an <code>InputConfig</code> object in the request syntax. The presence of both objects in the <code>CreateCompilationJob</code> request will return an exception.</p>
    pub fn model_package_version_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.model_package_version_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a versioned model package. Provide either a <code>ModelPackageVersionArn</code> or an <code>InputConfig</code> object in the request syntax. The presence of both objects in the <code>CreateCompilationJob</code> request will return an exception.</p>
    pub fn set_model_package_version_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.model_package_version_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a versioned model package. Provide either a <code>ModelPackageVersionArn</code> or an <code>InputConfig</code> object in the request syntax. The presence of both objects in the <code>CreateCompilationJob</code> request will return an exception.</p>
    pub fn get_model_package_version_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.model_package_version_arn
    }
    /// <p>Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.</p>
    pub fn input_config(mut self, input: crate::types::InputConfig) -> Self {
        self.input_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.</p>
    pub fn set_input_config(mut self, input: ::std::option::Option<crate::types::InputConfig>) -> Self {
        self.input_config = input;
        self
    }
    /// <p>Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.</p>
    pub fn get_input_config(&self) -> &::std::option::Option<crate::types::InputConfig> {
        &self.input_config
    }
    /// <p>Provides information about the output location for the compiled model and the target device the model runs on.</p>
    /// This field is required.
    pub fn output_config(mut self, input: crate::types::OutputConfig) -> Self {
        self.output_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides information about the output location for the compiled model and the target device the model runs on.</p>
    pub fn set_output_config(mut self, input: ::std::option::Option<crate::types::OutputConfig>) -> Self {
        self.output_config = input;
        self
    }
    /// <p>Provides information about the output location for the compiled model and the target device the model runs on.</p>
    pub fn get_output_config(&self) -> &::std::option::Option<crate::types::OutputConfig> {
        &self.output_config
    }
    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html">Protect Compilation Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
    pub fn vpc_config(mut self, input: crate::types::NeoVpcConfig) -> Self {
        self.vpc_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html">Protect Compilation Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::NeoVpcConfig>) -> Self {
        self.vpc_config = input;
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> object that specifies the VPC that you want your compilation job to connect to. Control access to your models by configuring the VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/neo-vpc.html">Protect Compilation Jobs by Using an Amazon Virtual Private Cloud</a>.</p>
    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::NeoVpcConfig> {
        &self.vpc_config
    }
    /// <p>Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.</p>
    /// This field is required.
    pub fn stopping_condition(mut self, input: crate::types::StoppingCondition) -> Self {
        self.stopping_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.</p>
    pub fn set_stopping_condition(mut self, input: ::std::option::Option<crate::types::StoppingCondition>) -> Self {
        self.stopping_condition = input;
        self
    }
    /// <p>Specifies a limit to how long a model compilation job can run. When the job reaches the time limit, Amazon SageMaker AI ends the compilation job. Use this API to cap model training costs.</p>
    pub fn get_stopping_condition(&self) -> &::std::option::Option<crate::types::StoppingCondition> {
        &self.stopping_condition
    }
    /// 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. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</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. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</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. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateCompilationJobInput`](crate::operation::create_compilation_job::CreateCompilationJobInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_compilation_job::CreateCompilationJobInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_compilation_job::CreateCompilationJobInput {
            compilation_job_name: self.compilation_job_name,
            role_arn: self.role_arn,
            model_package_version_arn: self.model_package_version_arn,
            input_config: self.input_config,
            output_config: self.output_config,
            vpc_config: self.vpc_config,
            stopping_condition: self.stopping_condition,
            tags: self.tags,
        })
    }
}