{-# 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.Lightsail.Types.ExportSnapshotRecordSourceInfo
-- 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.Lightsail.Types.ExportSnapshotRecordSourceInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.DiskSnapshotInfo
import Amazonka.Lightsail.Types.ExportSnapshotRecordSourceType
import Amazonka.Lightsail.Types.InstanceSnapshotInfo
import qualified Amazonka.Prelude as Prelude

-- | Describes the source of an export snapshot record.
--
-- /See:/ 'newExportSnapshotRecordSourceInfo' smart constructor.
data ExportSnapshotRecordSourceInfo = ExportSnapshotRecordSourceInfo'
  { -- | A list of objects describing a disk snapshot.
    ExportSnapshotRecordSourceInfo -> Maybe DiskSnapshotInfo
diskSnapshotInfo :: Prelude.Maybe DiskSnapshotInfo,
    -- | The Lightsail resource type (e.g., @InstanceSnapshot@ or
    -- @DiskSnapshot@).
    ExportSnapshotRecordSourceInfo
-> Maybe ExportSnapshotRecordSourceType
resourceType :: Prelude.Maybe ExportSnapshotRecordSourceType,
    -- | The Amazon Resource Name (ARN) of the source instance or disk snapshot.
    ExportSnapshotRecordSourceInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date when the source instance or disk snapshot was created.
    ExportSnapshotRecordSourceInfo -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the snapshot\'s source instance or
    -- disk.
    ExportSnapshotRecordSourceInfo -> Maybe Text
fromResourceArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the source instance or disk snapshot.
    ExportSnapshotRecordSourceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A list of objects describing an instance snapshot.
    ExportSnapshotRecordSourceInfo -> Maybe InstanceSnapshotInfo
instanceSnapshotInfo :: Prelude.Maybe InstanceSnapshotInfo,
    -- | The name of the snapshot\'s source instance or disk.
    ExportSnapshotRecordSourceInfo -> Maybe Text
fromResourceName :: Prelude.Maybe Prelude.Text
  }
  deriving (ExportSnapshotRecordSourceInfo
-> ExportSnapshotRecordSourceInfo -> Bool
(ExportSnapshotRecordSourceInfo
 -> ExportSnapshotRecordSourceInfo -> Bool)
-> (ExportSnapshotRecordSourceInfo
    -> ExportSnapshotRecordSourceInfo -> Bool)
-> Eq ExportSnapshotRecordSourceInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportSnapshotRecordSourceInfo
-> ExportSnapshotRecordSourceInfo -> Bool
$c/= :: ExportSnapshotRecordSourceInfo
-> ExportSnapshotRecordSourceInfo -> Bool
== :: ExportSnapshotRecordSourceInfo
-> ExportSnapshotRecordSourceInfo -> Bool
$c== :: ExportSnapshotRecordSourceInfo
-> ExportSnapshotRecordSourceInfo -> Bool
Prelude.Eq, ReadPrec [ExportSnapshotRecordSourceInfo]
ReadPrec ExportSnapshotRecordSourceInfo
Int -> ReadS ExportSnapshotRecordSourceInfo
ReadS [ExportSnapshotRecordSourceInfo]
(Int -> ReadS ExportSnapshotRecordSourceInfo)
-> ReadS [ExportSnapshotRecordSourceInfo]
-> ReadPrec ExportSnapshotRecordSourceInfo
-> ReadPrec [ExportSnapshotRecordSourceInfo]
-> Read ExportSnapshotRecordSourceInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportSnapshotRecordSourceInfo]
$creadListPrec :: ReadPrec [ExportSnapshotRecordSourceInfo]
readPrec :: ReadPrec ExportSnapshotRecordSourceInfo
$creadPrec :: ReadPrec ExportSnapshotRecordSourceInfo
readList :: ReadS [ExportSnapshotRecordSourceInfo]
$creadList :: ReadS [ExportSnapshotRecordSourceInfo]
readsPrec :: Int -> ReadS ExportSnapshotRecordSourceInfo
$creadsPrec :: Int -> ReadS ExportSnapshotRecordSourceInfo
Prelude.Read, Int -> ExportSnapshotRecordSourceInfo -> ShowS
[ExportSnapshotRecordSourceInfo] -> ShowS
ExportSnapshotRecordSourceInfo -> String
(Int -> ExportSnapshotRecordSourceInfo -> ShowS)
-> (ExportSnapshotRecordSourceInfo -> String)
-> ([ExportSnapshotRecordSourceInfo] -> ShowS)
-> Show ExportSnapshotRecordSourceInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportSnapshotRecordSourceInfo] -> ShowS
$cshowList :: [ExportSnapshotRecordSourceInfo] -> ShowS
show :: ExportSnapshotRecordSourceInfo -> String
$cshow :: ExportSnapshotRecordSourceInfo -> String
showsPrec :: Int -> ExportSnapshotRecordSourceInfo -> ShowS
$cshowsPrec :: Int -> ExportSnapshotRecordSourceInfo -> ShowS
Prelude.Show, (forall x.
 ExportSnapshotRecordSourceInfo
 -> Rep ExportSnapshotRecordSourceInfo x)
