{-# 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.SSM.Types.ResourceDataSyncAwsOrganizationsSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.ResourceDataSyncOrganizationalUnit
data ResourceDataSyncAwsOrganizationsSource = ResourceDataSyncAwsOrganizationsSource'
{
ResourceDataSyncAwsOrganizationsSource
-> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits :: Prelude.Maybe (Prelude.NonEmpty ResourceDataSyncOrganizationalUnit),
ResourceDataSyncAwsOrganizationsSource -> Text
organizationSourceType :: Prelude.Text
}
deriving (ResourceDataSyncAwsOrganizationsSource
-> ResourceDataSyncAwsOrganizationsSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDataSyncAwsOrganizationsSource
-> ResourceDataSyncAwsOrganizationsSource -> Bool
$c/= :: ResourceDataSyncAwsOrganizationsSource
-> ResourceDataSyncAwsOrganizationsSource -> Bool
== :: ResourceDataSyncAwsOrganizationsSource
-> ResourceDataSyncAwsOrganizationsSource -> Bool
$c== :: ResourceDataSyncAwsOrganizationsSource
-> ResourceDataSyncAwsOrganizationsSource -> Bool
Prelude.Eq, ReadPrec [ResourceDataSyncAwsOrganizationsSource]
ReadPrec ResourceDataSyncAwsOrganizationsSource
Int -> ReadS ResourceDataSyncAwsOrganizationsSource
ReadS [ResourceDataSyncAwsOrganizationsSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceDataSyncAwsOrganizationsSource]
$creadListPrec :: ReadPrec [ResourceDataSyncAwsOrganizationsSource]
readPrec :: ReadPrec ResourceDataSyncAwsOrganizationsSource
$creadPrec :: ReadPrec ResourceDataSyncAwsOrganizationsSource
readList :: ReadS [ResourceDataSyncAwsOrganizationsSource]
$creadList :: ReadS [ResourceDataSyncAwsOrganizationsSource]
readsPrec :: Int -> ReadS ResourceDataSyncAwsOrganizationsSource
$creadsPrec :: Int -> ReadS ResourceDataSyncAwsOrganizationsSource
Prelude.Read, Int -> ResourceDataSyncAwsOrganizationsSource -> ShowS
[ResourceDataSyncAwsOrganizationsSource] -> ShowS
ResourceDataSyncAwsOrganizationsSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDataSyncAwsOrganizationsSource] -> ShowS
$cshowList :: [ResourceDataSyncAwsOrganizationsSource] -> ShowS
show :: ResourceDataSyncAwsOrganizationsSource -> String
$cshow :: ResourceDataSyncAwsOrganizationsSource -> String
showsPrec :: Int -> ResourceDataSyncAwsOrganizationsSource -> ShowS
$cshowsPrec :: Int -> ResourceDataSyncAwsOrganizationsSource -> ShowS
Prelude.Show, forall x.
Rep ResourceDataSyncAwsOrganizationsSource x
-> ResourceDataSyncAwsOrganizationsSource
forall x.
ResourceDataSyncAwsOrganizationsSource
-> Rep ResourceDataSyncAwsOrganizationsSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourceDataSyncAwsOrganizationsSource x
-> ResourceDataSyncAwsOrganizationsSource
$cfrom :: forall x.
ResourceDataSyncAwsOrganizationsSource
-> Rep ResourceDataSyncAwsOrganizationsSource x
Prelude.Generic)
newResourceDataSyncAwsOrganizationsSource ::
Prelude.Text ->
ResourceDataSyncAwsOrganizationsSource
newResourceDataSyncAwsOrganizationsSource :: Text -> ResourceDataSyncAwsOrganizationsSource
newResourceDataSyncAwsOrganizationsSource
Text
pOrganizationSourceType_ =
ResourceDataSyncAwsOrganizationsSource'
{ $sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits =
forall a. Maybe a
Prelude.Nothing,
$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: Text
organizationSourceType =
Text
pOrganizationSourceType_
}
resourceDataSyncAwsOrganizationsSource_organizationalUnits :: Lens.Lens' ResourceDataSyncAwsOrganizationsSource (Prelude.Maybe (Prelude.NonEmpty ResourceDataSyncOrganizationalUnit))
resourceDataSyncAwsOrganizationsSource_organizationalUnits :: Lens'
ResourceDataSyncAwsOrganizationsSource
(Maybe (NonEmpty ResourceDataSyncOrganizationalUnit))
resourceDataSyncAwsOrganizationsSource_organizationalUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncAwsOrganizationsSource' {Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
$sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource
-> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits} -> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits) (\s :: ResourceDataSyncAwsOrganizationsSource
s@ResourceDataSyncAwsOrganizationsSource' {} Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
a -> ResourceDataSyncAwsOrganizationsSource
s {$sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits = Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
a} :: ResourceDataSyncAwsOrganizationsSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
resourceDataSyncAwsOrganizationsSource_organizationSourceType :: Lens.Lens' ResourceDataSyncAwsOrganizationsSource Prelude.Text
resourceDataSyncAwsOrganizationsSource_organizationSourceType :: Lens' ResourceDataSyncAwsOrganizationsSource Text
resourceDataSyncAwsOrganizationsSource_organizationSourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncAwsOrganizationsSource' {Text
organizationSourceType :: Text
$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource -> Text
organizationSourceType} -> Text
organizationSourceType) (\s :: ResourceDataSyncAwsOrganizationsSource
s@ResourceDataSyncAwsOrganizationsSource' {} Text
a -> ResourceDataSyncAwsOrganizationsSource
s {$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: Text
organizationSourceType = Text
a} :: ResourceDataSyncAwsOrganizationsSource)
instance
Data.FromJSON
ResourceDataSyncAwsOrganizationsSource
where
parseJSON :: Value -> Parser ResourceDataSyncAwsOrganizationsSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResourceDataSyncAwsOrganizationsSource"
( \Object
x ->
Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
-> Text -> ResourceDataSyncAwsOrganizationsSource
ResourceDataSyncAwsOrganizationsSource'
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
"OrganizationalUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OrganizationSourceType")
)
instance
Prelude.Hashable
ResourceDataSyncAwsOrganizationsSource
where
hashWithSalt :: Int -> ResourceDataSyncAwsOrganizationsSource -> Int
hashWithSalt
Int
_salt
ResourceDataSyncAwsOrganizationsSource' {Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
Text
organizationSourceType :: Text
organizationalUnits :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource -> Text
$sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource
-> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationSourceType
instance
Prelude.NFData
ResourceDataSyncAwsOrganizationsSource
where
rnf :: ResourceDataSyncAwsOrganizationsSource -> ()
rnf ResourceDataSyncAwsOrganizationsSource' {Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
Text
organizationSourceType :: Text
organizationalUnits :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource -> Text
$sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource
-> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationSourceType
instance
Data.ToJSON
ResourceDataSyncAwsOrganizationsSource
where
toJSON :: ResourceDataSyncAwsOrganizationsSource -> Value
toJSON ResourceDataSyncAwsOrganizationsSource' {Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
Text
organizationSourceType :: Text
organizationalUnits :: Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
$sel:organizationSourceType:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource -> Text
$sel:organizationalUnits:ResourceDataSyncAwsOrganizationsSource' :: ResourceDataSyncAwsOrganizationsSource
-> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"OrganizationalUnits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourceDataSyncOrganizationalUnit)
organizationalUnits,
forall a. a -> Maybe a
Prelude.Just
( Key
"OrganizationSourceType"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationSourceType
)
]
)