aws-sdk-applicationsignals 1.90.0

AWS SDK for Amazon CloudWatch Application Signals
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetServiceOutput {
    /// <p>A structure containing information about the service.</p>
    pub service: ::std::option::Option<crate::types::Service>,
    /// <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>
    /// <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>
    pub start_time: ::aws_smithy_types::DateTime,
    /// <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>
    /// <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>
    pub end_time: ::aws_smithy_types::DateTime,
    /// <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>
    /// <ul>
    /// <li>
    /// <p><code>"Type": "AWS::Resource"</code></p></li>
    /// <li>
    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
    /// <li>
    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
    /// </ul>
    pub log_group_references: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    _request_id: Option<String>,
}
impl GetServiceOutput {
    /// <p>A structure containing information about the service.</p>
    pub fn service(&self) -> ::std::option::Option<&crate::types::Service> {
        self.service.as_ref()
    }
    /// <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>
    /// <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>
    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.start_time
    }
    /// <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>
    /// <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>
    pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.end_time
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><code>"Type": "AWS::Resource"</code></p></li>
    /// <li>
    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
    /// <li>
    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
    /// </ul>
    ///
    /// 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()`.
    pub fn log_group_references(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
        self.log_group_references.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetServiceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetServiceOutput {
    /// Creates a new builder-style object to manufacture [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
    pub fn builder() -> crate::operation::get_service::builders::GetServiceOutputBuilder {
        crate::operation::get_service::builders::GetServiceOutputBuilder::default()
    }
}

/// A builder for [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetServiceOutputBuilder {
    pub(crate) service: ::std::option::Option<crate::types::Service>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) log_group_references:
        ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    _request_id: Option<String>,
}
impl GetServiceOutputBuilder {
    /// <p>A structure containing information about the service.</p>
    /// This field is required.
    pub fn service(mut self, input: crate::types::Service) -> Self {
        self.service = ::std::option::Option::Some(input);
        self
    }
    /// <p>A structure containing information about the service.</p>
    pub fn set_service(mut self, input: ::std::option::Option<crate::types::Service>) -> Self {
        self.service = input;
        self
    }
    /// <p>A structure containing information about the service.</p>
    pub fn get_service(&self) -> &::std::option::Option<crate::types::Service> {
        &self.service
    }
    /// <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>
    /// <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>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    /// <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>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <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>
    /// <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>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <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>
    /// <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>
    /// This field is required.
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    /// <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>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <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>
    /// <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>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// Appends an item to `log_group_references`.
    ///
    /// To override the contents of this collection use [`set_log_group_references`](Self::set_log_group_references).
    ///
    /// <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>
    /// <ul>
    /// <li>
    /// <p><code>"Type": "AWS::Resource"</code></p></li>
    /// <li>
    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
    /// <li>
    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
    /// </ul>
    pub fn log_group_references(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
        let mut v = self.log_group_references.unwrap_or_default();
        v.push(input);
        self.log_group_references = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><code>"Type": "AWS::Resource"</code></p></li>
    /// <li>
    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
    /// <li>
    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
    /// </ul>
    pub fn set_log_group_references(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    ) -> Self {
        self.log_group_references = input;
        self
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><code>"Type": "AWS::Resource"</code></p></li>
    /// <li>
    /// <p><code>"ResourceType": "AWS::Logs::LogGroup"</code></p></li>
    /// <li>
    /// <p><code>"Identifier": "<i>name-of-log-group</i>"</code></p></li>
    /// </ul>
    pub fn get_log_group_references(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
        &self.log_group_references
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetServiceOutput`](crate::operation::get_service::GetServiceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`start_time`](crate::operation::get_service::builders::GetServiceOutputBuilder::start_time)
    /// - [`end_time`](crate::operation::get_service::builders::GetServiceOutputBuilder::end_time)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_service::GetServiceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_service::GetServiceOutput {
            service: self.service,
            start_time: self.start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_time",
                    "start_time was not specified but it is required when building GetServiceOutput",
                )
            })?,
            end_time: self.end_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "end_time",
                    "end_time was not specified but it is required when building GetServiceOutput",
                )
            })?,
            log_group_references: self.log_group_references,
            _request_id: self._request_id,
        })
    }
}