-> (forall x.
    Rep ExportSnapshotRecordSourceInfo x
    -> ExportSnapshotRecordSourceInfo)
-> Generic ExportSnapshotRecordSourceInfo
forall x.
Rep ExportSnapshotRecordSourceInfo x
-> ExportSnapshotRecordSourceInfo
forall x.
ExportSnapshotRecordSourceInfo
-> Rep ExportSnapshotRecordSourceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportSnapshotRecordSourceInfo x
-> ExportSnapshotRecordSourceInfo
$cfrom :: forall x.
ExportSnapshotRecordSourceInfo
-> Rep ExportSnapshotRecordSourceInfo x
Prelude.Generic)

-- |
-- Create a value of 'ExportSnapshotRecordSourceInfo' 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:
--
-- 'diskSnapshotInfo', 'exportSnapshotRecordSourceInfo_diskSnapshotInfo' - A list of objects describing a disk snapshot.
--
-- 'resourceType', 'exportSnapshotRecordSourceInfo_resourceType' - The Lightsail resource type (e.g., @InstanceSnapshot@ or
-- @DiskSnapshot@).
--
-- 'arn', 'exportSnapshotRecordSourceInfo_arn' - The Amazon Resource Name (ARN) of the source instance or disk snapshot.
--
-- 'createdAt', 'exportSnapshotRecordSourceInfo_createdAt' - The date when the source instance or disk snapshot was created.
--
-- 'fromResourceArn', 'exportSnapshotRecordSourceInfo_fromResourceArn' - The Amazon Resource Name (ARN) of the snapshot\'s source instance or
-- disk.
--
-- 'name', 'exportSnapshotRecordSourceInfo_name' - The name of the source instance or disk snapshot.
--
-- 'instanceSnapshotInfo', 'exportSnapshotRecordSourceInfo_instanceSnapshotInfo' - A list of objects describing an instance snapshot.
--
-- 'fromResourceName', 'exportSnapshotRecordSourceInfo_fromResourceName' - The name of the snapshot\'s source instance or disk.
newExportSnapshotRecordSourceInfo ::
  ExportSnapshotRecordSourceInfo
newExportSnapshotRecordSourceInfo :: ExportSnapshotRecordSourceInfo
newExportSnapshotRecordSourceInfo =
  ExportSnapshotRecordSourceInfo' :: Maybe DiskSnapshotInfo
-> Maybe ExportSnapshotRecordSourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe InstanceSnapshotInfo
-> Maybe Text
-> ExportSnapshotRecordSourceInfo
ExportSnapshotRecordSourceInfo'
    { $sel:diskSnapshotInfo:ExportSnapshotRecordSourceInfo' :: Maybe DiskSnapshotInfo
diskSnapshotInfo =
        Maybe DiskSnapshotInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:ExportSnapshotRecordSourceInfo' :: Maybe ExportSnapshotRecordSourceType
resourceType = Maybe ExportSnapshotRecordSourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ExportSnapshotRecordSourceInfo' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:ExportSnapshotRecordSourceInfo' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:fromResourceArn:ExportSnapshotRecordSourceInfo' :: Maybe Text
fromResourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ExportSnapshotRecordSourceInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceSnapshotInfo:ExportSnapshotRecordSourceInfo' :: Maybe InstanceSnapshotInfo
instanceSnapshotInfo = Maybe InstanceSnapshotInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:fromResourceName:ExportSnapshotRecordSourceInfo' :: Maybe Text
fromResourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of objects describing a disk snapshot.
exportSnapshotRecordSourceInfo_diskSnapshotInfo :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe DiskSnapshotInfo)
exportSnapshotRecordSourceInfo_diskSnapshotInfo :: (Maybe DiskSnapshotInfo -> f (Maybe DiskSnapshotInfo))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_diskSnapshotInfo = (ExportSnapshotRecordSourceInfo -> Maybe DiskSnapshotInfo)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe DiskSnapshotInfo -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe DiskSnapshotInfo)
     (Maybe DiskSnapshotInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe DiskSnapshotInfo
diskSnapshotInfo :: Maybe DiskSnapshotInfo
$sel:diskSnapshotInfo:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe DiskSnapshotInfo
diskSnapshotInfo} -> Maybe DiskSnapshotInfo
diskSnapshotInfo) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe DiskSnapshotInfo
a -> ExportSnapshotRecordSourceInfo
s {$sel:diskSnapshotInfo:ExportSnapshotRecordSourceInfo' :: Maybe DiskSnapshotInfo
diskSnapshotInfo = Maybe DiskSnapshotInfo
a} :: ExportSnapshotRecordSourceInfo)

