{-# 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.GuardDuty.Types.Invitation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Invitation = Invitation'
{
Invitation -> Maybe Text
invitedAt :: Prelude.Maybe Prelude.Text,
Invitation -> Maybe Text
relationshipStatus :: Prelude.Maybe Prelude.Text,
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 Text -> Maybe Text -> Maybe Text -> Maybe Text -> Invitation
Invitation'
{ $sel:invitedAt:Invitation' :: Maybe Text
invitedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:relationshipStatus:Invitation' :: Maybe Text
relationshipStatus = Maybe Text
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_invitedAt :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_invitedAt :: (Maybe Text -> f (Maybe Text)) -> Invitation -> f Invitation
invitation_invitedAt = (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
invitedAt :: Maybe Text
$sel:invitedAt:Invitation' :: Invitation -> Maybe Text
invitedAt} -> Maybe Text
invitedAt) (\s :: Invitation
s@Invitation' {} Maybe Text
a -> Invitation
s {$sel:invitedAt:Invitation' :: Maybe Text
invitedAt = Maybe Text
a} :: Invitation)
invitation_relationshipStatus :: Lens.Lens' Invitation (Prelude.Maybe Prelude.Text)
invitation_relationshipStatus :: (Maybe Text -> f (Maybe Text)) -> Invitation -> f Invitation
invitation_relationshipStatus = (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
relationshipStatus :: Maybe Text
$sel:relationshipStatus:Invitation' :: Invitation -> Maybe Text
relationshipStatus} -> Maybe Text
relationshipStatus) (\s :: Invitation
s@Invitation' {} Maybe Text
a -> Invitation
s {$sel:relationshipStatus:Invitation' :: Maybe Text
relationshipStatus = 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_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 Text -> Maybe Text -> Maybe Text -> Maybe Text -> Invitation
Invitation'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Invitation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Invitation)
forall (f :: * -> *) a b. Functor 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
"invitedAt")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Invitation)
-> Parser (Maybe Text)
-> 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 Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"relationshipStatus")
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