{-# 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.ResourceDataSyncItem
-- 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.ResourceDataSyncItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.LastResourceDataSyncStatus
import Amazonka.SSM.Types.ResourceDataSyncS3Destination
import Amazonka.SSM.Types.ResourceDataSyncSourceWithState

-- | Information about a resource data sync configuration, including its
-- current status and last successful sync.
--
-- /See:/ 'newResourceDataSyncItem' smart constructor.
data ResourceDataSyncItem = ResourceDataSyncItem'
  { -- | The type of resource data sync. If @SyncType@ is @SyncToDestination@,
    -- then the resource data sync synchronizes data to an S3 bucket. If the
    -- @SyncType@ is @SyncFromSource@ then the resource data sync synchronizes
    -- data from Organizations or from multiple Amazon Web Services Regions.
    ResourceDataSyncItem -> Maybe Text
syncType :: Prelude.Maybe Prelude.Text,
    -- | Information about the source where the data was synchronized.
    ResourceDataSyncItem -> Maybe ResourceDataSyncSourceWithState
syncSource :: Prelude.Maybe ResourceDataSyncSourceWithState,
    -- | The status message details reported by the last sync.
    ResourceDataSyncItem -> Maybe Text
lastSyncStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The date and time the configuration was created (UTC).
    ResourceDataSyncItem -> Maybe POSIX
syncCreatedTime :: Prelude.Maybe Core.POSIX,
    -- | The last time the configuration attempted to sync (UTC).
    ResourceDataSyncItem -> Maybe POSIX
lastSyncTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the resource data sync.
    ResourceDataSyncItem -> Maybe Text
syncName :: Prelude.Maybe Prelude.Text,
    -- | The status reported by the last sync.
    ResourceDataSyncItem -> Maybe LastResourceDataSyncStatus
lastStatus :: Prelude.Maybe LastResourceDataSyncStatus,
    -- | The date and time the resource data sync was changed.
    ResourceDataSyncItem -> Maybe POSIX
syncLastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | Configuration information for the target S3 bucket.
    ResourceDataSyncItem -> Maybe ResourceDataSyncS3Destination
s3Destination :: Prelude.Maybe ResourceDataSyncS3Destination,
    -- | The last time the sync operations returned a status of @SUCCESSFUL@
    -- (UTC).
    ResourceDataSyncItem -> Maybe POSIX
lastSuccessfulSyncTime :: Prelude.Maybe Core.POSIX
  }
  deriving (ResourceDataSyncItem -> ResourceDataSyncItem -> Bool
(ResourceDataSyncItem -> ResourceDataSyncItem -> Bool)
-> (ResourceDataSyncItem -> ResourceDataSyncItem -> Bool)
-> Eq ResourceDataSyncItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDataSyncItem -> ResourceDataSyncItem -> Bool
$c/= :: ResourceDataSyncItem -> ResourceDataSyncItem -> Bool
== :: ResourceDataSyncItem -> ResourceDataSyncItem -> Bool
$c== :: ResourceDataSyncItem -> ResourceDataSyncItem -> Bool
Prelude.Eq, ReadPrec [ResourceDataSyncItem]
ReadPrec ResourceDataSyncItem
Int -> ReadS ResourceDataSyncItem
ReadS [ResourceDataSyncItem]
(Int -> ReadS ResourceDataSyncItem)
-> ReadS [ResourceDataSyncItem]
-> ReadPrec ResourceDataSyncItem
-> ReadPrec [ResourceDataSyncItem]
-> Read ResourceDataSyncItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceDataSyncItem]
$creadListPrec :: ReadPrec [ResourceDataSyncItem]
readPrec :: ReadPrec ResourceDataSyncItem
$creadPrec :: ReadPrec ResourceDataSyncItem
readList :: ReadS [ResourceDataSyncItem]
$creadList :: ReadS [ResourceDataSyncItem]
readsPrec :: Int -> ReadS ResourceDataSyncItem
$creadsPrec :: Int -> ReadS ResourceDataSyncItem
Prelude.Read, Int -> ResourceDataSyncItem -> ShowS
[ResourceDataSyncItem] -> ShowS
ResourceDataSyncItem -> String
(Int -> ResourceDataSyncItem -> ShowS)
-> (ResourceDataSyncItem -> String)
-> ([ResourceDataSyncItem] -> ShowS)
-> Show ResourceDataSyncItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDataSyncItem] -> ShowS
$cshowList :: [ResourceDataSyncItem] -> ShowS
show :: ResourceDataSyncItem -> String
$cshow :: ResourceDataSyncItem -> String
showsPrec :: Int -> ResourceDataSyncItem -> ShowS
$cshowsPrec :: Int -> ResourceDataSyncItem -> ShowS
Prelude.Show, (forall x. ResourceDataSyncItem -> Rep ResourceDataSyncItem x)
-> (forall x. Rep ResourceDataSyncItem x -> ResourceDataSyncItem)
-> Generic ResourceDataSyncItem
forall x. Rep ResourceDataSyncItem x -> ResourceDataSyncItem
forall x. ResourceDataSyncItem -> Rep ResourceDataSyncItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceDataSyncItem x -> ResourceDataSyncItem
$cfrom :: forall x. ResourceDataSyncItem -> Rep ResourceDataSyncItem x
Prelude.Generic)

