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 CreateAppInput {
    /// <p>The domain ID.</p>
    pub domain_id: ::std::option::Option<::std::string::String>,
    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
    pub user_profile_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
    pub space_name: ::std::option::Option<::std::string::String>,
    /// <p>The type of app.</p>
    pub app_type: ::std::option::Option<crate::types::AppType>,
    /// <p>The name of the app.</p>
    pub app_name: ::std::option::Option<::std::string::String>,
    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
    /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
    /// </note>
    pub resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
    /// <p>Indicates whether the application is launched in recovery mode.</p>
    pub recovery_mode: ::std::option::Option<bool>,
}
impl CreateAppInput {
    /// <p>The domain ID.</p>
    pub fn domain_id(&self) -> ::std::option::Option<&str> {
        self.domain_id.as_deref()
    }
    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
    pub fn user_profile_name(&self) -> ::std::option::Option<&str> {
        self.user_profile_name.as_deref()
    }
    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
    pub fn space_name(&self) -> ::std::option::Option<&str> {
        self.space_name.as_deref()
    }
    /// <p>The type of app.</p>
    pub fn app_type(&self) -> ::std::option::Option<&crate::types::AppType> {
        self.app_type.as_ref()
    }
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> ::std::option::Option<&str> {
        self.app_name.as_deref()
    }
    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</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()
    }
    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
    /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
    /// </note>
    pub fn resource_spec(&self) -> ::std::option::Option<&crate::types::ResourceSpec> {
        self.resource_spec.as_ref()
    }
    /// <p>Indicates whether the application is launched in recovery mode.</p>
    pub fn recovery_mode(&self) -> ::std::option::Option<bool> {
        self.recovery_mode
    }
}
impl CreateAppInput {
    /// Creates a new builder-style object to manufacture [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
    pub fn builder() -> crate::operation::create_app::builders::CreateAppInputBuilder {
        crate::operation::create_app::builders::CreateAppInputBuilder::default()
    }
}

/// A builder for [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAppInputBuilder {
    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_profile_name: ::std::option::Option<::std::string::String>,
    pub(crate) space_name: ::std::option::Option<::std::string::String>,
    pub(crate) app_type: ::std::option::Option<crate::types::AppType>,
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
    pub(crate) recovery_mode: ::std::option::Option<bool>,
}
impl CreateAppInputBuilder {
    /// <p>The domain ID.</p>
    /// This field is required.
    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The domain ID.</p>
    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_id = input;
        self
    }
    /// <p>The domain ID.</p>
    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_id
    }
    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
    pub fn user_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_profile_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
    pub fn set_user_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_profile_name = input;
        self
    }
    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
    pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_profile_name
    }
    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
    pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.space_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
    pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.space_name = input;
        self
    }
    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
    pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_name
    }
    /// <p>The type of app.</p>
    /// This field is required.
    pub fn app_type(mut self, input: crate::types::AppType) -> Self {
        self.app_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of app.</p>
    pub fn set_app_type(mut self, input: ::std::option::Option<crate::types::AppType>) -> Self {
        self.app_type = input;
        self
    }
    /// <p>The type of app.</p>
    pub fn get_app_type(&self) -> &::std::option::Option<crate::types::AppType> {
        &self.app_type
    }
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</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>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
    /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
    /// </note>
    pub fn resource_spec(mut self, input: crate::types::ResourceSpec) -> Self {
        self.resource_spec = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
    /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
    /// </note>
    pub fn set_resource_spec(mut self, input: ::std::option::Option<crate::types::ResourceSpec>) -> Self {
        self.resource_spec = input;
        self
    }
    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
    /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
    /// </note>
    pub fn get_resource_spec(&self) -> &::std::option::Option<crate::types::ResourceSpec> {
        &self.resource_spec
    }
    /// <p>Indicates whether the application is launched in recovery mode.</p>
    pub fn recovery_mode(mut self, input: bool) -> Self {
        self.recovery_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the application is launched in recovery mode.</p>
    pub fn set_recovery_mode(mut self, input: ::std::option::Option<bool>) -> Self {
        self.recovery_mode = input;
        self
    }
    /// <p>Indicates whether the application is launched in recovery mode.</p>
    pub fn get_recovery_mode(&self) -> &::std::option::Option<bool> {
        &self.recovery_mode
    }
    /// Consumes the builder and constructs a [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_app::CreateAppInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_app::CreateAppInput {
            domain_id: self.domain_id,
            user_profile_name: self.user_profile_name,
            space_name: self.space_name,
            app_type: self.app_type,
            app_name: self.app_name,
            tags: self.tags,
            resource_spec: self.resource_spec,
            recovery_mode: self.recovery_mode,
        })
    }
}