aws-sdk-sagemaker 1.198.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 UpdateInferenceComponentInput {
    /// <p>The name of the inference component.</p>
    pub inference_component_name: ::std::option::Option<::std::string::String>,
    /// <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
    pub specification: ::std::option::Option<crate::types::InferenceComponentSpecification>,
    /// <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</p>
    pub specifications: ::std::option::Option<::std::vec::Vec<crate::types::InferenceComponentSpecification>>,
    /// <p>Runtime settings for a model that is deployed with an inference component.</p>
    pub runtime_config: ::std::option::Option<crate::types::InferenceComponentRuntimeConfig>,
    /// <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>
    pub deployment_config: ::std::option::Option<crate::types::InferenceComponentDeploymentConfig>,
}
impl UpdateInferenceComponentInput {
    /// <p>The name of the inference component.</p>
    pub fn inference_component_name(&self) -> ::std::option::Option<&str> {
        self.inference_component_name.as_deref()
    }
    /// <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
    pub fn specification(&self) -> ::std::option::Option<&crate::types::InferenceComponentSpecification> {
        self.specification.as_ref()
    }
    /// <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</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 `.specifications.is_none()`.
    pub fn specifications(&self) -> &[crate::types::InferenceComponentSpecification] {
        self.specifications.as_deref().unwrap_or_default()
    }
    /// <p>Runtime settings for a model that is deployed with an inference component.</p>
    pub fn runtime_config(&self) -> ::std::option::Option<&crate::types::InferenceComponentRuntimeConfig> {
        self.runtime_config.as_ref()
    }
    /// <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>
    pub fn deployment_config(&self) -> ::std::option::Option<&crate::types::InferenceComponentDeploymentConfig> {
        self.deployment_config.as_ref()
    }
}
impl UpdateInferenceComponentInput {
    /// Creates a new builder-style object to manufacture [`UpdateInferenceComponentInput`](crate::operation::update_inference_component::UpdateInferenceComponentInput).
    pub fn builder() -> crate::operation::update_inference_component::builders::UpdateInferenceComponentInputBuilder {
        crate::operation::update_inference_component::builders::UpdateInferenceComponentInputBuilder::default()
    }
}

/// A builder for [`UpdateInferenceComponentInput`](crate::operation::update_inference_component::UpdateInferenceComponentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateInferenceComponentInputBuilder {
    pub(crate) inference_component_name: ::std::option::Option<::std::string::String>,
    pub(crate) specification: ::std::option::Option<crate::types::InferenceComponentSpecification>,
    pub(crate) specifications: ::std::option::Option<::std::vec::Vec<crate::types::InferenceComponentSpecification>>,
    pub(crate) runtime_config: ::std::option::Option<crate::types::InferenceComponentRuntimeConfig>,
    pub(crate) deployment_config: ::std::option::Option<crate::types::InferenceComponentDeploymentConfig>,
}
impl UpdateInferenceComponentInputBuilder {
    /// <p>The name of the inference component.</p>
    /// This field is required.
    pub fn inference_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inference_component_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the inference component.</p>
    pub fn set_inference_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inference_component_name = input;
        self
    }
    /// <p>The name of the inference component.</p>
    pub fn get_inference_component_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.inference_component_name
    }
    /// <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
    pub fn specification(mut self, input: crate::types::InferenceComponentSpecification) -> Self {
        self.specification = ::std::option::Option::Some(input);
        self
    }
    /// <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
    pub fn set_specification(mut self, input: ::std::option::Option<crate::types::InferenceComponentSpecification>) -> Self {
        self.specification = input;
        self
    }
    /// <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
    pub fn get_specification(&self) -> &::std::option::Option<crate::types::InferenceComponentSpecification> {
        &self.specification
    }
    /// Appends an item to `specifications`.
    ///
    /// To override the contents of this collection use [`set_specifications`](Self::set_specifications).
    ///
    /// <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</p>
    pub fn specifications(mut self, input: crate::types::InferenceComponentSpecification) -> Self {
        let mut v = self.specifications.unwrap_or_default();
        v.push(input);
        self.specifications = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</p>
    pub fn set_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InferenceComponentSpecification>>) -> Self {
        self.specifications = input;
        self
    }
    /// <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</p>
    pub fn get_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InferenceComponentSpecification>> {
        &self.specifications
    }
    /// <p>Runtime settings for a model that is deployed with an inference component.</p>
    pub fn runtime_config(mut self, input: crate::types::InferenceComponentRuntimeConfig) -> Self {
        self.runtime_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Runtime settings for a model that is deployed with an inference component.</p>
    pub fn set_runtime_config(mut self, input: ::std::option::Option<crate::types::InferenceComponentRuntimeConfig>) -> Self {
        self.runtime_config = input;
        self
    }
    /// <p>Runtime settings for a model that is deployed with an inference component.</p>
    pub fn get_runtime_config(&self) -> &::std::option::Option<crate::types::InferenceComponentRuntimeConfig> {
        &self.runtime_config
    }
    /// <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>
    pub fn deployment_config(mut self, input: crate::types::InferenceComponentDeploymentConfig) -> Self {
        self.deployment_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>
    pub fn set_deployment_config(mut self, input: ::std::option::Option<crate::types::InferenceComponentDeploymentConfig>) -> Self {
        self.deployment_config = input;
        self
    }
    /// <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>
    pub fn get_deployment_config(&self) -> &::std::option::Option<crate::types::InferenceComponentDeploymentConfig> {
        &self.deployment_config
    }
    /// Consumes the builder and constructs a [`UpdateInferenceComponentInput`](crate::operation::update_inference_component::UpdateInferenceComponentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_inference_component::UpdateInferenceComponentInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_inference_component::UpdateInferenceComponentInput {
            inference_component_name: self.inference_component_name,
            specification: self.specification,
            specifications: self.specifications,
            runtime_config: self.runtime_config,
            deployment_config: self.deployment_config,
        })
    }
}