-- |
-- Create a value of 'ResourceDataSyncItem' 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:
--
-- 'syncType', 'resourceDataSyncItem_syncType' - The type of resource data sync. If @SyncType@ is @SyncToDestination@,
-- then the resource data sync synchronizes data to an S3 bucket. If the
-- @SyncType@ is @SyncFromSource@ then the resource data sync synchronizes
-- data from Organizations or from multiple Amazon Web Services Regions.
--
-- 'syncSource', 'resourceDataSyncItem_syncSource' - Information about the source where the data was synchronized.
--
-- 'lastSyncStatusMessage', 'resourceDataSyncItem_lastSyncStatusMessage' - The status message details reported by the last sync.
--
-- 'syncCreatedTime', 'resourceDataSyncItem_syncCreatedTime' - The date and time the configuration was created (UTC).
--
-- 'lastSyncTime', 'resourceDataSyncItem_lastSyncTime' - The last time the configuration attempted to sync (UTC).
--
-- 'syncName', 'resourceDataSyncItem_syncName' - The name of the resource data sync.
--
-- 'lastStatus', 'resourceDataSyncItem_lastStatus' - The status reported by the last sync.
--
-- 'syncLastModifiedTime', 'resourceDataSyncItem_syncLastModifiedTime' - The date and time the resource data sync was changed.
--
-- 's3Destination', 'resourceDataSyncItem_s3Destination' - Configuration information for the target S3 bucket.
--
-- 'lastSuccessfulSyncTime', 'resourceDataSyncItem_lastSuccessfulSyncTime' - The last time the sync operations returned a status of @SUCCESSFUL@
-- (UTC).
newResourceDataSyncItem ::
  ResourceDataSyncItem
newResourceDataSyncItem :: ResourceDataSyncItem
newResourceDataSyncItem =
  ResourceDataSyncItem' :: Maybe Text
