aws-sdk-devopsagent 1.4.0

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

/// Input for registering a new service with the platform.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RegisterServiceInput {
    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
    pub service: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>,
    /// Service-specific authorization configuration parameters
    pub service_details: ::std::option::Option<crate::types::ServiceDetails>,
    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
    /// The name of the private connection to use for VPC connectivity.
    pub private_connection_name: ::std::option::Option<::std::string::String>,
    /// The display name for the service registration.
    pub name: ::std::option::Option<::std::string::String>,
    /// Tags to add to the Service at registration time.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl RegisterServiceInput {
    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
    pub fn service(&self) -> ::std::option::Option<&crate::types::PostRegisterServiceSupportedService> {
        self.service.as_ref()
    }
    /// Service-specific authorization configuration parameters
    pub fn service_details(&self) -> ::std::option::Option<&crate::types::ServiceDetails> {
        self.service_details.as_ref()
    }
    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
    /// The name of the private connection to use for VPC connectivity.
    pub fn private_connection_name(&self) -> ::std::option::Option<&str> {
        self.private_connection_name.as_deref()
    }
    /// The display name for the service registration.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// Tags to add to the Service at registration time.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl RegisterServiceInput {
    /// Creates a new builder-style object to manufacture [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
    pub fn builder() -> crate::operation::register_service::builders::RegisterServiceInputBuilder {
        crate::operation::register_service::builders::RegisterServiceInputBuilder::default()
    }
}

/// A builder for [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegisterServiceInputBuilder {
    pub(crate) service: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>,
    pub(crate) service_details: ::std::option::Option<crate::types::ServiceDetails>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) private_connection_name: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl RegisterServiceInputBuilder {
    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
    /// This field is required.
    pub fn service(mut self, input: crate::types::PostRegisterServiceSupportedService) -> Self {
        self.service = ::std::option::Option::Some(input);
        self
    }
    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
    pub fn set_service(mut self, input: ::std::option::Option<crate::types::PostRegisterServiceSupportedService>) -> Self {
        self.service = input;
        self
    }
    /// Services that can be registered via the post-registration API (excludes OAuth 3LO services).
    pub fn get_service(&self) -> &::std::option::Option<crate::types::PostRegisterServiceSupportedService> {
        &self.service
    }
    /// Service-specific authorization configuration parameters
    /// This field is required.
    pub fn service_details(mut self, input: crate::types::ServiceDetails) -> Self {
        self.service_details = ::std::option::Option::Some(input);
        self
    }
    /// Service-specific authorization configuration parameters
    pub fn set_service_details(mut self, input: ::std::option::Option<crate::types::ServiceDetails>) -> Self {
        self.service_details = input;
        self
    }
    /// Service-specific authorization configuration parameters
    pub fn get_service_details(&self) -> &::std::option::Option<crate::types::ServiceDetails> {
        &self.service_details
    }
    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// The name of the private connection to use for VPC connectivity.
    pub fn private_connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.private_connection_name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the private connection to use for VPC connectivity.
    pub fn set_private_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.private_connection_name = input;
        self
    }
    /// The name of the private connection to use for VPC connectivity.
    pub fn get_private_connection_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.private_connection_name
    }
    /// The display name for the service registration.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The display name for the service registration.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The display name for the service registration.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// Tags to add to the Service at registration time.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// Tags to add to the Service at registration time.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// Tags to add to the Service at registration time.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`RegisterServiceInput`](crate::operation::register_service::RegisterServiceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::register_service::RegisterServiceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::register_service::RegisterServiceInput {
            service: self.service,
            service_details: self.service_details,
            kms_key_arn: self.kms_key_arn,
            private_connection_name: self.private_connection_name,
            name: self.name,
            tags: self.tags,
        })
    }
}