aws_sdk_applicationsignals/operation/get_service/
_get_service_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetServiceOutput {
6    /// <p>A structure containing information about the service.</p>
7    pub service: ::std::option::Option<crate::types::Service>,
8    /// <p>The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
9    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
10    pub start_time: ::aws_smithy_types::DateTime,
11    /// <p>The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
12    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
13    pub end_time: ::aws_smithy_types::DateTime,
14    /// <p>An array of string-to-string maps that each contain information about one log group associated with this service. Each string-to-string map includes the following fields:</p>
15    /// <ul>
16    /// <li>
17    /// <p><code>"Type": "AWS::Resource"</code></p></li>
18    /// <li>
19    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
20    /// <li>
21    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
22    /// </ul>
23    pub log_group_references: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
24    _request_id: Option<String>,
25}
26impl GetServiceOutput {
27    /// <p>A structure containing information about the service.</p>
28    pub fn service(&self) -> ::std::option::Option<&crate::types::Service> {
29        self.service.as_ref()
30    }
31    /// <p>The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
32    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
33    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
34        &self.start_time
35    }
36    /// <p>The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
37    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
38    pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
39        &self.end_time
40    }
41    /// <p>An array of string-to-string maps that each contain information about one log group associated with this service. Each string-to-string map includes the following fields:</p>
42    /// <ul>
43    /// <li>
44    /// <p><code>"Type": "AWS::Resource"</code></p></li>
45    /// <li>
46    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
47    /// <li>
48    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
49    /// </ul>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_group_references.is_none()`.
52    pub fn log_group_references(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
53        self.log_group_references.as_deref().unwrap_or_default()
54    }
55}
56impl ::aws_types::request_id::RequestId for GetServiceOutput {
57    fn request_id(&self) -> Option<&str> {
58        self._request_id.as_deref()
59    }
60}
61impl GetServiceOutput {
62    /// Creates a new builder-style object to manufacture [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
63    pub fn builder() -> crate::operation::get_service::builders::GetServiceOutputBuilder {
64        crate::operation::get_service::builders::GetServiceOutputBuilder::default()
65    }
66}
67
68/// A builder for [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct GetServiceOutputBuilder {
72    pub(crate) service: ::std::option::Option<crate::types::Service>,
73    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
74    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
75    pub(crate) log_group_references:
76        ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
77    _request_id: Option<String>,
78}
79impl GetServiceOutputBuilder {
80    /// <p>A structure containing information about the service.</p>
81    /// This field is required.
82    pub fn service(mut self, input: crate::types::Service) -> Self {
83        self.service = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>A structure containing information about the service.</p>
87    pub fn set_service(mut self, input: ::std::option::Option<crate::types::Service>) -> Self {
88        self.service = input;
89        self
90    }
91    /// <p>A structure containing information about the service.</p>
92    pub fn get_service(&self) -> &::std::option::Option<crate::types::Service> {
93        &self.service
94    }
95    /// <p>The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
96    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
97    /// This field is required.
98    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
99        self.start_time = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
103    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
104    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
105        self.start_time = input;
106        self
107    }
108    /// <p>The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
109    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
110    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
111        &self.start_time
112    }
113    /// <p>The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
114    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
115    /// This field is required.
116    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
117        self.end_time = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
121    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
122    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
123        self.end_time = input;
124        self
125    }
126    /// <p>The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code>.</p>
127    /// <p>This displays the time that Application Signals used for the request. It might not match your request exactly, because it was rounded to the nearest hour.</p>
128    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
129        &self.end_time
130    }
131    /// Appends an item to `log_group_references`.
132    ///
133    /// To override the contents of this collection use [`set_log_group_references`](Self::set_log_group_references).
134    ///
135    /// <p>An array of string-to-string maps that each contain information about one log group associated with this service. Each string-to-string map includes the following fields:</p>
136    /// <ul>
137    /// <li>
138    /// <p><code>"Type": "AWS::Resource"</code></p></li>
139    /// <li>
140    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
141    /// <li>
142    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
143    /// </ul>
144    pub fn log_group_references(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
145        let mut v = self.log_group_references.unwrap_or_default();
146        v.push(input);
147        self.log_group_references = ::std::option::Option::Some(v);
148        self
149    }
150    /// <p>An array of string-to-string maps that each contain information about one log group associated with this service. Each string-to-string map includes the following fields:</p>
151    /// <ul>
152    /// <li>
153    /// <p><code>"Type": "AWS::Resource"</code></p></li>
154    /// <li>
155    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
156    /// <li>
157    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
158    /// </ul>
159    pub fn set_log_group_references(
160        mut self,
161        input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
162    ) -> Self {
163        self.log_group_references = input;
164        self
165    }
166    /// <p>An array of string-to-string maps that each contain information about one log group associated with this service. Each string-to-string map includes the following fields:</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>"Type": "AWS::Resource"</code></p></li>
170    /// <li>
171    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
172    /// <li>
173    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
174    /// </ul>
175    pub fn get_log_group_references(
176        &self,
177    ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
178        &self.log_group_references
179    }
180    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
181        self._request_id = Some(request_id.into());
182        self
183    }
184
185    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
186        self._request_id = request_id;
187        self
188    }
189    /// Consumes the builder and constructs a [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
190    /// This method will fail if any of the following fields are not set:
191    /// - [`start_time`](crate::operation::get_service::builders::GetServiceOutputBuilder::start_time)
192    /// - [`end_time`](crate::operation::get_service::builders::GetServiceOutputBuilder::end_time)
193    pub fn build(self) -> ::std::result::Result<crate::operation::get_service::GetServiceOutput, ::aws_smithy_types::error::operation::BuildError> {
194        ::std::result::Result::Ok(crate::operation::get_service::GetServiceOutput {
195            service: self.service,
196            start_time: self.start_time.ok_or_else(|| {
197                ::aws_smithy_types::error::operation::BuildError::missing_field(
198                    "start_time",
199                    "start_time was not specified but it is required when building GetServiceOutput",
200                )
201            })?,
202            end_time: self.end_time.ok_or_else(|| {
203                ::aws_smithy_types::error::operation::BuildError::missing_field(
204                    "end_time",
205                    "end_time was not specified but it is required when building GetServiceOutput",
206                )
207            })?,
208            log_group_references: self.log_group_references,
209            _request_id: self._request_id,
210        })
211    }
212}