{-# 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.Master where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Master = Master'
{
Master -> Maybe Text
invitedAt :: Prelude.Maybe Prelude.Text,
Master -> Maybe Text
relationshipStatus :: Prelude.Maybe Prelude.Text,
Master -> Maybe Text
invitationId :: Prelude.Maybe Prelude.Text,
Master -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (Master -> Master -> Bool
(Master -> Master -> Bool)
-> (Master -> Master -> Bool) -> Eq Master
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Master -> Master -> Bool
$c/= :: Master -> Master -> Bool
== :: Master -> Master -> Bool
$c== :: Master -> Master -> Bool
Prelude.Eq, ReadPrec [Master]
ReadPrec Master
Int -> ReadS Master
ReadS [Master]
(Int -> ReadS Master)
-> ReadS [Master]
-> ReadPrec Master
-> ReadPrec [Master]
-> Read Master
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Master]
$creadListPrec :: ReadPrec [Master]
readPrec :: ReadPrec Master
$creadPrec :: ReadPrec Master
readList :: ReadS [Master]
$creadList :: ReadS [Master]
readsPrec :: Int -> ReadS Master
$creadsPrec :: Int -> ReadS Master
Prelude.Read, Int -> Master -> ShowS
[Master] -> ShowS
Master -> String
(Int -> Master -> ShowS)
-> (Master -> String) -> ([Master] -> ShowS) -> Show Master
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Master] -> ShowS
$cshowList :: [Master] -> ShowS
show :: Master -> String
$cshow :: Master -> String
showsPrec :: Int -> Master -> ShowS
$cshowsPrec :: Int -> Master -> ShowS
Prelude.Show, (forall x. Master -> Rep Master x)
-> (forall x. Rep Master x -> Master) -> Generic Master
forall x. Rep Master x -> Master
forall x. Master -> Rep Master x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Master x -> Master
$cfrom :: forall x. Master -> Rep Master x
Prelude.Generic)
newMaster ::
Master
newMaster :: Master
newMaster =
Master' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Master
Master'
{ $sel:invitedAt:Master' :: Maybe Text
invitedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:relationshipStatus:Master' :: Maybe Text
relationshipStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:invitationId:Master' :: Maybe Text
invitationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:Master' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
master_invitedAt :: Lens.Lens' Master (Prelude.Maybe Prelude.Text)
master_invitedAt :: (Maybe Text -> f (Maybe Text)) -> Master -> f Master
master_invitedAt = (Master -> Maybe Text)
-> (Master -> Maybe Text -> Master)
-> Lens Master Master (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Master' {Maybe Text
invitedAt :: Maybe Text
$sel:invitedAt:Master' :: Master -> Maybe Text
invitedAt} -> Maybe Text
invitedAt) (\s :: Master
s@Master' {} Maybe Text
a -> Master
s {$sel:invitedAt:Master' :: Maybe Text
invitedAt = Maybe Text
a} :: Master)
master_relationshipStatus :: Lens.Lens' Master (Prelude.Maybe Prelude.Text)
master_relationshipStatus :: (Maybe Text -> f (Maybe Text)) -> Master -> f Master
master_relationshipStatus = (Master -> Maybe Text)
-> (Master -> Maybe Text -> Master)
-> Lens Master Master (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Master' {Maybe Text
relationshipStatus :: Maybe Text
$sel:relationshipStatus:Master' :: Master -> Maybe Text
relationshipStatus} -> Maybe Text
relationshipStatus) (\s :: Master
s@Master' {} Maybe Text
a -> Master
s {$sel:relationshipStatus:Master' :: Maybe Text
relationshipStatus = Maybe Text
a} :: Master)
master_invitationId :: Lens.Lens' Master (Prelude.Maybe Prelude.Text)
master_invitationId :: (Maybe Text -> f (Maybe Text)) -> Master -> f Master
master_invitationId = (Master -> Maybe Text)
-> (Master -> Maybe Text -> Master)
-> Lens Master Master (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Master' {Maybe Text
invitationId :: Maybe Text
$sel:invitationId:Master' :: Master -> Maybe Text
invitationId} -> Maybe Text
invitationId) (\s :: Master
s@Master' {} Maybe Text
a -> Master
s {$sel:invitationId:Master' :: Maybe Text
invitationId = Maybe Text
a} :: Master)
master_accountId :: Lens.Lens' Master (Prelude.Maybe Prelude.Text)
master_accountId :: (Maybe Text -> f (Maybe Text)) -> Master -> f Master
master_accountId = (Master -> Maybe Text)
-> (Master -> Maybe Text -> Master)
-> Lens Master Master (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Master' {Maybe Text
accountId :: Maybe Text
$sel:accountId:Master' :: Master -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Master
s@Master' {} Maybe Text
a -> Master
s {$sel:accountId:Master' :: Maybe Text
accountId = Maybe Text
a} :: Master)
instance Core.FromJSON Master where
parseJSON :: Value -> Parser Master
parseJSON =
String -> (Object -> Parser Master) -> Value -> Parser Master
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Master"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Master
Master'
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Master)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Master)
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 -> Master)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Master)
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 -> Master)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Master)
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 -> Master)
-> Parser (Maybe Text) -> Parser Master
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 Master
instance Prelude.NFData Master