{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSM.Types.ResourceDataSyncSourceWithState
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSM.Types.ResourceDataSyncSourceWithState where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.ResourceDataSyncAwsOrganizationsSource

-- | The data type name for including resource data sync state. There are
-- four sync states:
--
-- @OrganizationNotExists@ (Your organization doesn\'t exist)
--
-- @NoPermissions@ (The system can\'t locate the service-linked role. This
-- role is automatically created when a user creates a resource data sync
-- in Amazon Web Services Systems Manager Explorer.)
--
-- @InvalidOrganizationalUnit@ (You specified or selected an invalid unit
-- in the resource data sync configuration.)
--
-- @TrustedAccessDisabled@ (You disabled Systems Manager access in the
-- organization in Organizations.)
--
-- /See:/ 'newResourceDataSyncSourceWithState' smart constructor.
data ResourceDataSyncSourceWithState = ResourceDataSyncSourceWithState'
  { -- | The data type name for including resource data sync state. There are
    -- four sync states:
    --
    -- @OrganizationNotExists@: Your organization doesn\'t exist.
    --
    -- @NoPermissions@: The system can\'t locate the service-linked role. This
    -- role is automatically created when a user creates a resource data sync
    -- in Explorer.
    --
    -- @InvalidOrganizationalUnit@: You specified or selected an invalid unit
    -- in the resource data sync configuration.
    --
    -- @TrustedAccessDisabled@: You disabled Systems Manager access in the
    -- organization in Organizations.
    ResourceDataSyncSourceWithState -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | When you create a resource data sync, if you choose one of the
    -- Organizations options, then Systems Manager automatically enables all
    -- OpsData sources in the selected Amazon Web Services Regions for all
    -- Amazon Web Services accounts in your organization (or in the selected
    -- organization units). For more information, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html About multiple account and Region resource data syncs>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    ResourceDataSyncSourceWithState -> Maybe Bool
enableAllOpsDataSources :: Prelude.Maybe Prelude.Bool,
    -- | Whether to automatically synchronize and aggregate data from new Amazon
    -- Web Services Regions when those Regions come online.
    ResourceDataSyncSourceWithState -> Maybe Bool
includeFutureRegions :: Prelude.Maybe Prelude.Bool,
    -- | The type of data source for the resource data sync. @SourceType@ is
    -- either @AwsOrganizations@ (if an organization is present in
    -- Organizations) or @singleAccountMultiRegions@.
    ResourceDataSyncSourceWithState -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
    -- | The field name in @SyncSource@ for the
    -- @ResourceDataSyncAwsOrganizationsSource@ type.
    ResourceDataSyncSourceWithState
-> Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource :: Prelude.Maybe ResourceDataSyncAwsOrganizationsSource,
    -- | The @SyncSource@ Amazon Web Services Regions included in the resource
    -- data sync.
    ResourceDataSyncSourceWithState -> Maybe [Text]
sourceRegions :: Prelude.Maybe [Prelude.Text]
  }
  deriving (ResourceDataSyncSourceWithState
-> ResourceDataSyncSourceWithState -> Bool
(ResourceDataSyncSourceWithState
 -> ResourceDataSyncSourceWithState -> Bool)
-> (ResourceDataSyncSourceWithState
    -> ResourceDataSyncSourceWithState -> Bool)
-> Eq ResourceDataSyncSourceWithState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDataSyncSourceWithState
-> ResourceDataSyncSourceWithState -> Bool
$c/= :: ResourceDataSyncSourceWithState
-> ResourceDataSyncSourceWithState -> Bool
== :: ResourceDataSyncSourceWithState
-> ResourceDataSyncSourceWithState -> Bool
$c== :: ResourceDataSyncSourceWithState
-> ResourceDataSyncSourceWithState -> Bool
Prelude.Eq, ReadPrec [ResourceDataSyncSourceWithState]
ReadPrec ResourceDataSyncSourceWithState
Int -> ReadS ResourceDataSyncSourceWithState
ReadS [ResourceDataSyncSourceWithState]
(Int -> ReadS ResourceDataSyncSourceWithState)
-> ReadS [ResourceDataSyncSourceWithState]
-> ReadPrec ResourceDataSyncSourceWithState
-> ReadPrec [ResourceDataSyncSourceWithState]
-> Read ResourceDataSyncSourceWithState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceDataSyncSourceWithState]
$creadListPrec :: ReadPrec [ResourceDataSyncSourceWithState]
readPrec :: ReadPrec ResourceDataSyncSourceWithState
$creadPrec :: ReadPrec ResourceDataSyncSourceWithState
readList :: ReadS [ResourceDataSyncSourceWithState]
$creadList :: ReadS [ResourceDataSyncSourceWithState]
readsPrec :: Int -> ReadS ResourceDataSyncSourceWithState
$creadsPrec :: Int -> ReadS ResourceDataSyncSourceWithState
Prelude.Read, Int -> ResourceDataSyncSourceWithState -> ShowS
[ResourceDataSyncSourceWithState] -> ShowS
ResourceDataSyncSourceWithState -> String
(Int -> ResourceDataSyncSourceWithState -> ShowS)
-> (ResourceDataSyncSourceWithState -> String)
-> ([ResourceDataSyncSourceWithState] -> ShowS)
-> Show ResourceDataSyncSourceWithState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDataSyncSourceWithState] -> ShowS
$cshowList :: [ResourceDataSyncSourceWithState] -> ShowS
show :: ResourceDataSyncSourceWithState -> String
$cshow :: ResourceDataSyncSourceWithState -> String
showsPrec :: Int -> ResourceDataSyncSourceWithState -> ShowS
$cshowsPrec :: Int -> ResourceDataSyncSourceWithState -> ShowS
Prelude.Show, (forall x.
 ResourceDataSyncSourceWithState
 -> Rep ResourceDataSyncSourceWithState x)
-> (forall x.
    Rep ResourceDataSyncSourceWithState x
    -> ResourceDataSyncSourceWithState)
-> Generic ResourceDataSyncSourceWithState
forall x.
Rep ResourceDataSyncSourceWithState x
-> ResourceDataSyncSourceWithState
forall x.
ResourceDataSyncSourceWithState
-> Rep ResourceDataSyncSourceWithState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourceDataSyncSourceWithState x
-> ResourceDataSyncSourceWithState
$cfrom :: forall x.
ResourceDataSyncSourceWithState
-> Rep ResourceDataSyncSourceWithState x
Prelude.Generic)

