{-# 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.MacieV2.Types.Invitation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.RelationshipStatus
import qualified Amazonka.Prelude as Prelude
data Invitation = Invitation'
{
Invitation -> Maybe RelationshipStatus
relationshipStatus :: Prelude.Maybe RelationshipStatus,
Invitation -> Maybe POSIX
invitedAt :: Prelude.Maybe Core.POSIX,
Invitation -> Maybe Text
invitationId :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
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 RelationshipStatus
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Invitation
Invitation'
{ $sel:relationshipStatus:Invitation' :: Maybe RelationshipStatus
relationshipStatus = Maybe RelationshipStatus
forall a. Maybe a
Prelude.Nothing,
$sel:invitedAt:Invitation' :: Maybe POSIX
invitedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:invitationId:Invitation' :: Maybe Text
invitationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:Invitation' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
invitation_relationshipStatus :: Lens.Lens' Invitation (Prelude.Maybe RelationshipStatus)
invitation_relationshipStatus :: (Maybe RelationshipStatus -> f (Maybe RelationshipStatus))
-> Invitation -> f Invitation
invitation_relationshipStatus = (Invitation -> Maybe RelationshipStatus)
-> (Invitation -> Maybe RelationshipStatus -> Invitation)
-> Lens
Invitation
Invitation
(Maybe RelationshipStatus)
(Maybe RelationshipStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Invitation' {Maybe RelationshipStatus
relationshipStatus :: Maybe RelationshipStatus
$sel:relationshipStatus:Invitation' :: Invitation -> Maybe RelationshipStatus
relationshipStatus} -> Maybe RelationshipStatus
relationshipStatus) (\s :: Invitation
s@Invitation' {} Maybe RelationshipStatus
a -> Invitation
s {$sel:relationshipStatus:Invitation' :: Maybe RelationshipStatus
relationshipStatus = Maybe RelationshipStatus
a} :: Invitation)
invitation_invitedAt :: Lens.Lens' Invitation (Prelude.Maybe Prelude.UTCTime)
invitation_invitedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Invitation -> f Invitation
invitation_invitedAt = (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
invitedAt :: Maybe POSIX
$sel:invitedAt:Invitation' :: Invitation -> Maybe POSIX
invitedAt} -> Maybe POSIX
invitedAt) (\s :: Invitation
s@Invitation' {} Maybe POSIX
a -> Invitation
s {$sel:invitedAt:Invitation' :: Maybe POSIX
invitedAt = 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_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_accountId :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_accountId :: (Maybe Text -> f (Maybe Text)) -> Invitation -> f Invitation
invitation_accountId = (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
accountId :: Maybe Text
$sel:accountId:Invitation' :: Invitation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Invitation
s@Invitation' {} Maybe Text
a -> Invitation
s {$sel:accountId:Invitation' :: Maybe Text
accountId = Maybe Text
a} :: Invitation)
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 RelationshipStatus
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Invitation
Invitation'
(Maybe RelationshipStatus
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Invitation)
-> Parser (Maybe RelationshipStatus)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Invitation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RelationshipStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"relationshipStatus")
Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Invitation)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> 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
"invitedAt")
Parser (Maybe Text -> Maybe Text -> Invitation)
-> Parser (Maybe Text) -> Parser (Maybe Text -> 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 Text -> Invitation)
-> Parser (Maybe Text) -> Parser 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
"accountId")
)
instance Prelude.Hashable Invitation
instance Prelude.NFData Invitation