-> Maybe ResourceDataSyncSourceWithState
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe LastResourceDataSyncStatus
-> Maybe POSIX
-> Maybe ResourceDataSyncS3Destination
-> Maybe POSIX
-> ResourceDataSyncItem
ResourceDataSyncItem'
    { $sel:syncType:ResourceDataSyncItem' :: Maybe Text
syncType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:syncSource:ResourceDataSyncItem' :: Maybe ResourceDataSyncSourceWithState
syncSource = Maybe ResourceDataSyncSourceWithState
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSyncStatusMessage:ResourceDataSyncItem' :: Maybe Text
lastSyncStatusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:syncCreatedTime:ResourceDataSyncItem' :: Maybe POSIX
syncCreatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSyncTime:ResourceDataSyncItem' :: Maybe POSIX
lastSyncTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:syncName:ResourceDataSyncItem' :: Maybe Text
syncName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastStatus:ResourceDataSyncItem' :: Maybe LastResourceDataSyncStatus
lastStatus = Maybe LastResourceDataSyncStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:syncLastModifiedTime:ResourceDataSyncItem' :: Maybe POSIX
syncLastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Destination:ResourceDataSyncItem' :: Maybe ResourceDataSyncS3Destination
s3Destination = Maybe ResourceDataSyncS3Destination
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSuccessfulSyncTime:ResourceDataSyncItem' :: Maybe POSIX
lastSuccessfulSyncTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of resource data sync. If @SyncType@ is @SyncToDestination@,
-- then the resource data sync synchronizes data to an S3 bucket. If the
-- @SyncType@ is @SyncFromSource@ then the resource data sync synchronizes
-- data from Organizations or from multiple Amazon Web Services Regions.
resourceDataSyncItem_syncType :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.Text)
resourceDataSyncItem_syncType :: (Maybe Text -> f (Maybe Text))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_syncType = (ResourceDataSyncItem -> Maybe Text)
-> (ResourceDataSyncItem -> Maybe Text -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem ResourceDataSyncItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe Text
syncType :: Maybe Text
$sel:syncType:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe Text
syncType} -> Maybe Text
syncType) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe Text
a -> ResourceDataSyncItem
s {$sel:syncType:ResourceDataSyncItem' :: Maybe Text
syncType = Maybe Text
a} :: ResourceDataSyncItem)

-- | Information about the source where the data was synchronized.
resourceDataSyncItem_syncSource :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe ResourceDataSyncSourceWithState)
resourceDataSyncItem_syncSource :: (Maybe ResourceDataSyncSourceWithState
 -> f (Maybe ResourceDataSyncSourceWithState))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_syncSource = (ResourceDataSyncItem -> Maybe ResourceDataSyncSourceWithState)
-> (ResourceDataSyncItem
    -> Maybe ResourceDataSyncSourceWithState -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe ResourceDataSyncSourceWithState)
     (Maybe ResourceDataSyncSourceWithState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe ResourceDataSyncSourceWithState
syncSource :: Maybe ResourceDataSyncSourceWithState
$sel:syncSource:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe ResourceDataSyncSourceWithState
syncSource} -> Maybe ResourceDataSyncSourceWithState
syncSource) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe ResourceDataSyncSourceWithState
a -> ResourceDataSyncItem
s {$sel:syncSource:ResourceDataSyncItem' :: Maybe ResourceDataSyncSourceWithState
syncSource = Maybe ResourceDataSyncSourceWithState
a} :: ResourceDataSyncItem)

-- | The status message details reported by the last sync.
resourceDataSyncItem_lastSyncStatusMessage :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.Text)
resourceDataSyncItem_lastSyncStatusMessage :: (Maybe Text -> f (Maybe Text))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_lastSyncStatusMessage = (ResourceDataSyncItem -> Maybe Text)
-> (ResourceDataSyncItem -> Maybe Text -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem ResourceDataSyncItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe Text
lastSyncStatusMessage :: Maybe Text
$sel:lastSyncStatusMessage:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe Text
lastSyncStatusMessage} -> Maybe Text
lastSyncStatusMessage) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe Text
a -> ResourceDataSyncItem
s {$sel:lastSyncStatusMessage:ResourceDataSyncItem' :: Maybe Text
lastSyncStatusMessage = Maybe Text
a} :: ResourceDataSyncItem)

