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