aws-sdk-codestar 1.39.0

AWS SDK for AWS CodeStar
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The toolchain template file provided with the project request. AWS CodeStar uses the template to provision the toolchain stack in AWS CloudFormation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Toolchain {
    /// <p>The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.</p>
    pub source: ::std::option::Option<crate::types::ToolchainSource>,
    /// <p>The service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.</p>
    pub stack_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Toolchain {
    /// <p>The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.</p>
    pub fn source(&self) -> ::std::option::Option<&crate::types::ToolchainSource> {
        self.source.as_ref()
    }
    /// <p>The service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.</p>
    pub fn stack_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.stack_parameters.as_ref()
    }
}
impl Toolchain {
    /// Creates a new builder-style object to manufacture [`Toolchain`](crate::types::Toolchain).
    pub fn builder() -> crate::types::builders::ToolchainBuilder {
        crate::types::builders::ToolchainBuilder::default()
    }
}

/// A builder for [`Toolchain`](crate::types::Toolchain).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ToolchainBuilder {
    pub(crate) source: ::std::option::Option<crate::types::ToolchainSource>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) stack_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl ToolchainBuilder {
    /// <p>The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.</p>
    /// This field is required.
    pub fn source(mut self, input: crate::types::ToolchainSource) -> Self {
        self.source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ToolchainSource>) -> Self {
        self.source = input;
        self
    }
    /// <p>The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::ToolchainSource> {
        &self.source
    }
    /// <p>The service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.</p>
    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 service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// Adds a key-value pair to `stack_parameters`.
    ///
    /// To override the contents of this collection use [`set_stack_parameters`](Self::set_stack_parameters).
    ///
    /// <p>The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.</p>
    pub fn stack_parameters(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.stack_parameters.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.stack_parameters = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.</p>
    pub fn set_stack_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.stack_parameters = input;
        self
    }
    /// <p>The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.</p>
    pub fn get_stack_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.stack_parameters
    }
    /// Consumes the builder and constructs a [`Toolchain`](crate::types::Toolchain).
    pub fn build(self) -> crate::types::Toolchain {
        crate::types::Toolchain {
            source: self.source,
            role_arn: self.role_arn,
            stack_parameters: self.stack_parameters,
        }
    }
}