aws_sdk_applicationsignals/operation/get_service/
_get_service_input.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 GetServiceInput {
6    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
7    /// <p>Your requested start time will be rounded to the nearest hour.</p>
8    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
9    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
10    /// <p>Your requested start time will be rounded to the nearest hour.</p>
11    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
12    /// <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p>
13    /// <p>This is a string-to-string map. It can include the following fields.</p>
14    /// <ul>
15    /// <li>
16    /// <p><code>Type</code> designates the type of object this is.</p></li>
17    /// <li>
18    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
19    /// <li>
20    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
21    /// <li>
22    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
23    /// <li>
24    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
25    /// </ul>
26    pub key_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27}
28impl GetServiceInput {
29    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
30    /// <p>Your requested start time will be rounded to the nearest hour.</p>
31    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
32        self.start_time.as_ref()
33    }
34    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
35    /// <p>Your requested start time will be rounded to the nearest hour.</p>
36    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
37        self.end_time.as_ref()
38    }
39    /// <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p>
40    /// <p>This is a string-to-string map. It can include the following fields.</p>
41    /// <ul>
42    /// <li>
43    /// <p><code>Type</code> designates the type of object this is.</p></li>
44    /// <li>
45    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
46    /// <li>
47    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
48    /// <li>
49    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
50    /// <li>
51    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
52    /// </ul>
53    pub fn key_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54        self.key_attributes.as_ref()
55    }
56}
57impl GetServiceInput {
58    /// Creates a new builder-style object to manufacture [`GetServiceInput`](crate::operation::get_service::GetServiceInput).
59    pub fn builder() -> crate::operation::get_service::builders::GetServiceInputBuilder {
60        crate::operation::get_service::builders::GetServiceInputBuilder::default()
61    }
62}
63
64/// A builder for [`GetServiceInput`](crate::operation::get_service::GetServiceInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct GetServiceInputBuilder {
68    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
69    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
70    pub(crate) key_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
71}
72impl GetServiceInputBuilder {
73    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
74    /// <p>Your requested start time will be rounded to the nearest hour.</p>
75    /// This field is required.
76    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
77        self.start_time = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
81    /// <p>Your requested start time will be rounded to the nearest hour.</p>
82    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
83        self.start_time = input;
84        self
85    }
86    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
87    /// <p>Your requested start time will be rounded to the nearest hour.</p>
88    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
89        &self.start_time
90    }
91    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
92    /// <p>Your requested start time will be rounded to the nearest hour.</p>
93    /// This field is required.
94    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
95        self.end_time = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
99    /// <p>Your requested start time will be rounded to the nearest hour.</p>
100    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
101        self.end_time = input;
102        self
103    }
104    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
105    /// <p>Your requested start time will be rounded to the nearest hour.</p>
106    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107        &self.end_time
108    }
109    /// Adds a key-value pair to `key_attributes`.
110    ///
111    /// To override the contents of this collection use [`set_key_attributes`](Self::set_key_attributes).
112    ///
113    /// <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p>
114    /// <p>This is a string-to-string map. It can include the following fields.</p>
115    /// <ul>
116    /// <li>
117    /// <p><code>Type</code> designates the type of object this is.</p></li>
118    /// <li>
119    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
120    /// <li>
121    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
122    /// <li>
123    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
124    /// <li>
125    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
126    /// </ul>
127    pub fn key_attributes(
128        mut self,
129        k: impl ::std::convert::Into<::std::string::String>,
130        v: impl ::std::convert::Into<::std::string::String>,
131    ) -> Self {
132        let mut hash_map = self.key_attributes.unwrap_or_default();
133        hash_map.insert(k.into(), v.into());
134        self.key_attributes = ::std::option::Option::Some(hash_map);
135        self
136    }
137    /// <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p>
138    /// <p>This is a string-to-string map. It can include the following fields.</p>
139    /// <ul>
140    /// <li>
141    /// <p><code>Type</code> designates the type of object this is.</p></li>
142    /// <li>
143    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
144    /// <li>
145    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
146    /// <li>
147    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
148    /// <li>
149    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
150    /// </ul>
151    pub fn set_key_attributes(
152        mut self,
153        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
154    ) -> Self {
155        self.key_attributes = input;
156        self
157    }
158    /// <p>Use this field to specify which service you want to retrieve information for. You must specify at least the <code>Type</code>, <code>Name</code>, and <code>Environment</code> attributes.</p>
159    /// <p>This is a string-to-string map. It can include the following fields.</p>
160    /// <ul>
161    /// <li>
162    /// <p><code>Type</code> designates the type of object this is.</p></li>
163    /// <li>
164    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
165    /// <li>
166    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
167    /// <li>
168    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
169    /// <li>
170    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
171    /// </ul>
172    pub fn get_key_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
173        &self.key_attributes
174    }
175    /// Consumes the builder and constructs a [`GetServiceInput`](crate::operation::get_service::GetServiceInput).
176    pub fn build(self) -> ::std::result::Result<crate::operation::get_service::GetServiceInput, ::aws_smithy_types::error::operation::BuildError> {
177        ::std::result::Result::Ok(crate::operation::get_service::GetServiceInput {
178            start_time: self.start_time,
179            end_time: self.end_time,
180            key_attributes: self.key_attributes,
181        })
182    }
183}