aws_sdk_forecast/types/_time_alignment_boundary.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The time boundary Forecast uses to align and aggregate your data to match your forecast frequency. Provide the unit of time and the time boundary as a key value pair. If you don't provide a time boundary, Forecast uses a set of <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries">Default Time Boundaries</a>.</p>
4/// <p>For more information about aggregation, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html">Data Aggregation for Different Forecast Frequencies</a>. For more information setting a custom time boundary, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary">Specifying a Time Boundary</a>.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct TimeAlignmentBoundary {
8 /// <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
9 pub month: ::std::option::Option<crate::types::Month>,
10 /// <p>The day of the month to use for time alignment during aggregation.</p>
11 pub day_of_month: ::std::option::Option<i32>,
12 /// <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
13 pub day_of_week: ::std::option::Option<crate::types::DayOfWeek>,
14 /// <p>The hour of day to use for time alignment during aggregation.</p>
15 pub hour: ::std::option::Option<i32>,
16}
17impl TimeAlignmentBoundary {
18 /// <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
19 pub fn month(&self) -> ::std::option::Option<&crate::types::Month> {
20 self.month.as_ref()
21 }
22 /// <p>The day of the month to use for time alignment during aggregation.</p>
23 pub fn day_of_month(&self) -> ::std::option::Option<i32> {
24 self.day_of_month
25 }
26 /// <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
27 pub fn day_of_week(&self) -> ::std::option::Option<&crate::types::DayOfWeek> {
28 self.day_of_week.as_ref()
29 }
30 /// <p>The hour of day to use for time alignment during aggregation.</p>
31 pub fn hour(&self) -> ::std::option::Option<i32> {
32 self.hour
33 }
34}
35impl TimeAlignmentBoundary {
36 /// Creates a new builder-style object to manufacture [`TimeAlignmentBoundary`](crate::types::TimeAlignmentBoundary).
37 pub fn builder() -> crate::types::builders::TimeAlignmentBoundaryBuilder {
38 crate::types::builders::TimeAlignmentBoundaryBuilder::default()
39 }
40}
41
42/// A builder for [`TimeAlignmentBoundary`](crate::types::TimeAlignmentBoundary).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct TimeAlignmentBoundaryBuilder {
46 pub(crate) month: ::std::option::Option<crate::types::Month>,
47 pub(crate) day_of_month: ::std::option::Option<i32>,
48 pub(crate) day_of_week: ::std::option::Option<crate::types::DayOfWeek>,
49 pub(crate) hour: ::std::option::Option<i32>,
50}
51impl TimeAlignmentBoundaryBuilder {
52 /// <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
53 pub fn month(mut self, input: crate::types::Month) -> Self {
54 self.month = ::std::option::Option::Some(input);
55 self
56 }
57 /// <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
58 pub fn set_month(mut self, input: ::std::option::Option<crate::types::Month>) -> Self {
59 self.month = input;
60 self
61 }
62 /// <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
63 pub fn get_month(&self) -> &::std::option::Option<crate::types::Month> {
64 &self.month
65 }
66 /// <p>The day of the month to use for time alignment during aggregation.</p>
67 pub fn day_of_month(mut self, input: i32) -> Self {
68 self.day_of_month = ::std::option::Option::Some(input);
69 self
70 }
71 /// <p>The day of the month to use for time alignment during aggregation.</p>
72 pub fn set_day_of_month(mut self, input: ::std::option::Option<i32>) -> Self {
73 self.day_of_month = input;
74 self
75 }
76 /// <p>The day of the month to use for time alignment during aggregation.</p>
77 pub fn get_day_of_month(&self) -> &::std::option::Option<i32> {
78 &self.day_of_month
79 }
80 /// <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
81 pub fn day_of_week(mut self, input: crate::types::DayOfWeek) -> Self {
82 self.day_of_week = ::std::option::Option::Some(input);
83 self
84 }
85 /// <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
86 pub fn set_day_of_week(mut self, input: ::std::option::Option<crate::types::DayOfWeek>) -> Self {
87 self.day_of_week = input;
88 self
89 }
90 /// <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
91 pub fn get_day_of_week(&self) -> &::std::option::Option<crate::types::DayOfWeek> {
92 &self.day_of_week
93 }
94 /// <p>The hour of day to use for time alignment during aggregation.</p>
95 pub fn hour(mut self, input: i32) -> Self {
96 self.hour = ::std::option::Option::Some(input);
97 self
98 }
99 /// <p>The hour of day to use for time alignment during aggregation.</p>
100 pub fn set_hour(mut self, input: ::std::option::Option<i32>) -> Self {
101 self.hour = input;
102 self
103 }
104 /// <p>The hour of day to use for time alignment during aggregation.</p>
105 pub fn get_hour(&self) -> &::std::option::Option<i32> {
106 &self.hour
107 }
108 /// Consumes the builder and constructs a [`TimeAlignmentBoundary`](crate::types::TimeAlignmentBoundary).
109 pub fn build(self) -> crate::types::TimeAlignmentBoundary {
110 crate::types::TimeAlignmentBoundary {
111 month: self.month,
112 day_of_month: self.day_of_month,
113 day_of_week: self.day_of_week,
114 hour: self.hour,
115 }
116 }
117}