-- |
-- Create a value of 'ResourceDataSyncSourceWithState' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'state', 'resourceDataSyncSourceWithState_state' - The data type name for including resource data sync state. There are
-- four sync states:
--
-- @OrganizationNotExists@: Your organization doesn\'t exist.
--
-- @NoPermissions@: The system can\'t locate the service-linked role. This
-- role is automatically created when a user creates a resource data sync
-- in Explorer.
--
-- @InvalidOrganizationalUnit@: You specified or selected an invalid unit
-- in the resource data sync configuration.
--
-- @TrustedAccessDisabled@: You disabled Systems Manager access in the
-- organization in Organizations.
--
-- 'enableAllOpsDataSources', 'resourceDataSyncSourceWithState_enableAllOpsDataSources' - When you create a resource data sync, if you choose one of the
-- Organizations options, then Systems Manager automatically enables all
-- OpsData sources in the selected Amazon Web Services Regions for all
-- Amazon Web Services accounts in your organization (or in the selected
-- organization units). For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html About multiple account and Region resource data syncs>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'includeFutureRegions', 'resourceDataSyncSourceWithState_includeFutureRegions' - Whether to automatically synchronize and aggregate data from new Amazon
-- Web Services Regions when those Regions come online.
--
-- 'sourceType', 'resourceDataSyncSourceWithState_sourceType' - The type of data source for the resource data sync. @SourceType@ is
-- either @AwsOrganizations@ (if an organization is present in
-- Organizations) or @singleAccountMultiRegions@.
--
-- 'awsOrganizationsSource', 'resourceDataSyncSourceWithState_awsOrganizationsSource' - The field name in @SyncSource@ for the
-- @ResourceDataSyncAwsOrganizationsSource@ type.
--
-- 'sourceRegions', 'resourceDataSyncSourceWithState_sourceRegions' - The @SyncSource@ Amazon Web Services Regions included in the resource
-- data sync.
newResourceDataSyncSourceWithState ::
  ResourceDataSyncSourceWithState
newResourceDataSyncSourceWithState :: ResourceDataSyncSourceWithState
newResourceDataSyncSourceWithState =
  ResourceDataSyncSourceWithState' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe ResourceDataSyncAwsOrganizationsSource