-- | The date and time the configuration was created (UTC).
resourceDataSyncItem_syncCreatedTime :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.UTCTime)
resourceDataSyncItem_syncCreatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_syncCreatedTime = (ResourceDataSyncItem -> Maybe POSIX)
-> (ResourceDataSyncItem -> Maybe POSIX -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe POSIX
syncCreatedTime :: Maybe POSIX
$sel:syncCreatedTime:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe POSIX
syncCreatedTime} -> Maybe POSIX
syncCreatedTime) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe POSIX
a -> ResourceDataSyncItem
s {$sel:syncCreatedTime:ResourceDataSyncItem' :: Maybe POSIX
syncCreatedTime = Maybe POSIX
a} :: ResourceDataSyncItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceDataSyncItem -> f ResourceDataSyncItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem
-> f ResourceDataSyncItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The last time the configuration attempted to sync (UTC).
resourceDataSyncItem_lastSyncTime :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.UTCTime)
resourceDataSyncItem_lastSyncTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_lastSyncTime = (ResourceDataSyncItem -> Maybe POSIX)
-> (ResourceDataSyncItem -> Maybe POSIX -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe POSIX
lastSyncTime :: Maybe POSIX
$sel:lastSyncTime:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe POSIX
lastSyncTime} -> Maybe POSIX
lastSyncTime) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe POSIX
a -> ResourceDataSyncItem
s {$sel:lastSyncTime:ResourceDataSyncItem' :: Maybe POSIX
lastSyncTime = Maybe POSIX
a} :: ResourceDataSyncItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceDataSyncItem -> f ResourceDataSyncItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem
-> f ResourceDataSyncItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the resource data sync.
resourceDataSyncItem_syncName :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.Text)
resourceDataSyncItem_syncName :: (Maybe Text -> f (Maybe Text))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_syncName = (ResourceDataSyncItem -> Maybe Text)
-> (ResourceDataSyncItem -> Maybe Text -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem ResourceDataSyncItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe Text
syncName :: Maybe Text
$sel:syncName:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe Text
syncName} -> Maybe Text
syncName) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe Text
a -> ResourceDataSyncItem
s {$sel:syncName:ResourceDataSyncItem' :: Maybe Text
syncName = Maybe Text
a} :: ResourceDataSyncItem)

-- | The status reported by the last sync.
resourceDataSyncItem_lastStatus :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe LastResourceDataSyncStatus)
resourceDataSyncItem_lastStatus :: (Maybe LastResourceDataSyncStatus
 -> f (Maybe LastResourceDataSyncStatus))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_lastStatus = (ResourceDataSyncItem -> Maybe LastResourceDataSyncStatus)
-> (ResourceDataSyncItem
    -> Maybe LastResourceDataSyncStatus -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe LastResourceDataSyncStatus)
     (Maybe LastResourceDataSyncStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe LastResourceDataSyncStatus
lastStatus :: Maybe LastResourceDataSyncStatus
$sel:lastStatus:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe LastResourceDataSyncStatus
lastStatus} -> Maybe LastResourceDataSyncStatus
lastStatus) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe LastResourceDataSyncStatus
a -> ResourceDataSyncItem
s {$sel:lastStatus:ResourceDataSyncItem' :: Maybe LastResourceDataSyncStatus
lastStatus = Maybe LastResourceDataSyncStatus
a} :: ResourceDataSyncItem)

-- | The date and time the resource data sync was changed.
resourceDataSyncItem_syncLastModifiedTime :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.UTCTime)
resourceDataSyncItem_syncLastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_syncLastModifiedTime = (ResourceDataSyncItem -> Maybe POSIX)
-> (ResourceDataSyncItem -> Maybe POSIX -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe POSIX
syncLastModifiedTime :: Maybe POSIX
$sel:syncLastModifiedTime:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe POSIX
syncLastModifiedTime} -> Maybe POSIX
syncLastModifiedTime) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe POSIX
a -> ResourceDataSyncItem
s {$sel:syncLastModifiedTime:ResourceDataSyncItem' :: Maybe POSIX
syncLastModifiedTime = Maybe POSIX
a} :: ResourceDataSyncItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceDataSyncItem -> f ResourceDataSyncItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem
-> f ResourceDataSyncItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Configuration information for the target S3 bucket.
resourceDataSyncItem_s3Destination :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe ResourceDataSyncS3Destination)
resourceDataSyncItem_s3Destination :: (Maybe ResourceDataSyncS3Destination
 -> f (Maybe ResourceDataSyncS3Destination))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_s3Destination = (ResourceDataSyncItem -> Maybe ResourceDataSyncS3Destination)
-> (ResourceDataSyncItem
    -> Maybe ResourceDataSyncS3Destination -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe ResourceDataSyncS3Destination)
     (Maybe ResourceDataSyncS3Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe ResourceDataSyncS3Destination
s3Destination :: Maybe ResourceDataSyncS3Destination
$sel:s3Destination:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe ResourceDataSyncS3Destination
s3Destination} -> Maybe ResourceDataSyncS3Destination
s3Destination) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe ResourceDataSyncS3Destination
a -> ResourceDataSyncItem
s {$sel:s3Destination:ResourceDataSyncItem' :: Maybe ResourceDataSyncS3Destination
s3Destination = Maybe ResourceDataSyncS3Destination
a} :: ResourceDataSyncItem)

