{-# 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.Nimble.Types.Eula where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Eula = Eula'
{
Eula -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Eula -> Maybe Text
eulaId :: Prelude.Maybe Prelude.Text,
Eula -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
Eula -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Eula -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX
}
deriving (Eula -> Eula -> Bool
(Eula -> Eula -> Bool) -> (Eula -> Eula -> Bool) -> Eq Eula
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Eula -> Eula -> Bool
$c/= :: Eula -> Eula -> Bool
== :: Eula -> Eula -> Bool
$c== :: Eula -> Eula -> Bool
Prelude.Eq, ReadPrec [Eula]
ReadPrec Eula
Int -> ReadS Eula
ReadS [Eula]
(Int -> ReadS Eula)
-> ReadS [Eula] -> ReadPrec Eula -> ReadPrec [Eula] -> Read Eula
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Eula]
$creadListPrec :: ReadPrec [Eula]
readPrec :: ReadPrec Eula
$creadPrec :: ReadPrec Eula
readList :: ReadS [Eula]
$creadList :: ReadS [Eula]
readsPrec :: Int -> ReadS Eula
$creadsPrec :: Int -> ReadS Eula
Prelude.Read, Int -> Eula -> ShowS
[Eula] -> ShowS
Eula -> String
(Int -> Eula -> ShowS)
-> (Eula -> String) -> ([Eula] -> ShowS) -> Show Eula
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Eula] -> ShowS
$cshowList :: [Eula] -> ShowS
show :: Eula -> String
$cshow :: Eula -> String
showsPrec :: Int -> Eula -> ShowS
$cshowsPrec :: Int -> Eula -> ShowS
Prelude.Show, (forall x. Eula -> Rep Eula x)
-> (forall x. Rep Eula x -> Eula) -> Generic Eula
forall x. Rep Eula x -> Eula
forall x. Eula -> Rep Eula x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Eula x -> Eula
$cfrom :: forall x. Eula -> Rep Eula x
Prelude.Generic)
newEula ::
Eula
newEula :: Eula
newEula =
Eula' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe POSIX -> Eula
Eula'
{ $sel:createdAt:Eula' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:eulaId:Eula' :: Maybe Text
eulaId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:content:Eula' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Eula' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:updatedAt:Eula' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
eula_createdAt :: Lens.Lens' Eula (Prelude.Maybe Prelude.UTCTime)
eula_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Eula -> f Eula
eula_createdAt = (Eula -> Maybe POSIX)
-> (Eula -> Maybe POSIX -> Eula)
-> Lens Eula Eula (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Eula' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Eula' :: Eula -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Eula
s@Eula' {} Maybe POSIX
a -> Eula
s {$sel:createdAt:Eula' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Eula) ((Maybe POSIX -> f (Maybe POSIX)) -> Eula -> f Eula)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Eula
-> f Eula
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
eula_eulaId :: Lens.Lens' Eula (Prelude.Maybe Prelude.Text)
eula_eulaId :: (Maybe Text -> f (Maybe Text)) -> Eula -> f Eula
eula_eulaId = (Eula -> Maybe Text)
-> (Eula -> Maybe Text -> Eula)
-> Lens Eula Eula (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Eula' {Maybe Text
eulaId :: Maybe Text
$sel:eulaId:Eula' :: Eula -> Maybe Text
eulaId} -> Maybe Text
eulaId) (\s :: Eula
s@Eula' {} Maybe Text
a -> Eula
s {$sel:eulaId:Eula' :: Maybe Text
eulaId = Maybe Text
a} :: Eula)
eula_content :: Lens.Lens' Eula (Prelude.Maybe Prelude.Text)
eula_content :: (Maybe Text -> f (Maybe Text)) -> Eula -> f Eula
eula_content = (Eula -> Maybe Text)
-> (Eula -> Maybe Text -> Eula)
-> Lens Eula Eula (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Eula' {Maybe Text
content :: Maybe Text
$sel:content:Eula' :: Eula -> Maybe Text
content} -> Maybe Text
content) (\s :: Eula
s@Eula' {} Maybe Text
a -> Eula
s {$sel:content:Eula' :: Maybe Text
content = Maybe Text
a} :: Eula)
eula_name :: Lens.Lens' Eula (Prelude.Maybe Prelude.Text)
eula_name :: (Maybe Text -> f (Maybe Text)) -> Eula -> f Eula
eula_name = (Eula -> Maybe Text)
-> (Eula -> Maybe Text -> Eula)
-> Lens Eula Eula (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Eula' {Maybe Text
name :: Maybe Text
$sel:name:Eula' :: Eula -> Maybe Text
name} -> Maybe Text
name) (\s :: Eula
s@Eula' {} Maybe Text
a -> Eula
s {$sel:name:Eula' :: Maybe Text
name = Maybe Text
a} :: Eula)
eula_updatedAt :: Lens.Lens' Eula (Prelude.Maybe Prelude.UTCTime)
eula_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Eula -> f Eula
eula_updatedAt = (Eula -> Maybe POSIX)
-> (Eula -> Maybe POSIX -> Eula)
-> Lens Eula Eula (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Eula' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:Eula' :: Eula -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: Eula
s@Eula' {} Maybe POSIX
a -> Eula
s {$sel:updatedAt:Eula' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: Eula) ((Maybe POSIX -> f (Maybe POSIX)) -> Eula -> f Eula)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Eula
-> f Eula
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Eula where
parseJSON :: Value -> Parser Eula
parseJSON =
String -> (Object -> Parser Eula) -> Value -> Parser Eula
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Eula"
( \Object
x ->
Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe POSIX -> Eula
Eula'
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe POSIX -> Eula)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe POSIX -> Eula)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe POSIX -> Eula)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> Eula)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eulaId")
Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> Eula)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> Eula)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"content")
Parser (Maybe Text -> Maybe POSIX -> Eula)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Eula)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe POSIX -> Eula) -> Parser (Maybe POSIX) -> Parser Eula
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"updatedAt")
)
instance Prelude.Hashable Eula
instance Prelude.NFData Eula