-> Maybe [Text]
-> ResourceDataSyncSourceWithState
ResourceDataSyncSourceWithState'
    { $sel:state:ResourceDataSyncSourceWithState' :: Maybe Text
state =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableAllOpsDataSources:ResourceDataSyncSourceWithState' :: Maybe Bool
enableAllOpsDataSources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:includeFutureRegions:ResourceDataSyncSourceWithState' :: Maybe Bool
includeFutureRegions = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:ResourceDataSyncSourceWithState' :: Maybe Text
sourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsOrganizationsSource:ResourceDataSyncSourceWithState' :: Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource = Maybe ResourceDataSyncAwsOrganizationsSource
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceRegions:ResourceDataSyncSourceWithState' :: Maybe [Text]
sourceRegions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The data type name for including resource data sync state. There are
-- four sync states:
--
-- @OrganizationNotExists@: Your organization doesn\'t exist.
--
-- @NoPermissions@: The system can\'t locate the service-linked role. This
-- role is automatically created when a user creates a resource data sync
-- in Explorer.
--
-- @InvalidOrganizationalUnit@: You specified or selected an invalid unit
-- in the resource data sync configuration.
--
-- @TrustedAccessDisabled@: You disabled Systems Manager access in the
-- organization in Organizations.
resourceDataSyncSourceWithState_state :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe Prelude.Text)
resourceDataSyncSourceWithState_state :: (Maybe Text -> f (Maybe Text))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_state = (ResourceDataSyncSourceWithState -> Maybe Text)
-> (ResourceDataSyncSourceWithState
    -> Maybe Text -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe Text
state :: Maybe Text
$sel:state:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState -> Maybe Text
state} -> Maybe Text
state) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe Text
a -> ResourceDataSyncSourceWithState
s {$sel:state:ResourceDataSyncSourceWithState' :: Maybe Text
state = Maybe Text
a} :: ResourceDataSyncSourceWithState)

-- | When you create a resource data sync, if you choose one of the
-- Organizations options, then Systems Manager automatically enables all
-- OpsData sources in the selected Amazon Web Services Regions for all
-- Amazon Web Services accounts in your organization (or in the selected
-- organization units). For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html About multiple account and Region resource data syncs>
-- in the /Amazon Web Services Systems Manager User Guide/.
resourceDataSyncSourceWithState_enableAllOpsDataSources :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe Prelude.Bool)
resourceDataSyncSourceWithState_enableAllOpsDataSources :: (Maybe Bool -> f (Maybe Bool))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_enableAllOpsDataSources = (ResourceDataSyncSourceWithState -> Maybe Bool)
-> (ResourceDataSyncSourceWithState
    -> Maybe Bool -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe Bool
enableAllOpsDataSources :: Maybe Bool
$sel:enableAllOpsDataSources:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState -> Maybe Bool
enableAllOpsDataSources} -> Maybe Bool
enableAllOpsDataSources) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe Bool
a -> ResourceDataSyncSourceWithState
s {$sel:enableAllOpsDataSources:ResourceDataSyncSourceWithState' :: Maybe Bool
enableAllOpsDataSources = Maybe Bool
a} :: ResourceDataSyncSourceWithState)

-- | Whether to automatically synchronize and aggregate data from new Amazon
-- Web Services Regions when those Regions come online.
resourceDataSyncSourceWithState_includeFutureRegions :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe Prelude.Bool)
resourceDataSyncSourceWithState_includeFutureRegions :: (Maybe Bool -> f (Maybe Bool))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_includeFutureRegions = (ResourceDataSyncSourceWithState -> Maybe Bool)
-> (ResourceDataSyncSourceWithState
    -> Maybe Bool -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe Bool
includeFutureRegions :: Maybe Bool
$sel:includeFutureRegions:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState -> Maybe Bool
includeFutureRegions} -> Maybe Bool
includeFutureRegions) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe Bool
a -> ResourceDataSyncSourceWithState
s {$sel:includeFutureRegions:ResourceDataSyncSourceWithState' :: Maybe Bool
includeFutureRegions = Maybe Bool
a} :: ResourceDataSyncSourceWithState)

-- | The type of data source for the resource data sync. @SourceType@ is
-- either @AwsOrganizations@ (if an organization is present in
-- Organizations) or @singleAccountMultiRegions@.
resourceDataSyncSourceWithState_sourceType :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe Prelude.Text)
resourceDataSyncSourceWithState_sourceType :: (Maybe Text -> f (Maybe Text))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_sourceType = (ResourceDataSyncSourceWithState -> Maybe Text)
-> (ResourceDataSyncSourceWithState
    -> Maybe Text -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe Text
a -> ResourceDataSyncSourceWithState
s {$sel:sourceType:ResourceDataSyncSourceWithState' :: Maybe Text
sourceType = Maybe Text
a} :: ResourceDataSyncSourceWithState)

-- | The field name in @SyncSource@ for the
-- @ResourceDataSyncAwsOrganizationsSource@ type.
resourceDataSyncSourceWithState_awsOrganizationsSource :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe ResourceDataSyncAwsOrganizationsSource)
resourceDataSyncSourceWithState_awsOrganizationsSource :: (Maybe ResourceDataSyncAwsOrganizationsSource
 -> f (Maybe ResourceDataSyncAwsOrganizationsSource))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_awsOrganizationsSource = (ResourceDataSyncSourceWithState
 -> Maybe ResourceDataSyncAwsOrganizationsSource)
