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