{-# 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.ManagedBlockChain.Types.Invitation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.InvitationStatus
import Amazonka.ManagedBlockChain.Types.NetworkSummary
import qualified Amazonka.Prelude as Prelude
data Invitation = Invitation'
{
Invitation -> Maybe InvitationStatus
status :: Prelude.Maybe InvitationStatus,
Invitation -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe Text
invitationId :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe POSIX
expirationDate :: Prelude.Maybe Core.POSIX,
Invitation -> Maybe NetworkSummary
networkSummary :: Prelude.Maybe NetworkSummary,
Invitation -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX
}
deriving (Invitation -> Invitation -> Bool
(Invitation -> Invitation -> Bool)
-> (Invitation -> Invitation -> Bool) -> Eq Invitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Invitation -> Invitation -> Bool
$c/= :: Invitation -> Invitation -> Bool
== :: Invitation -> Invitation -> Bool
$c== :: Invitation -> Invitation -> Bool
Prelude.Eq, ReadPrec [Invitation]
ReadPrec Invitation
Int -> ReadS Invitation
ReadS [Invitation]
(Int -> ReadS Invitation)
-> ReadS [Invitation]
-> ReadPrec Invitation
-> ReadPrec [Invitation]
-> Read Invitation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Invitation]
$creadListPrec :: ReadPrec [Invitation]
readPrec :: ReadPrec Invitation
$creadPrec :: ReadPrec Invitation
readList :: ReadS [Invitation]
$creadList :: ReadS [Invitation]
readsPrec :: Int -> ReadS Invitation
$creadsPrec :: Int -> ReadS Invitation
Prelude.Read, Int -> Invitation -> ShowS
[Invitation] -> ShowS
Invitation -> String
(Int -> Invitation -> ShowS)
-> (Invitation -> String)
-> ([Invitation] -> ShowS)
-> Show Invitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Invitation] -> ShowS
$cshowList :: [Invitation] -> ShowS
show :: Invitation -> String
$cshow :: Invitation -> String
showsPrec :: Int -> Invitation -> ShowS
$cshowsPrec :: Int -> Invitation -> ShowS
Prelude.Show, (forall x. Invitation -> Rep Invitation x)
-> (forall x. Rep Invitation x -> Invitation) -> Generic Invitation
forall x. Rep Invitation x -> Invitation
forall x. Invitation -> Rep Invitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Invitation x -> Invitation
$cfrom :: forall x. Invitation -> Rep Invitation x
Prelude.Generic)
newInvitation ::
Invitation
newInvitation :: Invitation
newInvitation =
Invitation' :: Maybe InvitationStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation
Invitation'
{ $sel:status:Invitation' :: Maybe InvitationStatus
status = Maybe InvitationStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Invitation' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:invitationId:Invitation' :: Maybe Text
invitationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expirationDate:Invitation' :: Maybe POSIX
expirationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:networkSummary:Invitation' :: Maybe NetworkSummary
networkSummary = Maybe NetworkSummary
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:Invitation' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
invitation_status :: Lens.Lens' Invitation (Prelude.Maybe InvitationStatus)
invitation_status :: (Maybe InvitationStatus -> f (Maybe InvitationStatus))
-> Invitation -> f Invitation
invitation_status = (Invitation -> Maybe InvitationStatus)
-> (Invitation -> Maybe InvitationStatus -> Invitation)
-> Lens
Invitation
Invitation
(Maybe InvitationStatus)
(Maybe InvitationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe InvitationStatus
status :: Maybe InvitationStatus
$sel:status:Invitation' :: Invitation -> Maybe InvitationStatus
status} -> Maybe InvitationStatus
status) (\s :: Invitation
s@Invitation' {} Maybe InvitationStatus
a -> Invitation
s {$sel:status:Invitation' :: Maybe InvitationStatus
status = Maybe InvitationStatus
a} :: Invitation)
invitation_arn :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_arn :: (Maybe Text -> f (Maybe Text)) -> Invitation -> f Invitation
invitation_arn = (Invitation -> Maybe Text)
-> (Invitation -> Maybe Text -> Invitation)
-> Lens Invitation Invitation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe Text
arn :: Maybe Text
$sel:arn:Invitation' :: Invitation -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Invitation
s@Invitation' {} Maybe Text
a -> Invitation
s {$sel:arn:Invitation' :: Maybe Text
arn = Maybe Text
a} :: Invitation)
invitation_invitationId :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_invitationId :: (Maybe Text -> f (Maybe Text)) -> Invitation -> f Invitation
invitation_invitationId = (Invitation -> Maybe Text)
-> (Invitation -> Maybe Text -> Invitation)
-> Lens Invitation Invitation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe Text
invitationId :: Maybe Text
$sel:invitationId:Invitation' :: Invitation -> Maybe Text
invitationId} -> Maybe Text
invitationId) (\s :: Invitation
s@Invitation' {} Maybe Text
a -> Invitation
s {$sel:invitationId:Invitation' :: Maybe Text
invitationId = Maybe Text
a} :: Invitation)
invitation_expirationDate :: Lens.Lens' Invitation (Prelude.Maybe Prelude.UTCTime)
invitation_expirationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Invitation -> f Invitation
invitation_expirationDate = (Invitation -> Maybe POSIX)
-> (Invitation -> Maybe POSIX -> Invitation)
-> Lens Invitation Invitation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe POSIX
expirationDate :: Maybe POSIX
$sel:expirationDate:Invitation' :: Invitation -> Maybe POSIX
expirationDate} -> Maybe POSIX
expirationDate) (\s :: Invitation
s@Invitation' {} Maybe POSIX
a -> Invitation
s {$sel:expirationDate:Invitation' :: Maybe POSIX
expirationDate = Maybe POSIX
a} :: Invitation) ((Maybe POSIX -> f (Maybe POSIX)) -> Invitation -> f Invitation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Invitation
-> f Invitation
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
invitation_networkSummary :: Lens.Lens' Invitation (Prelude.Maybe NetworkSummary)
invitation_networkSummary :: (Maybe NetworkSummary -> f (Maybe NetworkSummary))
-> Invitation -> f Invitation
invitation_networkSummary = (Invitation -> Maybe NetworkSummary)
-> (Invitation -> Maybe NetworkSummary -> Invitation)
-> Lens
Invitation Invitation (Maybe NetworkSummary) (Maybe NetworkSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe NetworkSummary
networkSummary :: Maybe NetworkSummary
$sel:networkSummary:Invitation' :: Invitation -> Maybe NetworkSummary
networkSummary} -> Maybe NetworkSummary
networkSummary) (\s :: Invitation
s@Invitation' {} Maybe NetworkSummary
a -> Invitation
s {$sel:networkSummary:Invitation' :: Maybe NetworkSummary
networkSummary = Maybe NetworkSummary
a} :: Invitation)
invitation_creationDate :: Lens.Lens' Invitation (Prelude.Maybe Prelude.UTCTime)
invitation_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Invitation -> f Invitation
invitation_creationDate = (Invitation -> Maybe POSIX)
-> (Invitation -> Maybe POSIX -> Invitation)
-> Lens Invitation Invitation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:Invitation' :: Invitation -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: Invitation
s@Invitation' {} Maybe POSIX
a -> Invitation
s {$sel:creationDate:Invitation' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: Invitation) ((Maybe POSIX -> f (Maybe POSIX)) -> Invitation -> f Invitation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Invitation
-> f Invitation
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 Invitation where
parseJSON :: Value -> Parser Invitation
parseJSON =
String
-> (Object -> Parser Invitation) -> Value -> Parser Invitation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Invitation"
( \Object
x ->
Maybe InvitationStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation
Invitation'
(Maybe InvitationStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation)
-> Parser (Maybe InvitationStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InvitationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation)
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
"Arn")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe NetworkSummary
-> Maybe POSIX
-> Invitation)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX -> Maybe NetworkSummary -> Maybe POSIX -> Invitation)
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
"InvitationId")
Parser
(Maybe POSIX -> Maybe NetworkSummary -> Maybe POSIX -> Invitation)
-> Parser (Maybe POSIX)
-> Parser (Maybe NetworkSummary -> Maybe POSIX -> Invitation)
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
"ExpirationDate")
Parser (Maybe NetworkSummary -> Maybe POSIX -> Invitation)
-> Parser (Maybe NetworkSummary)
-> Parser (Maybe POSIX -> Invitation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NetworkSummary")
Parser (Maybe POSIX -> Invitation)
-> Parser (Maybe POSIX) -> Parser Invitation
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
"CreationDate")
)
instance Prelude.Hashable Invitation
instance Prelude.NFData Invitation