-> (ResourceDataSyncSourceWithState
    -> Maybe ResourceDataSyncAwsOrganizationsSource
    -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe ResourceDataSyncAwsOrganizationsSource)
     (Maybe ResourceDataSyncAwsOrganizationsSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource :: Maybe ResourceDataSyncAwsOrganizationsSource
$sel:awsOrganizationsSource:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState
-> Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource} -> Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe ResourceDataSyncAwsOrganizationsSource
a -> ResourceDataSyncSourceWithState
s {$sel:awsOrganizationsSource:ResourceDataSyncSourceWithState' :: Maybe ResourceDataSyncAwsOrganizationsSource
awsOrganizationsSource = Maybe ResourceDataSyncAwsOrganizationsSource
a} :: ResourceDataSyncSourceWithState)

-- | The @SyncSource@ Amazon Web Services Regions included in the resource
-- data sync.
resourceDataSyncSourceWithState_sourceRegions :: Lens.Lens' ResourceDataSyncSourceWithState (Prelude.Maybe [Prelude.Text])
resourceDataSyncSourceWithState_sourceRegions :: (Maybe [Text] -> f (Maybe [Text]))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
resourceDataSyncSourceWithState_sourceRegions = (ResourceDataSyncSourceWithState -> Maybe [Text])
-> (ResourceDataSyncSourceWithState
    -> Maybe [Text] -> ResourceDataSyncSourceWithState)
-> Lens
     ResourceDataSyncSourceWithState
     ResourceDataSyncSourceWithState
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncSourceWithState' {Maybe [Text]
sourceRegions :: Maybe [Text]
$sel:sourceRegions:ResourceDataSyncSourceWithState' :: ResourceDataSyncSourceWithState -> Maybe [Text]
sourceRegions} -> Maybe [Text]
sourceRegions) (\s :: ResourceDataSyncSourceWithState
s@ResourceDataSyncSourceWithState' {} Maybe [Text]
a -> ResourceDataSyncSourceWithState
s {$sel:sourceRegions:ResourceDataSyncSourceWithState' :: Maybe [Text]
sourceRegions = Maybe [Text]
a} :: ResourceDataSyncSourceWithState) ((Maybe [Text] -> f (Maybe [Text]))
 -> ResourceDataSyncSourceWithState
 -> f ResourceDataSyncSourceWithState)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ResourceDataSyncSourceWithState
-> f ResourceDataSyncSourceWithState
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    ResourceDataSyncSourceWithState
  where
  parseJSON :: Value -> Parser ResourceDataSyncSourceWithState
parseJSON =
    String
-> (Object -> Parser ResourceDataSyncSourceWithState)
-> Value
-> Parser ResourceDataSyncSourceWithState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceDataSyncSourceWithState"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe ResourceDataSyncAwsOrganizationsSource
-> Maybe [Text]
-> ResourceDataSyncSourceWithState
ResourceDataSyncSourceWithState'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe ResourceDataSyncAwsOrganizationsSource
 -> Maybe [Text]
 -> ResourceDataSyncSourceWithState)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ResourceDataSyncAwsOrganizationsSource
      -> Maybe [Text]
      -> ResourceDataSyncSourceWithState)
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
"State")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ResourceDataSyncAwsOrganizationsSource
   -> Maybe [Text]
   -> ResourceDataSyncSourceWithState)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe ResourceDataSyncAwsOrganizationsSource
      -> Maybe [Text]
      -> ResourceDataSyncSourceWithState)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnableAllOpsDataSources")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe ResourceDataSyncAwsOrganizationsSource
   -> Maybe [Text]
   -> ResourceDataSyncSourceWithState)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe ResourceDataSyncAwsOrganizationsSource
      -> Maybe [Text]
      -> ResourceDataSyncSourceWithState)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeFutureRegions")
            Parser
  (Maybe Text
   -> Maybe ResourceDataSyncAwsOrganizationsSource
   -> Maybe [Text]
   -> ResourceDataSyncSourceWithState)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceDataSyncAwsOrganizationsSource
      -> Maybe [Text] -> ResourceDataSyncSourceWithState)
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
"SourceType")
            Parser
  (Maybe ResourceDataSyncAwsOrganizationsSource
   -> Maybe [Text] -> ResourceDataSyncSourceWithState)
-> Parser (Maybe ResourceDataSyncAwsOrganizationsSource)
-> Parser (Maybe [Text] -> ResourceDataSyncSourceWithState)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ResourceDataSyncAwsOrganizationsSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AwsOrganizationsSource")
            Parser (Maybe [Text] -> ResourceDataSyncSourceWithState)
-> Parser (Maybe [Text]) -> Parser ResourceDataSyncSourceWithState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceRegions" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    ResourceDataSyncSourceWithState

instance
  Prelude.NFData
    ResourceDataSyncSourceWithState