-- | The last time the sync operations returned a status of @SUCCESSFUL@
-- (UTC).
resourceDataSyncItem_lastSuccessfulSyncTime :: Lens.Lens' ResourceDataSyncItem (Prelude.Maybe Prelude.UTCTime)
resourceDataSyncItem_lastSuccessfulSyncTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem -> f ResourceDataSyncItem
resourceDataSyncItem_lastSuccessfulSyncTime = (ResourceDataSyncItem -> Maybe POSIX)
-> (ResourceDataSyncItem -> Maybe POSIX -> ResourceDataSyncItem)
-> Lens
     ResourceDataSyncItem
     ResourceDataSyncItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDataSyncItem' {Maybe POSIX
lastSuccessfulSyncTime :: Maybe POSIX
$sel:lastSuccessfulSyncTime:ResourceDataSyncItem' :: ResourceDataSyncItem -> Maybe POSIX
lastSuccessfulSyncTime} -> Maybe POSIX
lastSuccessfulSyncTime) (\s :: ResourceDataSyncItem
s@ResourceDataSyncItem' {} Maybe POSIX
a -> ResourceDataSyncItem
s {$sel:lastSuccessfulSyncTime:ResourceDataSyncItem' :: Maybe POSIX
lastSuccessfulSyncTime = Maybe POSIX
a} :: ResourceDataSyncItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceDataSyncItem -> f ResourceDataSyncItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDataSyncItem
-> f ResourceDataSyncItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON ResourceDataSyncItem where
  parseJSON :: Value -> Parser ResourceDataSyncItem
parseJSON =
    String
-> (Object -> Parser ResourceDataSyncItem)
-> Value
-> Parser ResourceDataSyncItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceDataSyncItem"
      ( \Object
x ->
          Maybe Text
-> Maybe ResourceDataSyncSourceWithState
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe LastResourceDataSyncStatus
-> Maybe POSIX
-> Maybe ResourceDataSyncS3Destination
-> Maybe POSIX
-> ResourceDataSyncItem
ResourceDataSyncItem'
            (Maybe Text
 -> Maybe ResourceDataSyncSourceWithState
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe LastResourceDataSyncStatus
 -> Maybe POSIX
 -> Maybe ResourceDataSyncS3Destination
 -> Maybe POSIX
 -> ResourceDataSyncItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceDataSyncSourceWithState
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
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
"SyncType")
            Parser
  (Maybe ResourceDataSyncSourceWithState
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe ResourceDataSyncSourceWithState)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceDataSyncSourceWithState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyncSource")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
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
"LastSyncStatusMessage")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyncCreatedTime")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastSyncTime")
            Parser
  (Maybe Text
   -> Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe LastResourceDataSyncStatus
      -> Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
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
"SyncName")
            Parser
  (Maybe LastResourceDataSyncStatus
   -> Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe LastResourceDataSyncStatus)
-> Parser
     (Maybe POSIX
      -> Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX
      -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LastResourceDataSyncStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastStatus")
            Parser
  (Maybe POSIX
   -> Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX
   -> ResourceDataSyncItem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceDataSyncS3Destination
      -> Maybe POSIX -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyncLastModifiedTime")
            Parser
  (Maybe ResourceDataSyncS3Destination
   -> Maybe POSIX -> ResourceDataSyncItem)
-> Parser (Maybe ResourceDataSyncS3Destination)
-> Parser (Maybe POSIX -> ResourceDataSyncItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceDataSyncS3Destination)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3Destination")
            Parser (Maybe POSIX -> ResourceDataSyncItem)
-> Parser (Maybe POSIX) -> Parser ResourceDataSyncItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastSuccessfulSyncTime")
      )

instance Prelude.Hashable ResourceDataSyncItem

instance Prelude.NFData ResourceDataSyncItem