1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides the results of a query that retrieved the data for a standard execution metric that applies to a journey, and provides information about that query.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct JourneyExecutionMetricsResponse {
/// <p>The unique identifier for the application that the metric applies to.</p>
pub application_id: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier for the journey that the metric applies to.</p>
pub journey_id: ::std::option::Option<::std::string::String>,
/// <p>The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the journey and updated the data for the metric.</p>
pub last_evaluated_time: ::std::option::Option<::std::string::String>,
/// <p>A JSON object that contains the results of the query. For information about the structure and contents of the results, see the <a href="https://docs.aws.amazon.com//pinpoint/latest/developerguide/analytics-standard-metrics.html">Amazon Pinpoint Developer Guide</a>.</p>
pub metrics: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl JourneyExecutionMetricsResponse {
/// <p>The unique identifier for the application that the metric applies to.</p>
pub fn application_id(&self) -> ::std::option::Option<&str> {
self.application_id.as_deref()
}
/// <p>The unique identifier for the journey that the metric applies to.</p>
pub fn journey_id(&self) -> ::std::option::Option<&str> {
self.journey_id.as_deref()
}
/// <p>The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the journey and updated the data for the metric.</p>
pub fn last_evaluated_time(&self) -> ::std::option::Option<&str> {
self.last_evaluated_time.as_deref()
}
/// <p>A JSON object that contains the results of the query. For information about the structure and contents of the results, see the <a href="https://docs.aws.amazon.com//pinpoint/latest/developerguide/analytics-standard-metrics.html">Amazon Pinpoint Developer Guide</a>.</p>
pub fn metrics(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.metrics.as_ref()
}
}
impl JourneyExecutionMetricsResponse {
/// Creates a new builder-style object to manufacture [`JourneyExecutionMetricsResponse`](crate::types::JourneyExecutionMetricsResponse).
pub fn builder() -> crate::types::builders::JourneyExecutionMetricsResponseBuilder {
crate::types::builders::JourneyExecutionMetricsResponseBuilder::default()
}
}
/// A builder for [`JourneyExecutionMetricsResponse`](crate::types::JourneyExecutionMetricsResponse).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct JourneyExecutionMetricsResponseBuilder {
pub(crate) application_id: ::std::option::Option<::std::string::String>,
pub(crate) journey_id: ::std::option::Option<::std::string::String>,
pub(crate) last_evaluated_time: ::std::option::Option<::std::string::String>,
pub(crate) metrics: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl JourneyExecutionMetricsResponseBuilder {
/// <p>The unique identifier for the application that the metric applies to.</p>
/// This field is required.
pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.application_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier for the application that the metric applies to.</p>
pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.application_id = input;
self
}
/// <p>The unique identifier for the application that the metric applies to.</p>
pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
&self.application_id
}
/// <p>The unique identifier for the journey that the metric applies to.</p>
/// This field is required.
pub fn journey_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.journey_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier for the journey that the metric applies to.</p>
pub fn set_journey_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.journey_id = input;
self
}
/// <p>The unique identifier for the journey that the metric applies to.</p>
pub fn get_journey_id(&self) -> &::std::option::Option<::std::string::String> {
&self.journey_id
}
/// <p>The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the journey and updated the data for the metric.</p>
/// This field is required.
pub fn last_evaluated_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.last_evaluated_time = ::std::option::Option::Some(input.into());
self
}
/// <p>The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the journey and updated the data for the metric.</p>
pub fn set_last_evaluated_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.last_evaluated_time = input;
self
}
/// <p>The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the journey and updated the data for the metric.</p>
pub fn get_last_evaluated_time(&self) -> &::std::option::Option<::std::string::String> {
&self.last_evaluated_time
}
/// Adds a key-value pair to `metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <p>A JSON object that contains the results of the query. For information about the structure and contents of the results, see the <a href="https://docs.aws.amazon.com//pinpoint/latest/developerguide/analytics-standard-metrics.html">Amazon Pinpoint Developer Guide</a>.</p>
pub fn metrics(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.metrics.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.metrics = ::std::option::Option::Some(hash_map);
self
}
/// <p>A JSON object that contains the results of the query. For information about the structure and contents of the results, see the <a href="https://docs.aws.amazon.com//pinpoint/latest/developerguide/analytics-standard-metrics.html">Amazon Pinpoint Developer Guide</a>.</p>
pub fn set_metrics(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.metrics = input;
self
}
/// <p>A JSON object that contains the results of the query. For information about the structure and contents of the results, see the <a href="https://docs.aws.amazon.com//pinpoint/latest/developerguide/analytics-standard-metrics.html">Amazon Pinpoint Developer Guide</a>.</p>
pub fn get_metrics(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.metrics
}
/// Consumes the builder and constructs a [`JourneyExecutionMetricsResponse`](crate::types::JourneyExecutionMetricsResponse).
pub fn build(self) -> crate::types::JourneyExecutionMetricsResponse {
crate::types::JourneyExecutionMetricsResponse {
application_id: self.application_id,
journey_id: self.journey_id,
last_evaluated_time: self.last_evaluated_time,
metrics: self.metrics,
}
}
}