Skip to main content

aws_sdk_continuum/operation/create_environment/
_create_environment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Specifies the name and type-specific configuration of the new environment. Source and operating-policy settings belong to configuration.codeConfiguration.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateEnvironmentInput {
7    /// The customer-visible name of the environment.
8    pub name: ::std::option::Option<::std::string::String>,
9    /// Type-specific configuration. Omission creates a code environment with the default operating policy and no sources.
10    pub configuration: ::std::option::Option<crate::types::CreateEnvironmentConfiguration>,
11}
12impl CreateEnvironmentInput {
13    /// The customer-visible name of the environment.
14    pub fn name(&self) -> ::std::option::Option<&str> {
15        self.name.as_deref()
16    }
17    /// Type-specific configuration. Omission creates a code environment with the default operating policy and no sources.
18    pub fn configuration(&self) -> ::std::option::Option<&crate::types::CreateEnvironmentConfiguration> {
19        self.configuration.as_ref()
20    }
21}
22impl CreateEnvironmentInput {
23    /// Creates a new builder-style object to manufacture [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
24    pub fn builder() -> crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
25        crate::operation::create_environment::builders::CreateEnvironmentInputBuilder::default()
26    }
27}
28
29/// A builder for [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CreateEnvironmentInputBuilder {
33    pub(crate) name: ::std::option::Option<::std::string::String>,
34    pub(crate) configuration: ::std::option::Option<crate::types::CreateEnvironmentConfiguration>,
35}
36impl CreateEnvironmentInputBuilder {
37    /// The customer-visible name of the environment.
38    /// This field is required.
39    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.name = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// The customer-visible name of the environment.
44    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.name = input;
46        self
47    }
48    /// The customer-visible name of the environment.
49    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
50        &self.name
51    }
52    /// Type-specific configuration. Omission creates a code environment with the default operating policy and no sources.
53    pub fn configuration(mut self, input: crate::types::CreateEnvironmentConfiguration) -> Self {
54        self.configuration = ::std::option::Option::Some(input);
55        self
56    }
57    /// Type-specific configuration. Omission creates a code environment with the default operating policy and no sources.
58    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CreateEnvironmentConfiguration>) -> Self {
59        self.configuration = input;
60        self
61    }
62    /// Type-specific configuration. Omission creates a code environment with the default operating policy and no sources.
63    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CreateEnvironmentConfiguration> {
64        &self.configuration
65    }
66    /// Consumes the builder and constructs a [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<crate::operation::create_environment::CreateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
70        ::std::result::Result::Ok(crate::operation::create_environment::CreateEnvironmentInput {
71            name: self.name,
72            configuration: self.configuration,
73        })
74    }
75}