Skip to main content

aws_sdk_securityhub/types/
_aws_ecs_service_service_registries_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about a service discovery registry to assign to the service.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsEcsServiceServiceRegistriesDetails {
7    /// <p>The container name value to use for the service discovery service.</p>
8    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
9    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
10    pub container_name: ::std::option::Option<::std::string::String>,
11    /// <p>The port value to use for the service discovery service.</p>
12    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
13    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
14    pub container_port: ::std::option::Option<i32>,
15    /// <p>The port value to use for a service discovery service that specifies an SRV record. This field can be used if both the <code>awsvpc</code>awsvpc network mode and SRV records are used.</p>
16    pub port: ::std::option::Option<i32>,
17    /// <p>The ARN of the service registry.</p>
18    pub registry_arn: ::std::option::Option<::std::string::String>,
19}
20impl AwsEcsServiceServiceRegistriesDetails {
21    /// <p>The container name value to use for the service discovery service.</p>
22    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
23    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
24    pub fn container_name(&self) -> ::std::option::Option<&str> {
25        self.container_name.as_deref()
26    }
27    /// <p>The port value to use for the service discovery service.</p>
28    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
29    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
30    pub fn container_port(&self) -> ::std::option::Option<i32> {
31        self.container_port
32    }
33    /// <p>The port value to use for a service discovery service that specifies an SRV record. This field can be used if both the <code>awsvpc</code>awsvpc network mode and SRV records are used.</p>
34    pub fn port(&self) -> ::std::option::Option<i32> {
35        self.port
36    }
37    /// <p>The ARN of the service registry.</p>
38    pub fn registry_arn(&self) -> ::std::option::Option<&str> {
39        self.registry_arn.as_deref()
40    }
41}
42impl AwsEcsServiceServiceRegistriesDetails {
43    /// Creates a new builder-style object to manufacture [`AwsEcsServiceServiceRegistriesDetails`](crate::types::AwsEcsServiceServiceRegistriesDetails).
44    pub fn builder() -> crate::types::builders::AwsEcsServiceServiceRegistriesDetailsBuilder {
45        crate::types::builders::AwsEcsServiceServiceRegistriesDetailsBuilder::default()
46    }
47}
48
49/// A builder for [`AwsEcsServiceServiceRegistriesDetails`](crate::types::AwsEcsServiceServiceRegistriesDetails).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct AwsEcsServiceServiceRegistriesDetailsBuilder {
53    pub(crate) container_name: ::std::option::Option<::std::string::String>,
54    pub(crate) container_port: ::std::option::Option<i32>,
55    pub(crate) port: ::std::option::Option<i32>,
56    pub(crate) registry_arn: ::std::option::Option<::std::string::String>,
57}
58impl AwsEcsServiceServiceRegistriesDetailsBuilder {
59    /// <p>The container name value to use for the service discovery service.</p>
60    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
61    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
62    pub fn container_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.container_name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The container name value to use for the service discovery service.</p>
67    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
68    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
69    pub fn set_container_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.container_name = input;
71        self
72    }
73    /// <p>The container name value to use for the service discovery service.</p>
74    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
75    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
76    pub fn get_container_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.container_name
78    }
79    /// <p>The port value to use for the service discovery service.</p>
80    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
81    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
82    pub fn container_port(mut self, input: i32) -> Self {
83        self.container_port = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The port value to use for the service discovery service.</p>
87    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
88    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
89    pub fn set_container_port(mut self, input: ::std::option::Option<i32>) -> Self {
90        self.container_port = input;
91        self
92    }
93    /// <p>The port value to use for the service discovery service.</p>
94    /// <p>If the task definition uses the <code>bridge</code> or <code>host</code> network mode, you must specify <code>ContainerName</code> and <code>ContainerPort</code>.</p>
95    /// <p>If the task definition uses the <code>awsvpc</code> network mode and a type SRV DNS record, you must specify either <code>ContainerName</code> and <code>ContainerPort</code>, or <code>Port</code> , but not both.</p>
96    pub fn get_container_port(&self) -> &::std::option::Option<i32> {
97        &self.container_port
98    }
99    /// <p>The port value to use for a service discovery service that specifies an SRV record. This field can be used if both the <code>awsvpc</code>awsvpc network mode and SRV records are used.</p>
100    pub fn port(mut self, input: i32) -> Self {
101        self.port = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>The port value to use for a service discovery service that specifies an SRV record. This field can be used if both the <code>awsvpc</code>awsvpc network mode and SRV records are used.</p>
105    pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
106        self.port = input;
107        self
108    }
109    /// <p>The port value to use for a service discovery service that specifies an SRV record. This field can be used if both the <code>awsvpc</code>awsvpc network mode and SRV records are used.</p>
110    pub fn get_port(&self) -> &::std::option::Option<i32> {
111        &self.port
112    }
113    /// <p>The ARN of the service registry.</p>
114    pub fn registry_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.registry_arn = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The ARN of the service registry.</p>
119    pub fn set_registry_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.registry_arn = input;
121        self
122    }
123    /// <p>The ARN of the service registry.</p>
124    pub fn get_registry_arn(&self) -> &::std::option::Option<::std::string::String> {
125        &self.registry_arn
126    }
127    /// Consumes the builder and constructs a [`AwsEcsServiceServiceRegistriesDetails`](crate::types::AwsEcsServiceServiceRegistriesDetails).
128    pub fn build(self) -> crate::types::AwsEcsServiceServiceRegistriesDetails {
129        crate::types::AwsEcsServiceServiceRegistriesDetails {
130            container_name: self.container_name,
131            container_port: self.container_port,
132            port: self.port,
133            registry_arn: self.registry_arn,
134        }
135    }
136}