{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.Forecast.Types.TimeAlignmentBoundary -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.Forecast.Types.TimeAlignmentBoundary where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.Forecast.Types.DayOfWeek import Amazonka.Forecast.Types.Month import qualified Amazonka.Prelude as Prelude -- | 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 -- . -- -- For more information about aggregation, see -- . -- For more information setting a custom time boundary, see -- . -- -- /See:/ 'newTimeAlignmentBoundary' smart constructor. data TimeAlignmentBoundary = TimeAlignmentBoundary' { -- | The day of the month to use for time alignment during aggregation. dayOfMonth :: Prelude.Maybe Prelude.Natural, -- | The day of week to use for time alignment during aggregation. The day -- must be in uppercase. dayOfWeek :: Prelude.Maybe DayOfWeek, -- | The hour of day to use for time alignment during aggregation. hour :: Prelude.Maybe Prelude.Natural, -- | The month to use for time alignment during aggregation. The month must -- be in uppercase. month :: Prelude.Maybe Month } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'TimeAlignmentBoundary' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'dayOfMonth', 'timeAlignmentBoundary_dayOfMonth' - The day of the month to use for time alignment during aggregation. -- -- 'dayOfWeek', 'timeAlignmentBoundary_dayOfWeek' - The day of week to use for time alignment during aggregation. The day -- must be in uppercase. -- -- 'hour', 'timeAlignmentBoundary_hour' - The hour of day to use for time alignment during aggregation. -- -- 'month', 'timeAlignmentBoundary_month' - The month to use for time alignment during aggregation. The month must -- be in uppercase. newTimeAlignmentBoundary :: TimeAlignmentBoundary newTimeAlignmentBoundary = TimeAlignmentBoundary' { dayOfMonth = Prelude.Nothing, dayOfWeek = Prelude.Nothing, hour = Prelude.Nothing, month = Prelude.Nothing } -- | The day of the month to use for time alignment during aggregation. timeAlignmentBoundary_dayOfMonth :: Lens.Lens' TimeAlignmentBoundary (Prelude.Maybe Prelude.Natural) timeAlignmentBoundary_dayOfMonth = Lens.lens (\TimeAlignmentBoundary' {dayOfMonth} -> dayOfMonth) (\s@TimeAlignmentBoundary' {} a -> s {dayOfMonth = a} :: TimeAlignmentBoundary) -- | The day of week to use for time alignment during aggregation. The day -- must be in uppercase. timeAlignmentBoundary_dayOfWeek :: Lens.Lens' TimeAlignmentBoundary (Prelude.Maybe DayOfWeek) timeAlignmentBoundary_dayOfWeek = Lens.lens (\TimeAlignmentBoundary' {dayOfWeek} -> dayOfWeek) (\s@TimeAlignmentBoundary' {} a -> s {dayOfWeek = a} :: TimeAlignmentBoundary) -- | The hour of day to use for time alignment during aggregation. timeAlignmentBoundary_hour :: Lens.Lens' TimeAlignmentBoundary (Prelude.Maybe Prelude.Natural) timeAlignmentBoundary_hour = Lens.lens (\TimeAlignmentBoundary' {hour} -> hour) (\s@TimeAlignmentBoundary' {} a -> s {hour = a} :: TimeAlignmentBoundary) -- | The month to use for time alignment during aggregation. The month must -- be in uppercase. timeAlignmentBoundary_month :: Lens.Lens' TimeAlignmentBoundary (Prelude.Maybe Month) timeAlignmentBoundary_month = Lens.lens (\TimeAlignmentBoundary' {month} -> month) (\s@TimeAlignmentBoundary' {} a -> s {month = a} :: TimeAlignmentBoundary) instance Data.FromJSON TimeAlignmentBoundary where parseJSON = Data.withObject "TimeAlignmentBoundary" ( \x -> TimeAlignmentBoundary' Prelude.<$> (x Data..:? "DayOfMonth") Prelude.<*> (x Data..:? "DayOfWeek") Prelude.<*> (x Data..:? "Hour") Prelude.<*> (x Data..:? "Month") ) instance Prelude.Hashable TimeAlignmentBoundary where hashWithSalt _salt TimeAlignmentBoundary' {..} = _salt `Prelude.hashWithSalt` dayOfMonth `Prelude.hashWithSalt` dayOfWeek `Prelude.hashWithSalt` hour `Prelude.hashWithSalt` month instance Prelude.NFData TimeAlignmentBoundary where rnf TimeAlignmentBoundary' {..} = Prelude.rnf dayOfMonth `Prelude.seq` Prelude.rnf dayOfWeek `Prelude.seq` Prelude.rnf hour `Prelude.seq` Prelude.rnf month instance Data.ToJSON TimeAlignmentBoundary where toJSON TimeAlignmentBoundary' {..} = Data.object ( Prelude.catMaybes [ ("DayOfMonth" Data..=) Prelude.<$> dayOfMonth, ("DayOfWeek" Data..=) Prelude.<$> dayOfWeek, ("Hour" Data..=) Prelude.<$> hour, ("Month" Data..=) Prelude.<$> month ] )