aws-sdk-sagemaker 1.189.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 CreateTrainingPlanInput {
    /// <p>The name of the training plan to create.</p>
    pub training_plan_name: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the training plan offering to use for creating this plan.</p>
    pub training_plan_offering_id: ::std::option::Option<::std::string::String>,
    /// <p>Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.</p>
    pub spare_instance_count_per_ultra_server: ::std::option::Option<i32>,
    /// <p>An array of key-value pairs to apply to this training plan.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateTrainingPlanInput {
    /// <p>The name of the training plan to create.</p>
    pub fn training_plan_name(&self) -> ::std::option::Option<&str> {
        self.training_plan_name.as_deref()
    }
    /// <p>The unique identifier of the training plan offering to use for creating this plan.</p>
    pub fn training_plan_offering_id(&self) -> ::std::option::Option<&str> {
        self.training_plan_offering_id.as_deref()
    }
    /// <p>Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.</p>
    pub fn spare_instance_count_per_ultra_server(&self) -> ::std::option::Option<i32> {
        self.spare_instance_count_per_ultra_server
    }
    /// <p>An array of key-value pairs to apply to this training plan.</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 CreateTrainingPlanInput {
    /// Creates a new builder-style object to manufacture [`CreateTrainingPlanInput`](crate::operation::create_training_plan::CreateTrainingPlanInput).
    pub fn builder() -> crate::operation::create_training_plan::builders::CreateTrainingPlanInputBuilder {
        crate::operation::create_training_plan::builders::CreateTrainingPlanInputBuilder::default()
    }
}

/// A builder for [`CreateTrainingPlanInput`](crate::operation::create_training_plan::CreateTrainingPlanInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTrainingPlanInputBuilder {
    pub(crate) training_plan_name: ::std::option::Option<::std::string::String>,
    pub(crate) training_plan_offering_id: ::std::option::Option<::std::string::String>,
    pub(crate) spare_instance_count_per_ultra_server: ::std::option::Option<i32>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateTrainingPlanInputBuilder {
    /// <p>The name of the training plan to create.</p>
    /// This field is required.
    pub fn training_plan_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.training_plan_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the training plan to create.</p>
    pub fn set_training_plan_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.training_plan_name = input;
        self
    }
    /// <p>The name of the training plan to create.</p>
    pub fn get_training_plan_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.training_plan_name
    }
    /// <p>The unique identifier of the training plan offering to use for creating this plan.</p>
    /// This field is required.
    pub fn training_plan_offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.training_plan_offering_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the training plan offering to use for creating this plan.</p>
    pub fn set_training_plan_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.training_plan_offering_id = input;
        self
    }
    /// <p>The unique identifier of the training plan offering to use for creating this plan.</p>
    pub fn get_training_plan_offering_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.training_plan_offering_id
    }
    /// <p>Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.</p>
    pub fn spare_instance_count_per_ultra_server(mut self, input: i32) -> Self {
        self.spare_instance_count_per_ultra_server = ::std::option::Option::Some(input);
        self
    }
    /// <p>Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.</p>
    pub fn set_spare_instance_count_per_ultra_server(mut self, input: ::std::option::Option<i32>) -> Self {
        self.spare_instance_count_per_ultra_server = input;
        self
    }
    /// <p>Number of spare instances to reserve per UltraServer for enhanced resiliency. Default is 1.</p>
    pub fn get_spare_instance_count_per_ultra_server(&self) -> &::std::option::Option<i32> {
        &self.spare_instance_count_per_ultra_server
    }
    /// 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 training plan.</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 training plan.</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 training plan.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateTrainingPlanInput`](crate::operation::create_training_plan::CreateTrainingPlanInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_training_plan::CreateTrainingPlanInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_training_plan::CreateTrainingPlanInput {
            training_plan_name: self.training_plan_name,
            training_plan_offering_id: self.training_plan_offering_id,
            spare_instance_count_per_ultra_server: self.spare_instance_count_per_ultra_server,
            tags: self.tags,
        })
    }
}