-- | The Lightsail resource type (e.g., @InstanceSnapshot@ or
-- @DiskSnapshot@).
exportSnapshotRecordSourceInfo_resourceType :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe ExportSnapshotRecordSourceType)
exportSnapshotRecordSourceInfo_resourceType :: (Maybe ExportSnapshotRecordSourceType
 -> f (Maybe ExportSnapshotRecordSourceType))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_resourceType = (ExportSnapshotRecordSourceInfo
 -> Maybe ExportSnapshotRecordSourceType)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe ExportSnapshotRecordSourceType
    -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe ExportSnapshotRecordSourceType)
     (Maybe ExportSnapshotRecordSourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe ExportSnapshotRecordSourceType
resourceType :: Maybe ExportSnapshotRecordSourceType
$sel:resourceType:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo
-> Maybe ExportSnapshotRecordSourceType
resourceType} -> Maybe ExportSnapshotRecordSourceType
resourceType) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe ExportSnapshotRecordSourceType
a -> ExportSnapshotRecordSourceInfo
s {$sel:resourceType:ExportSnapshotRecordSourceInfo' :: Maybe ExportSnapshotRecordSourceType
resourceType = Maybe ExportSnapshotRecordSourceType
a} :: ExportSnapshotRecordSourceInfo)

-- | The Amazon Resource Name (ARN) of the source instance or disk snapshot.
exportSnapshotRecordSourceInfo_arn :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe Prelude.Text)
exportSnapshotRecordSourceInfo_arn :: (Maybe Text -> f (Maybe Text))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_arn = (ExportSnapshotRecordSourceInfo -> Maybe Text)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe Text
arn :: Maybe Text
$sel:arn:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe Text
a -> ExportSnapshotRecordSourceInfo
s {$sel:arn:ExportSnapshotRecordSourceInfo' :: Maybe Text
arn = Maybe Text
a} :: ExportSnapshotRecordSourceInfo)

-- | The date when the source instance or disk snapshot was created.
exportSnapshotRecordSourceInfo_createdAt :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe Prelude.UTCTime)
exportSnapshotRecordSourceInfo_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_createdAt = (ExportSnapshotRecordSourceInfo -> Maybe POSIX)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe POSIX -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe POSIX
a -> ExportSnapshotRecordSourceInfo
s {$sel:createdAt:ExportSnapshotRecordSourceInfo' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ExportSnapshotRecordSourceInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExportSnapshotRecordSourceInfo
 -> f ExportSnapshotRecordSourceInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
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 Amazon Resource Name (ARN) of the snapshot\'s source instance or
-- disk.
exportSnapshotRecordSourceInfo_fromResourceArn :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe Prelude.Text)
exportSnapshotRecordSourceInfo_fromResourceArn :: (Maybe Text -> f (Maybe Text))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_fromResourceArn = (ExportSnapshotRecordSourceInfo -> Maybe Text)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe Text
fromResourceArn :: Maybe Text
$sel:fromResourceArn:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe Text
fromResourceArn} -> Maybe Text
fromResourceArn) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe Text
a -> ExportSnapshotRecordSourceInfo
s {$sel:fromResourceArn:ExportSnapshotRecordSourceInfo' :: Maybe Text
fromResourceArn = Maybe Text
a} :: ExportSnapshotRecordSourceInfo)

-- | The name of the source instance or disk snapshot.
exportSnapshotRecordSourceInfo_name :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe Prelude.Text)
exportSnapshotRecordSourceInfo_name :: (Maybe Text -> f (Maybe Text))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_name = (ExportSnapshotRecordSourceInfo -> Maybe Text)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe Text
name :: Maybe Text
$sel:name:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe Text
a -> ExportSnapshotRecordSourceInfo
s {$sel:name:ExportSnapshotRecordSourceInfo' :: Maybe Text
name = Maybe Text
a} :: ExportSnapshotRecordSourceInfo)

-- | A list of objects describing an instance snapshot.
exportSnapshotRecordSourceInfo_instanceSnapshotInfo :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe InstanceSnapshotInfo)
exportSnapshotRecordSourceInfo_instanceSnapshotInfo :: (Maybe InstanceSnapshotInfo -> f (Maybe InstanceSnapshotInfo))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_instanceSnapshotInfo = (ExportSnapshotRecordSourceInfo -> Maybe InstanceSnapshotInfo)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe InstanceSnapshotInfo -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe InstanceSnapshotInfo)
     (Maybe InstanceSnapshotInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe InstanceSnapshotInfo
instanceSnapshotInfo :: Maybe InstanceSnapshotInfo
$sel:instanceSnapshotInfo:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe InstanceSnapshotInfo
instanceSnapshotInfo} -> Maybe InstanceSnapshotInfo
instanceSnapshotInfo) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe InstanceSnapshotInfo
a -> ExportSnapshotRecordSourceInfo
s {$sel:instanceSnapshotInfo:ExportSnapshotRecordSourceInfo' :: Maybe InstanceSnapshotInfo
instanceSnapshotInfo = Maybe InstanceSnapshotInfo
a} :: ExportSnapshotRecordSourceInfo)

