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