aws-sdk-proton 1.101.0

AWS SDK for AWS Proton
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 CreateServiceInstanceInput {
    /// <p>The name of the service instance to create.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the service the service instance is added to.</p>
    pub service_name: ::std::option::Option<::std::string::String>,
    /// <p>The spec for the service instance you want to create.</p>
    pub spec: ::std::option::Option<::std::string::String>,
    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
    pub template_major_version: ::std::option::Option<::std::string::String>,
    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
    pub template_minor_version: ::std::option::Option<::std::string::String>,
    /// <p>An optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The client token of the service instance to create.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateServiceInstanceInput {
    /// <p>The name of the service instance to create.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The name of the service the service instance is added to.</p>
    pub fn service_name(&self) -> ::std::option::Option<&str> {
        self.service_name.as_deref()
    }
    /// <p>The spec for the service instance you want to create.</p>
    pub fn spec(&self) -> ::std::option::Option<&str> {
        self.spec.as_deref()
    }
    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
    pub fn template_major_version(&self) -> ::std::option::Option<&str> {
        self.template_major_version.as_deref()
    }
    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
    pub fn template_minor_version(&self) -> ::std::option::Option<&str> {
        self.template_minor_version.as_deref()
    }
    /// <p>An optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</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 client token of the service instance to create.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl ::std::fmt::Debug for CreateServiceInstanceInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateServiceInstanceInput");
        formatter.field("name", &self.name);
        formatter.field("service_name", &self.service_name);
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("template_major_version", &self.template_major_version);
        formatter.field("template_minor_version", &self.template_minor_version);
        formatter.field("tags", &self.tags);
        formatter.field("client_token", &self.client_token);
        formatter.finish()
    }
}
impl CreateServiceInstanceInput {
    /// Creates a new builder-style object to manufacture [`CreateServiceInstanceInput`](crate::operation::create_service_instance::CreateServiceInstanceInput).
    pub fn builder() -> crate::operation::create_service_instance::builders::CreateServiceInstanceInputBuilder {
        crate::operation::create_service_instance::builders::CreateServiceInstanceInputBuilder::default()
    }
}

/// A builder for [`CreateServiceInstanceInput`](crate::operation::create_service_instance::CreateServiceInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateServiceInstanceInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) service_name: ::std::option::Option<::std::string::String>,
    pub(crate) spec: ::std::option::Option<::std::string::String>,
    pub(crate) template_major_version: ::std::option::Option<::std::string::String>,
    pub(crate) template_minor_version: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateServiceInstanceInputBuilder {
    /// <p>The name of the service instance to create.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service instance to create.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the service instance to create.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The name of the service the service instance is added to.</p>
    /// This field is required.
    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service the service instance is added to.</p>
    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_name = input;
        self
    }
    /// <p>The name of the service the service instance is added to.</p>
    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_name
    }
    /// <p>The spec for the service instance you want to create.</p>
    /// This field is required.
    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.spec = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The spec for the service instance you want to create.</p>
    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.spec = input;
        self
    }
    /// <p>The spec for the service instance you want to create.</p>
    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
        &self.spec
    }
    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_major_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_major_version = input;
        self
    }
    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_major_version
    }
    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_minor_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_minor_version = input;
        self
    }
    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_minor_version
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</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 optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An optional list of metadata items that you can associate with the Proton service instance. A tag is a key-value pair.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The client token of the service instance to create.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The client token of the service instance to create.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The client token of the service instance to create.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateServiceInstanceInput`](crate::operation::create_service_instance::CreateServiceInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_service_instance::CreateServiceInstanceInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_service_instance::CreateServiceInstanceInput {
            name: self.name,
            service_name: self.service_name,
            spec: self.spec,
            template_major_version: self.template_major_version,
            template_minor_version: self.template_minor_version,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}
impl ::std::fmt::Debug for CreateServiceInstanceInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateServiceInstanceInputBuilder");
        formatter.field("name", &self.name);
        formatter.field("service_name", &self.service_name);
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("template_major_version", &self.template_major_version);
        formatter.field("template_minor_version", &self.template_minor_version);
        formatter.field("tags", &self.tags);
        formatter.field("client_token", &self.client_token);
        formatter.finish()
    }
}