-- | The name of the snapshot\'s source instance or disk.
exportSnapshotRecordSourceInfo_fromResourceName :: Lens.Lens' ExportSnapshotRecordSourceInfo (Prelude.Maybe Prelude.Text)
exportSnapshotRecordSourceInfo_fromResourceName :: (Maybe Text -> f (Maybe Text))
-> ExportSnapshotRecordSourceInfo
-> f ExportSnapshotRecordSourceInfo
exportSnapshotRecordSourceInfo_fromResourceName = (ExportSnapshotRecordSourceInfo -> Maybe Text)
-> (ExportSnapshotRecordSourceInfo
    -> Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Lens
     ExportSnapshotRecordSourceInfo
     ExportSnapshotRecordSourceInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSnapshotRecordSourceInfo' {Maybe Text
fromResourceName :: Maybe Text
$sel:fromResourceName:ExportSnapshotRecordSourceInfo' :: ExportSnapshotRecordSourceInfo -> Maybe Text
fromResourceName} -> Maybe Text
fromResourceName) (\s :: ExportSnapshotRecordSourceInfo
s@ExportSnapshotRecordSourceInfo' {} Maybe Text
a -> ExportSnapshotRecordSourceInfo
s {$sel:fromResourceName:ExportSnapshotRecordSourceInfo' :: Maybe Text
fromResourceName = Maybe Text
a} :: ExportSnapshotRecordSourceInfo)

instance Core.FromJSON ExportSnapshotRecordSourceInfo where
  parseJSON :: Value -> Parser ExportSnapshotRecordSourceInfo
parseJSON =
    String
-> (Object -> Parser ExportSnapshotRecordSourceInfo)
-> Value
-> Parser ExportSnapshotRecordSourceInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportSnapshotRecordSourceInfo"
      ( \Object
x ->
          Maybe DiskSnapshotInfo
-> Maybe ExportSnapshotRecordSourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe InstanceSnapshotInfo
-> Maybe Text
-> ExportSnapshotRecordSourceInfo
ExportSnapshotRecordSourceInfo'
            (Maybe DiskSnapshotInfo
 -> Maybe ExportSnapshotRecordSourceType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe InstanceSnapshotInfo
 -> Maybe Text
 -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe DiskSnapshotInfo)
-> Parser
     (Maybe ExportSnapshotRecordSourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstanceSnapshotInfo
      -> Maybe Text
      -> ExportSnapshotRecordSourceInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DiskSnapshotInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"diskSnapshotInfo")
            Parser
  (Maybe ExportSnapshotRecordSourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstanceSnapshotInfo
   -> Maybe Text
   -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe ExportSnapshotRecordSourceType)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstanceSnapshotInfo
      -> Maybe Text
      -> ExportSnapshotRecordSourceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExportSnapshotRecordSourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstanceSnapshotInfo
   -> Maybe Text
   -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstanceSnapshotInfo
      -> Maybe Text
      -> ExportSnapshotRecordSourceInfo)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstanceSnapshotInfo
   -> Maybe Text
   -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe InstanceSnapshotInfo
      -> Maybe Text
      -> ExportSnapshotRecordSourceInfo)
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
"createdAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe InstanceSnapshotInfo
   -> Maybe Text
   -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe InstanceSnapshotInfo
      -> Maybe Text
      -> ExportSnapshotRecordSourceInfo)
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
"fromResourceArn")
            Parser
  (Maybe Text
   -> Maybe InstanceSnapshotInfo
   -> Maybe Text
   -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe InstanceSnapshotInfo
      -> Maybe Text -> ExportSnapshotRecordSourceInfo)
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 InstanceSnapshotInfo
   -> Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe InstanceSnapshotInfo)
-> Parser (Maybe Text -> ExportSnapshotRecordSourceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceSnapshotInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceSnapshotInfo")
            Parser (Maybe Text -> ExportSnapshotRecordSourceInfo)
-> Parser (Maybe Text) -> Parser ExportSnapshotRecordSourceInfo
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
"fromResourceName")
      )

instance
  Prelude.Hashable
    ExportSnapshotRecordSourceInfo

instance
  Prelude.NFData
    ExportSnapshotRecordSourceInfo