Skip to main content

aws_sdk_devopsagent/operation/register_service/
_register_service_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Input for registering a new service with the platform.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RegisterServiceInput {
7    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
8    pub service: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>,
9    /// Service-specific authorization configuration parameters
10    pub service_details: ::std::option::Option<crate::types::ServiceDetails>,
11    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
12    pub kms_key_arn: ::std::option::Option<::std::string::String>,
13    /// The name of the private connection to use for VPC connectivity.
14    pub private_connection_name: ::std::option::Option<::std::string::String>,
15    /// The display name for the service registration.
16    pub name: ::std::option::Option<::std::string::String>,
17    /// Tags to add to the Service at registration time.
18    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
19}
20impl RegisterServiceInput {
21    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
22    pub fn service(&self) -> ::std::option::Option<&crate::types::PostRegisterServiceSupportedService> {
23        self.service.as_ref()
24    }
25    /// Service-specific authorization configuration parameters
26    pub fn service_details(&self) -> ::std::option::Option<&crate::types::ServiceDetails> {
27        self.service_details.as_ref()
28    }
29    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
30    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
31        self.kms_key_arn.as_deref()
32    }
33    /// The name of the private connection to use for VPC connectivity.
34    pub fn private_connection_name(&self) -> ::std::option::Option<&str> {
35        self.private_connection_name.as_deref()
36    }
37    /// The display name for the service registration.
38    pub fn name(&self) -> ::std::option::Option<&str> {
39        self.name.as_deref()
40    }
41    /// Tags to add to the Service at registration time.
42    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
43        self.tags.as_ref()
44    }
45}
46impl RegisterServiceInput {
47    /// Creates a new builder-style object to manufacture [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
48    pub fn builder() -> crate::operation::register_service::builders::RegisterServiceInputBuilder {
49        crate::operation::register_service::builders::RegisterServiceInputBuilder::default()
50    }
51}
52
53/// A builder for [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct RegisterServiceInputBuilder {
57    pub(crate) service: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>,
58    pub(crate) service_details: ::std::option::Option<crate::types::ServiceDetails>,
59    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
60    pub(crate) private_connection_name: ::std::option::Option<::std::string::String>,
61    pub(crate) name: ::std::option::Option<::std::string::String>,
62    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
63}
64impl RegisterServiceInputBuilder {
65    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
66    /// This field is required.
67    pub fn service(mut self, input: crate::types::PostRegisterServiceSupportedService) -> Self {
68        self.service = ::std::option::Option::Some(input);
69        self
70    }
71    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
72    pub fn set_service(mut self, input: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>) -> Self {
73        self.service = input;
74        self
75    }
76    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
77    pub fn get_service(&self) -> &::std::option::Option<crate::types::PostRegisterServiceSupportedService> {
78        &self.service
79    }
80    /// Service-specific authorization configuration parameters
81    /// This field is required.
82    pub fn service_details(mut self, input: crate::types::ServiceDetails) -> Self {
83        self.service_details = ::std::option::Option::Some(input);
84        self
85    }
86    /// Service-specific authorization configuration parameters
87    pub fn set_service_details(mut self, input: ::std::option::Option<crate::types::ServiceDetails>) -> Self {
88        self.service_details = input;
89        self
90    }
91    /// Service-specific authorization configuration parameters
92    pub fn get_service_details(&self) -> &::std::option::Option<crate::types::ServiceDetails> {
93        &self.service_details
94    }
95    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
96    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.kms_key_arn = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
101    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.kms_key_arn = input;
103        self
104    }
105    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
106    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
107        &self.kms_key_arn
108    }
109    /// The name of the private connection to use for VPC connectivity.
110    pub fn private_connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.private_connection_name = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// The name of the private connection to use for VPC connectivity.
115    pub fn set_private_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.private_connection_name = input;
117        self
118    }
119    /// The name of the private connection to use for VPC connectivity.
120    pub fn get_private_connection_name(&self) -> &::std::option::Option<::std::string::String> {
121        &self.private_connection_name
122    }
123    /// The display name for the service registration.
124    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// The display name for the service registration.
129    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.name = input;
131        self
132    }
133    /// The display name for the service registration.
134    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.name
136    }
137    /// Adds a key-value pair to `tags`.
138    ///
139    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
140    ///
141    /// Tags to add to the Service at registration time.
142    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
143        let mut hash_map = self.tags.unwrap_or_default();
144        hash_map.insert(k.into(), v.into());
145        self.tags = ::std::option::Option::Some(hash_map);
146        self
147    }
148    /// Tags to add to the Service at registration time.
149    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
150        self.tags = input;
151        self
152    }
153    /// Tags to add to the Service at registration time.
154    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
155        &self.tags
156    }
157    /// Consumes the builder and constructs a [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
158    pub fn build(
159        self,
160    ) -> ::std::result::Result<crate::operation::register_service::RegisterServiceInput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(crate::operation::register_service::RegisterServiceInput {
162            service: self.service,
163            service_details: self.service_details,
164            kms_key_arn: self.kms_key_arn,
165            private_connection_name: self.private_connection_name,
166            name: self.name,
167            tags: self.tags,
168        })
169    }
170}