{-# 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.EC2.Types.SlotStartTimeRangeRequest
-- 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.EC2.Types.SlotStartTimeRangeRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes the time period for a Scheduled Instance to start its first
-- schedule.
--
-- /See:/ 'newSlotStartTimeRangeRequest' smart constructor.
data SlotStartTimeRangeRequest = SlotStartTimeRangeRequest'
  { -- | The earliest date and time, in UTC, for the Scheduled Instance to start.
    SlotStartTimeRangeRequest -> Maybe ISO8601
earliestTime :: Prelude.Maybe Data.ISO8601,
    -- | The latest date and time, in UTC, for the Scheduled Instance to start.
    SlotStartTimeRangeRequest -> Maybe ISO8601
latestTime :: Prelude.Maybe Data.ISO8601
  }
  deriving (SlotStartTimeRangeRequest -> SlotStartTimeRangeRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotStartTimeRangeRequest -> SlotStartTimeRangeRequest -> Bool
$c/= :: SlotStartTimeRangeRequest -> SlotStartTimeRangeRequest -> Bool
== :: SlotStartTimeRangeRequest -> SlotStartTimeRangeRequest -> Bool
$c== :: SlotStartTimeRangeRequest -> SlotStartTimeRangeRequest -> Bool
Prelude.Eq, ReadPrec [SlotStartTimeRangeRequest]
ReadPrec SlotStartTimeRangeRequest
Int -> ReadS SlotStartTimeRangeRequest
ReadS [SlotStartTimeRangeRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotStartTimeRangeRequest]
$creadListPrec :: ReadPrec [SlotStartTimeRangeRequest]
readPrec :: ReadPrec SlotStartTimeRangeRequest
$creadPrec :: ReadPrec SlotStartTimeRangeRequest
readList :: ReadS [SlotStartTimeRangeRequest]
$creadList :: ReadS [SlotStartTimeRangeRequest]
readsPrec :: Int -> ReadS SlotStartTimeRangeRequest
$creadsPrec :: Int -> ReadS SlotStartTimeRangeRequest
Prelude.Read, Int -> SlotStartTimeRangeRequest -> ShowS
[SlotStartTimeRangeRequest] -> ShowS
SlotStartTimeRangeRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotStartTimeRangeRequest] -> ShowS
$cshowList :: [SlotStartTimeRangeRequest] -> ShowS
show :: SlotStartTimeRangeRequest -> String
$cshow :: SlotStartTimeRangeRequest -> String
showsPrec :: Int -> SlotStartTimeRangeRequest -> ShowS
$cshowsPrec :: Int -> SlotStartTimeRangeRequest -> ShowS
Prelude.Show, forall x.
Rep SlotStartTimeRangeRequest x -> SlotStartTimeRangeRequest
forall x.
SlotStartTimeRangeRequest -> Rep SlotStartTimeRangeRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SlotStartTimeRangeRequest x -> SlotStartTimeRangeRequest
$cfrom :: forall x.
SlotStartTimeRangeRequest -> Rep SlotStartTimeRangeRequest x
Prelude.Generic)

-- |
-- Create a value of 'SlotStartTimeRangeRequest' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'earliestTime', 'slotStartTimeRangeRequest_earliestTime' - The earliest date and time, in UTC, for the Scheduled Instance to start.
--
-- 'latestTime', 'slotStartTimeRangeRequest_latestTime' - The latest date and time, in UTC, for the Scheduled Instance to start.
newSlotStartTimeRangeRequest ::
  SlotStartTimeRangeRequest
newSlotStartTimeRangeRequest :: SlotStartTimeRangeRequest
newSlotStartTimeRangeRequest =
  SlotStartTimeRangeRequest'
    { $sel:earliestTime:SlotStartTimeRangeRequest' :: Maybe ISO8601
earliestTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:latestTime:SlotStartTimeRangeRequest' :: Maybe ISO8601
latestTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The earliest date and time, in UTC, for the Scheduled Instance to start.
slotStartTimeRangeRequest_earliestTime :: Lens.Lens' SlotStartTimeRangeRequest (Prelude.Maybe Prelude.UTCTime)
slotStartTimeRangeRequest_earliestTime :: Lens' SlotStartTimeRangeRequest (Maybe UTCTime)
slotStartTimeRangeRequest_earliestTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotStartTimeRangeRequest' {Maybe ISO8601
earliestTime :: Maybe ISO8601
$sel:earliestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
earliestTime} -> Maybe ISO8601
earliestTime) (\s :: SlotStartTimeRangeRequest
s@SlotStartTimeRangeRequest' {} Maybe ISO8601
a -> SlotStartTimeRangeRequest
s {$sel:earliestTime:SlotStartTimeRangeRequest' :: Maybe ISO8601
earliestTime = Maybe ISO8601
a} :: SlotStartTimeRangeRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The latest date and time, in UTC, for the Scheduled Instance to start.
slotStartTimeRangeRequest_latestTime :: Lens.Lens' SlotStartTimeRangeRequest (Prelude.Maybe Prelude.UTCTime)
slotStartTimeRangeRequest_latestTime :: Lens' SlotStartTimeRangeRequest (Maybe UTCTime)
slotStartTimeRangeRequest_latestTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotStartTimeRangeRequest' {Maybe ISO8601
latestTime :: Maybe ISO8601
$sel:latestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
latestTime} -> Maybe ISO8601
latestTime) (\s :: SlotStartTimeRangeRequest
s@SlotStartTimeRangeRequest' {} Maybe ISO8601
a -> SlotStartTimeRangeRequest
s {$sel:latestTime:SlotStartTimeRangeRequest' :: Maybe ISO8601
latestTime = Maybe ISO8601
a} :: SlotStartTimeRangeRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Prelude.Hashable SlotStartTimeRangeRequest where
  hashWithSalt :: Int -> SlotStartTimeRangeRequest -> Int
hashWithSalt Int
_salt SlotStartTimeRangeRequest' {Maybe ISO8601
latestTime :: Maybe ISO8601
earliestTime :: Maybe ISO8601
$sel:latestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
$sel:earliestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
earliestTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
latestTime

instance Prelude.NFData SlotStartTimeRangeRequest where
  rnf :: SlotStartTimeRangeRequest -> ()
rnf SlotStartTimeRangeRequest' {Maybe ISO8601
latestTime :: Maybe ISO8601
earliestTime :: Maybe ISO8601
$sel:latestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
$sel:earliestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
earliestTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
latestTime

instance Data.ToQuery SlotStartTimeRangeRequest where
  toQuery :: SlotStartTimeRangeRequest -> QueryString
toQuery SlotStartTimeRangeRequest' {Maybe ISO8601
latestTime :: Maybe ISO8601
earliestTime :: Maybe ISO8601
$sel:latestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
$sel:earliestTime:SlotStartTimeRangeRequest' :: SlotStartTimeRangeRequest -> Maybe ISO8601
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"EarliestTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
earliestTime,
        ByteString
"LatestTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ISO8601
latestTime
      ]