{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types.InvitationStatus
import Amazonka.ManagedBlockChain.Types.NetworkSummary
import qualified Amazonka.Prelude as Prelude
data Invitation = Invitation'
{
Invitation -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe ISO8601
creationDate :: Prelude.Maybe Data.ISO8601,
Invitation -> Maybe ISO8601
expirationDate :: Prelude.Maybe Data.ISO8601,
Invitation -> Maybe Text
invitationId :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe NetworkSummary
networkSummary :: Prelude.Maybe NetworkSummary,
Invitation -> Maybe InvitationStatus
status :: Prelude.Maybe InvitationStatus
}
deriving (Invitation -> Invitation -> Bool
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]
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
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. 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'
{ $sel:arn:Invitation' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:Invitation' :: Maybe ISO8601
creationDate = forall a. Maybe a
Prelude.Nothing,
$sel:expirationDate:Invitation' :: Maybe ISO8601
expirationDate = forall a. Maybe a
Prelude.Nothing,
$sel:invitationId:Invitation' :: Maybe Text
invitationId = forall a. Maybe a
Prelude.Nothing,
$sel:networkSummary:Invitation' :: Maybe NetworkSummary
networkSummary = forall a. Maybe a
Prelude.Nothing,
$sel:status:Invitation' :: Maybe InvitationStatus
status = forall a. Maybe a
Prelude.Nothing
}
invitation_arn :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_arn :: Lens' Invitation (Maybe Text)
invitation_arn = 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_creationDate :: Lens.Lens' Invitation (Prelude.Maybe Prelude.UTCTime)
invitation_creationDate :: Lens' Invitation (Maybe UTCTime)
invitation_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe ISO8601
creationDate :: Maybe ISO8601
$sel:creationDate:Invitation' :: Invitation -> Maybe ISO8601
creationDate} -> Maybe ISO8601
creationDate) (\s :: Invitation
s@Invitation' {} Maybe ISO8601
a -> Invitation
s {$sel:creationDate:Invitation' :: Maybe ISO8601
creationDate = Maybe ISO8601
a} :: Invitation) 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
invitation_expirationDate :: Lens.Lens' Invitation (Prelude.Maybe Prelude.UTCTime)
invitation_expirationDate :: Lens' Invitation (Maybe UTCTime)
invitation_expirationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe ISO8601
expirationDate :: Maybe ISO8601
$sel:expirationDate:Invitation' :: Invitation -> Maybe ISO8601
expirationDate} -> Maybe ISO8601
expirationDate) (\s :: Invitation
s@Invitation' {} Maybe ISO8601
a -> Invitation
s {$sel:expirationDate:Invitation' :: Maybe ISO8601
expirationDate = Maybe ISO8601
a} :: Invitation) 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
invitation_invitationId :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_invitationId :: Lens' Invitation (Maybe Text)
invitation_invitationId = 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_networkSummary :: Lens.Lens' Invitation (Prelude.Maybe NetworkSummary)
invitation_networkSummary :: Lens' Invitation (Maybe NetworkSummary)
invitation_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_status :: Lens.Lens' Invitation (Prelude.Maybe InvitationStatus)
invitation_status :: Lens' Invitation (Maybe InvitationStatus)
invitation_status = 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)
instance Data.FromJSON Invitation where
parseJSON :: Value -> Parser Invitation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Invitation"
( \Object
x ->
Maybe Text
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe NetworkSummary
-> Maybe InvitationStatus
-> Invitation
Invitation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExpirationDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InvitationId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NetworkSummary")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
)
instance Prelude.Hashable Invitation where
hashWithSalt :: Int -> Invitation -> Int
hashWithSalt Int
_salt Invitation' {Maybe Text
Maybe ISO8601
Maybe InvitationStatus
Maybe NetworkSummary
status :: Maybe InvitationStatus
networkSummary :: Maybe NetworkSummary
invitationId :: Maybe Text
expirationDate :: Maybe ISO8601
creationDate :: Maybe ISO8601
arn :: Maybe Text
$sel:status:Invitation' :: Invitation -> Maybe InvitationStatus
$sel:networkSummary:Invitation' :: Invitation -> Maybe NetworkSummary
$sel:invitationId:Invitation' :: Invitation -> Maybe Text
$sel:expirationDate:Invitation' :: Invitation -> Maybe ISO8601
$sel:creationDate:Invitation' :: Invitation -> Maybe ISO8601
$sel:arn:Invitation' :: Invitation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
expirationDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
invitationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkSummary
networkSummary
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InvitationStatus
status
instance Prelude.NFData Invitation where
rnf :: Invitation -> ()
rnf Invitation' {Maybe Text
Maybe ISO8601
Maybe InvitationStatus
Maybe NetworkSummary
status :: Maybe InvitationStatus
networkSummary :: Maybe NetworkSummary
invitationId :: Maybe Text
expirationDate :: Maybe ISO8601
creationDate :: Maybe ISO8601
arn :: Maybe Text
$sel:status:Invitation' :: Invitation -> Maybe InvitationStatus
$sel:networkSummary:Invitation' :: Invitation -> Maybe NetworkSummary
$sel:invitationId:Invitation' :: Invitation -> Maybe Text
$sel:expirationDate:Invitation' :: Invitation -> Maybe ISO8601
$sel:creationDate:Invitation' :: Invitation -> Maybe ISO8601
$sel:arn:Invitation' :: Invitation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
expirationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invitationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkSummary
networkSummary
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InvitationStatus
status