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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Input for GetMetric.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMetricInput {
/// The ID of the app.
pub app_id: ::std::option::Option<::std::string::String>,
/// The ID of the metric to retrieve.
pub metric_id: ::std::option::Option<::std::string::String>,
/// The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
pub stage: ::std::option::Option<crate::types::PlanStage>,
/// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetMetricInput {
/// The ID of the app.
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
/// The ID of the metric to retrieve.
pub fn metric_id(&self) -> ::std::option::Option<&str> {
self.metric_id.as_deref()
}
/// The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
pub fn stage(&self) -> ::std::option::Option<&crate::types::PlanStage> {
self.stage.as_ref()
}
/// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
self.scope.as_ref()
}
}
impl GetMetricInput {
/// Creates a new builder-style object to manufacture [`GetMetricInput`](crate::operation::get_metric::GetMetricInput).
pub fn builder() -> crate::operation::get_metric::builders::GetMetricInputBuilder {
crate::operation::get_metric::builders::GetMetricInputBuilder::default()
}
}
/// A builder for [`GetMetricInput`](crate::operation::get_metric::GetMetricInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMetricInputBuilder {
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) metric_id: ::std::option::Option<::std::string::String>,
pub(crate) stage: ::std::option::Option<crate::types::PlanStage>,
pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetMetricInputBuilder {
/// The ID of the app.
/// This field is required.
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
/// The ID of the app.
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
/// The ID of the app.
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
/// The ID of the metric to retrieve.
/// This field is required.
pub fn metric_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.metric_id = ::std::option::Option::Some(input.into());
self
}
/// The ID of the metric to retrieve.
pub fn set_metric_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.metric_id = input;
self
}
/// The ID of the metric to retrieve.
pub fn get_metric_id(&self) -> &::std::option::Option<::std::string::String> {
&self.metric_id
}
/// The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
pub fn stage(mut self, input: crate::types::PlanStage) -> Self {
self.stage = ::std::option::Option::Some(input);
self
}
/// The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
pub fn set_stage(mut self, input: ::std::option::Option<crate::types::PlanStage>) -> Self {
self.stage = input;
self
}
/// The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
pub fn get_stage(&self) -> &::std::option::Option<crate::types::PlanStage> {
&self.stage
}
/// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
/// This field is required.
pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
self.scope = ::std::option::Option::Some(input);
self
}
/// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
self.scope = input;
self
}
/// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.
pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
&self.scope
}
/// Consumes the builder and constructs a [`GetMetricInput`](crate::operation::get_metric::GetMetricInput).
pub fn build(self) -> ::std::result::Result<crate::operation::get_metric::GetMetricInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_metric::GetMetricInput {
app_id: self.app_id,
metric_id: self.metric_id,
stage: self.stage,
scope: self.scope,
})
}
}