aws_sdk_codeconnections/operation/create_host/
_create_host_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateHostInput {
6    /// <p>The name of the host to be created.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.</p>
9    pub provider_type: ::std::option::Option<crate::types::ProviderType>,
10    /// <p>The endpoint of the infrastructure to be represented by the host after it is created.</p>
11    pub provider_endpoint: ::std::option::Option<::std::string::String>,
12    /// <p>The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.</p>
13    pub vpc_configuration: ::std::option::Option<crate::types::VpcConfiguration>,
14    /// <p>Tags for the host to be created.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateHostInput {
18    /// <p>The name of the host to be created.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.</p>
23    pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
24        self.provider_type.as_ref()
25    }
26    /// <p>The endpoint of the infrastructure to be represented by the host after it is created.</p>
27    pub fn provider_endpoint(&self) -> ::std::option::Option<&str> {
28        self.provider_endpoint.as_deref()
29    }
30    /// <p>The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.</p>
31    pub fn vpc_configuration(&self) -> ::std::option::Option<&crate::types::VpcConfiguration> {
32        self.vpc_configuration.as_ref()
33    }
34    /// <p>Tags for the host to be created.</p>
35    ///
36    /// 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()`.
37    pub fn tags(&self) -> &[crate::types::Tag] {
38        self.tags.as_deref().unwrap_or_default()
39    }
40}
41impl CreateHostInput {
42    /// Creates a new builder-style object to manufacture [`CreateHostInput`](crate::operation::create_host::CreateHostInput).
43    pub fn builder() -> crate::operation::create_host::builders::CreateHostInputBuilder {
44        crate::operation::create_host::builders::CreateHostInputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateHostInput`](crate::operation::create_host::CreateHostInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateHostInputBuilder {
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
54    pub(crate) provider_endpoint: ::std::option::Option<::std::string::String>,
55    pub(crate) vpc_configuration: ::std::option::Option<crate::types::VpcConfiguration>,
56    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateHostInputBuilder {
59    /// <p>The name of the host to be created.</p>
60    /// This field is required.
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the host to be created.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>The name of the host to be created.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// <p>The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.</p>
75    /// This field is required.
76    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
77        self.provider_type = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.</p>
81    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
82        self.provider_type = input;
83        self
84    }
85    /// <p>The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.</p>
86    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
87        &self.provider_type
88    }
89    /// <p>The endpoint of the infrastructure to be represented by the host after it is created.</p>
90    /// This field is required.
91    pub fn provider_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.provider_endpoint = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The endpoint of the infrastructure to be represented by the host after it is created.</p>
96    pub fn set_provider_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.provider_endpoint = input;
98        self
99    }
100    /// <p>The endpoint of the infrastructure to be represented by the host after it is created.</p>
101    pub fn get_provider_endpoint(&self) -> &::std::option::Option<::std::string::String> {
102        &self.provider_endpoint
103    }
104    /// <p>The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.</p>
105    pub fn vpc_configuration(mut self, input: crate::types::VpcConfiguration) -> Self {
106        self.vpc_configuration = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.</p>
110    pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::VpcConfiguration>) -> Self {
111        self.vpc_configuration = input;
112        self
113    }
114    /// <p>The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.</p>
115    pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::VpcConfiguration> {
116        &self.vpc_configuration
117    }
118    /// Appends an item to `tags`.
119    ///
120    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
121    ///
122    /// <p>Tags for the host to be created.</p>
123    pub fn tags(mut self, input: crate::types::Tag) -> Self {
124        let mut v = self.tags.unwrap_or_default();
125        v.push(input);
126        self.tags = ::std::option::Option::Some(v);
127        self
128    }
129    /// <p>Tags for the host to be created.</p>
130    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
131        self.tags = input;
132        self
133    }
134    /// <p>Tags for the host to be created.</p>
135    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
136        &self.tags
137    }
138    /// Consumes the builder and constructs a [`CreateHostInput`](crate::operation::create_host::CreateHostInput).
139    pub fn build(self) -> ::std::result::Result<crate::operation::create_host::CreateHostInput, ::aws_smithy_types::error::operation::BuildError> {
140        ::std::result::Result::Ok(crate::operation::create_host::CreateHostInput {
141            name: self.name,
142            provider_type: self.provider_type,
143            provider_endpoint: self.provider_endpoint,
144            vpc_configuration: self.vpc_configuration,
145            tags: self.tags,
146        })
147    }
148}