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