{-# 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 #-}
module Amazonka.CostExplorer.Types.AnomalyDateInterval where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnomalyDateInterval = AnomalyDateInterval'
{
AnomalyDateInterval -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
AnomalyDateInterval -> Text
startDate :: Prelude.Text
}
deriving (AnomalyDateInterval -> AnomalyDateInterval -> Bool
(AnomalyDateInterval -> AnomalyDateInterval -> Bool)
-> (AnomalyDateInterval -> AnomalyDateInterval -> Bool)
-> Eq AnomalyDateInterval
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyDateInterval -> AnomalyDateInterval -> Bool
$c/= :: AnomalyDateInterval -> AnomalyDateInterval -> Bool
== :: AnomalyDateInterval -> AnomalyDateInterval -> Bool
$c== :: AnomalyDateInterval -> AnomalyDateInterval -> Bool
Prelude.Eq, ReadPrec [AnomalyDateInterval]
ReadPrec AnomalyDateInterval
Int -> ReadS AnomalyDateInterval
ReadS [AnomalyDateInterval]
(Int -> ReadS AnomalyDateInterval)
-> ReadS [AnomalyDateInterval]
-> ReadPrec AnomalyDateInterval
-> ReadPrec [AnomalyDateInterval]
-> Read AnomalyDateInterval
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyDateInterval]
$creadListPrec :: ReadPrec [AnomalyDateInterval]
readPrec :: ReadPrec AnomalyDateInterval
$creadPrec :: ReadPrec AnomalyDateInterval
readList :: ReadS [AnomalyDateInterval]
$creadList :: ReadS [AnomalyDateInterval]
readsPrec :: Int -> ReadS AnomalyDateInterval
$creadsPrec :: Int -> ReadS AnomalyDateInterval
Prelude.Read, Int -> AnomalyDateInterval -> ShowS
[AnomalyDateInterval] -> ShowS
AnomalyDateInterval -> String
(Int -> AnomalyDateInterval -> ShowS)
-> (AnomalyDateInterval -> String)
-> ([AnomalyDateInterval] -> ShowS)
-> Show AnomalyDateInterval
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyDateInterval] -> ShowS
$cshowList :: [AnomalyDateInterval] -> ShowS
show :: AnomalyDateInterval -> String
$cshow :: AnomalyDateInterval -> String
showsPrec :: Int -> AnomalyDateInterval -> ShowS
$cshowsPrec :: Int -> AnomalyDateInterval -> ShowS
Prelude.Show, (forall x. AnomalyDateInterval -> Rep AnomalyDateInterval x)
-> (forall x. Rep AnomalyDateInterval x -> AnomalyDateInterval)
-> Generic AnomalyDateInterval
forall x. Rep AnomalyDateInterval x -> AnomalyDateInterval
forall x. AnomalyDateInterval -> Rep AnomalyDateInterval x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyDateInterval x -> AnomalyDateInterval
$cfrom :: forall x. AnomalyDateInterval -> Rep AnomalyDateInterval x
Prelude.Generic)
newAnomalyDateInterval ::
Prelude.Text ->
AnomalyDateInterval
newAnomalyDateInterval :: Text -> AnomalyDateInterval
newAnomalyDateInterval Text
pStartDate_ =
AnomalyDateInterval' :: Maybe Text -> Text -> AnomalyDateInterval
AnomalyDateInterval'
{ $sel:endDate:AnomalyDateInterval' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startDate:AnomalyDateInterval' :: Text
startDate = Text
pStartDate_
}
anomalyDateInterval_endDate :: Lens.Lens' AnomalyDateInterval (Prelude.Maybe Prelude.Text)
anomalyDateInterval_endDate :: (Maybe Text -> f (Maybe Text))
-> AnomalyDateInterval -> f AnomalyDateInterval
anomalyDateInterval_endDate = (AnomalyDateInterval -> Maybe Text)
-> (AnomalyDateInterval -> Maybe Text -> AnomalyDateInterval)
-> Lens
AnomalyDateInterval AnomalyDateInterval (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDateInterval' {Maybe Text
endDate :: Maybe Text
$sel:endDate:AnomalyDateInterval' :: AnomalyDateInterval -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: AnomalyDateInterval
s@AnomalyDateInterval' {} Maybe Text
a -> AnomalyDateInterval
s {$sel:endDate:AnomalyDateInterval' :: Maybe Text
endDate = Maybe Text
a} :: AnomalyDateInterval)
anomalyDateInterval_startDate :: Lens.Lens' AnomalyDateInterval Prelude.Text
anomalyDateInterval_startDate :: (Text -> f Text) -> AnomalyDateInterval -> f AnomalyDateInterval
anomalyDateInterval_startDate = (AnomalyDateInterval -> Text)
-> (AnomalyDateInterval -> Text -> AnomalyDateInterval)
-> Lens AnomalyDateInterval AnomalyDateInterval Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDateInterval' {Text
startDate :: Text
$sel:startDate:AnomalyDateInterval' :: AnomalyDateInterval -> Text
startDate} -> Text
startDate) (\s :: AnomalyDateInterval
s@AnomalyDateInterval' {} Text
a -> AnomalyDateInterval
s {$sel:startDate:AnomalyDateInterval' :: Text
startDate = Text
a} :: AnomalyDateInterval)
instance Prelude.Hashable AnomalyDateInterval
instance Prelude.NFData AnomalyDateInterval
instance Core.ToJSON AnomalyDateInterval where
toJSON :: AnomalyDateInterval -> Value
toJSON AnomalyDateInterval' {Maybe Text
Text
startDate :: Text
endDate :: Maybe Text
$sel:startDate:AnomalyDateInterval' :: AnomalyDateInterval -> Text
$sel:endDate:AnomalyDateInterval' :: AnomalyDateInterval -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EndDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
endDate,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StartDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
startDate)
]
)