Skip to main content

aws_sdk_servicediscovery/types/
_http_instance_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>In a response to a <a href="https://docs.aws.amazon.com/cloud-map/latest/api/API_DiscoverInstances.html">DiscoverInstances</a> request, <code>HttpInstanceSummary</code> contains information about one instance that matches the values that you specified in the request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HttpInstanceSummary {
7    /// <p>The ID of an instance that matches the values that you specified in the request.</p>
8    pub instance_id: ::std::option::Option<::std::string::String>,
9    /// <p>The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
10    pub namespace_name: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the service that you specified when you registered the instance.</p>
12    pub service_name: ::std::option::Option<::std::string::String>,
13    /// <p>If you configured health checking in the service, the current health status of the service instance.</p>
14    pub health_status: ::std::option::Option<crate::types::HealthStatus>,
15    /// <p>If you included any attributes when you registered the instance, the values of those attributes.</p>
16    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17}
18impl HttpInstanceSummary {
19    /// <p>The ID of an instance that matches the values that you specified in the request.</p>
20    pub fn instance_id(&self) -> ::std::option::Option<&str> {
21        self.instance_id.as_deref()
22    }
23    /// <p>The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
24    pub fn namespace_name(&self) -> ::std::option::Option<&str> {
25        self.namespace_name.as_deref()
26    }
27    /// <p>The name of the service that you specified when you registered the instance.</p>
28    pub fn service_name(&self) -> ::std::option::Option<&str> {
29        self.service_name.as_deref()
30    }
31    /// <p>If you configured health checking in the service, the current health status of the service instance.</p>
32    pub fn health_status(&self) -> ::std::option::Option<&crate::types::HealthStatus> {
33        self.health_status.as_ref()
34    }
35    /// <p>If you included any attributes when you registered the instance, the values of those attributes.</p>
36    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
37        self.attributes.as_ref()
38    }
39}
40impl HttpInstanceSummary {
41    /// Creates a new builder-style object to manufacture [`HttpInstanceSummary`](crate::types::HttpInstanceSummary).
42    pub fn builder() -> crate::types::builders::HttpInstanceSummaryBuilder {
43        crate::types::builders::HttpInstanceSummaryBuilder::default()
44    }
45}
46
47/// A builder for [`HttpInstanceSummary`](crate::types::HttpInstanceSummary).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct HttpInstanceSummaryBuilder {
51    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
52    pub(crate) namespace_name: ::std::option::Option<::std::string::String>,
53    pub(crate) service_name: ::std::option::Option<::std::string::String>,
54    pub(crate) health_status: ::std::option::Option<crate::types::HealthStatus>,
55    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56}
57impl HttpInstanceSummaryBuilder {
58    /// <p>The ID of an instance that matches the values that you specified in the request.</p>
59    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.instance_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The ID of an instance that matches the values that you specified in the request.</p>
64    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.instance_id = input;
66        self
67    }
68    /// <p>The ID of an instance that matches the values that you specified in the request.</p>
69    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.instance_id
71    }
72    /// <p>The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
73    pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.namespace_name = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
78    pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.namespace_name = input;
80        self
81    }
82    /// <p>The <code>HttpName</code> name of the namespace. It's found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
83    pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
84        &self.namespace_name
85    }
86    /// <p>The name of the service that you specified when you registered the instance.</p>
87    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.service_name = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The name of the service that you specified when you registered the instance.</p>
92    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.service_name = input;
94        self
95    }
96    /// <p>The name of the service that you specified when you registered the instance.</p>
97    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
98        &self.service_name
99    }
100    /// <p>If you configured health checking in the service, the current health status of the service instance.</p>
101    pub fn health_status(mut self, input: crate::types::HealthStatus) -> Self {
102        self.health_status = ::std::option::Option::Some(input);
103        self
104    }
105    /// <p>If you configured health checking in the service, the current health status of the service instance.</p>
106    pub fn set_health_status(mut self, input: ::std::option::Option<crate::types::HealthStatus>) -> Self {
107        self.health_status = input;
108        self
109    }
110    /// <p>If you configured health checking in the service, the current health status of the service instance.</p>
111    pub fn get_health_status(&self) -> &::std::option::Option<crate::types::HealthStatus> {
112        &self.health_status
113    }
114    /// Adds a key-value pair to `attributes`.
115    ///
116    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
117    ///
118    /// <p>If you included any attributes when you registered the instance, the values of those attributes.</p>
119    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
120        let mut hash_map = self.attributes.unwrap_or_default();
121        hash_map.insert(k.into(), v.into());
122        self.attributes = ::std::option::Option::Some(hash_map);
123        self
124    }
125    /// <p>If you included any attributes when you registered the instance, the values of those attributes.</p>
126    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
127        self.attributes = input;
128        self
129    }
130    /// <p>If you included any attributes when you registered the instance, the values of those attributes.</p>
131    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
132        &self.attributes
133    }
134    /// Consumes the builder and constructs a [`HttpInstanceSummary`](crate::types::HttpInstanceSummary).
135    pub fn build(self) -> crate::types::HttpInstanceSummary {
136        crate::types::HttpInstanceSummary {
137            instance_id: self.instance_id,
138            namespace_name: self.namespace_name,
139            service_name: self.service_name,
140            health_status: self.health_status,
141            attributes: self.attributes,
142        }
143    }
144}