aws_sdk_xray/types/
_response_time_root_cause_service.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A collection of fields identifying the service in a response time warning.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ResponseTimeRootCauseService {
7    /// <p>The service name.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A collection of associated service names.</p>
10    pub names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>The type associated to the service.</p>
12    pub r#type: ::std::option::Option<::std::string::String>,
13    /// <p>The account ID associated to the service.</p>
14    pub account_id: ::std::option::Option<::std::string::String>,
15    /// <p>The path of root cause entities found on the service.</p>
16    pub entity_path: ::std::option::Option<::std::vec::Vec<crate::types::ResponseTimeRootCauseEntity>>,
17    /// <p>A Boolean value indicating if the service is inferred from the trace.</p>
18    pub inferred: ::std::option::Option<bool>,
19}
20impl ResponseTimeRootCauseService {
21    /// <p>The service name.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>A collection of associated service names.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.names.is_none()`.
28    pub fn names(&self) -> &[::std::string::String] {
29        self.names.as_deref().unwrap_or_default()
30    }
31    /// <p>The type associated to the service.</p>
32    pub fn r#type(&self) -> ::std::option::Option<&str> {
33        self.r#type.as_deref()
34    }
35    /// <p>The account ID associated to the service.</p>
36    pub fn account_id(&self) -> ::std::option::Option<&str> {
37        self.account_id.as_deref()
38    }
39    /// <p>The path of root cause entities found on the service.</p>
40    ///
41    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entity_path.is_none()`.
42    pub fn entity_path(&self) -> &[crate::types::ResponseTimeRootCauseEntity] {
43        self.entity_path.as_deref().unwrap_or_default()
44    }
45    /// <p>A Boolean value indicating if the service is inferred from the trace.</p>
46    pub fn inferred(&self) -> ::std::option::Option<bool> {
47        self.inferred
48    }
49}
50impl ResponseTimeRootCauseService {
51    /// Creates a new builder-style object to manufacture [`ResponseTimeRootCauseService`](crate::types::ResponseTimeRootCauseService).
52    pub fn builder() -> crate::types::builders::ResponseTimeRootCauseServiceBuilder {
53        crate::types::builders::ResponseTimeRootCauseServiceBuilder::default()
54    }
55}
56
57/// A builder for [`ResponseTimeRootCauseService`](crate::types::ResponseTimeRootCauseService).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct ResponseTimeRootCauseServiceBuilder {
61    pub(crate) name: ::std::option::Option<::std::string::String>,
62    pub(crate) names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63    pub(crate) r#type: ::std::option::Option<::std::string::String>,
64    pub(crate) account_id: ::std::option::Option<::std::string::String>,
65    pub(crate) entity_path: ::std::option::Option<::std::vec::Vec<crate::types::ResponseTimeRootCauseEntity>>,
66    pub(crate) inferred: ::std::option::Option<bool>,
67}
68impl ResponseTimeRootCauseServiceBuilder {
69    /// <p>The service name.</p>
70    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The service name.</p>
75    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.name = input;
77        self
78    }
79    /// <p>The service name.</p>
80    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.name
82    }
83    /// Appends an item to `names`.
84    ///
85    /// To override the contents of this collection use [`set_names`](Self::set_names).
86    ///
87    /// <p>A collection of associated service names.</p>
88    pub fn names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        let mut v = self.names.unwrap_or_default();
90        v.push(input.into());
91        self.names = ::std::option::Option::Some(v);
92        self
93    }
94    /// <p>A collection of associated service names.</p>
95    pub fn set_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
96        self.names = input;
97        self
98    }
99    /// <p>A collection of associated service names.</p>
100    pub fn get_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
101        &self.names
102    }
103    /// <p>The type associated to the service.</p>
104    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.r#type = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The type associated to the service.</p>
109    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.r#type = input;
111        self
112    }
113    /// <p>The type associated to the service.</p>
114    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
115        &self.r#type
116    }
117    /// <p>The account ID associated to the service.</p>
118    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.account_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The account ID associated to the service.</p>
123    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.account_id = input;
125        self
126    }
127    /// <p>The account ID associated to the service.</p>
128    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.account_id
130    }
131    /// Appends an item to `entity_path`.
132    ///
133    /// To override the contents of this collection use [`set_entity_path`](Self::set_entity_path).
134    ///
135    /// <p>The path of root cause entities found on the service.</p>
136    pub fn entity_path(mut self, input: crate::types::ResponseTimeRootCauseEntity) -> Self {
137        let mut v = self.entity_path.unwrap_or_default();
138        v.push(input);
139        self.entity_path = ::std::option::Option::Some(v);
140        self
141    }
142    /// <p>The path of root cause entities found on the service.</p>
143    pub fn set_entity_path(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResponseTimeRootCauseEntity>>) -> Self {
144        self.entity_path = input;
145        self
146    }
147    /// <p>The path of root cause entities found on the service.</p>
148    pub fn get_entity_path(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResponseTimeRootCauseEntity>> {
149        &self.entity_path
150    }
151    /// <p>A Boolean value indicating if the service is inferred from the trace.</p>
152    pub fn inferred(mut self, input: bool) -> Self {
153        self.inferred = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>A Boolean value indicating if the service is inferred from the trace.</p>
157    pub fn set_inferred(mut self, input: ::std::option::Option<bool>) -> Self {
158        self.inferred = input;
159        self
160    }
161    /// <p>A Boolean value indicating if the service is inferred from the trace.</p>
162    pub fn get_inferred(&self) -> &::std::option::Option<bool> {
163        &self.inferred
164    }
165    /// Consumes the builder and constructs a [`ResponseTimeRootCauseService`](crate::types::ResponseTimeRootCauseService).
166    pub fn build(self) -> crate::types::ResponseTimeRootCauseService {
167        crate::types::ResponseTimeRootCauseService {
168            name: self.name,
169            names: self.names,
170            r#type: self.r#type,
171            account_id: self.account_id,
172            entity_path: self.entity_path,
173            inferred: self.inferred,
174        }
175    }
176}