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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.CloudFormationStackRecordSourceInfo
import Amazonka.Lightsail.Types.DestinationInfo
import Amazonka.Lightsail.Types.RecordState
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import qualified Amazonka.Prelude as Prelude

-- | Describes a CloudFormation stack record created as a result of the
-- @create cloud formation stack@ action.
--
-- A CloudFormation stack record provides information about the AWS
-- CloudFormation stack used to create a new Amazon Elastic Compute Cloud
-- instance from an exported Lightsail instance snapshot.
--
-- /See:/ 'newCloudFormationStackRecord' smart constructor.
data CloudFormationStackRecord = CloudFormationStackRecord'
  { -- | The current state of the CloudFormation stack record.
    CloudFormationStackRecord -> Maybe RecordState
state :: Prelude.Maybe RecordState,
    -- | A list of objects describing the destination service, which is AWS
    -- CloudFormation, and the Amazon Resource Name (ARN) of the AWS
    -- CloudFormation stack.
    CloudFormationStackRecord -> Maybe DestinationInfo
destinationInfo :: Prelude.Maybe DestinationInfo,
    -- | The Lightsail resource type (e.g., @CloudFormationStackRecord@).
    CloudFormationStackRecord -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The Amazon Resource Name (ARN) of the CloudFormation stack record.
    CloudFormationStackRecord -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date when the CloudFormation stack record was created.
    CloudFormationStackRecord -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | A list of objects describing the Availability Zone and AWS Region of the
    -- CloudFormation stack record.
    CloudFormationStackRecord -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The name of the CloudFormation stack record. It starts with
    -- @CloudFormationStackRecord@ followed by a GUID.
    CloudFormationStackRecord -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A list of objects describing the source of the CloudFormation stack
    -- record.
    CloudFormationStackRecord
-> Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo :: Prelude.Maybe [CloudFormationStackRecordSourceInfo]
  }
  deriving (CloudFormationStackRecord -> CloudFormationStackRecord -> Bool
(CloudFormationStackRecord -> CloudFormationStackRecord -> Bool)
-> (CloudFormationStackRecord -> CloudFormationStackRecord -> Bool)
-> Eq CloudFormationStackRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudFormationStackRecord -> CloudFormationStackRecord -> Bool
$c/= :: CloudFormationStackRecord -> CloudFormationStackRecord -> Bool
== :: CloudFormationStackRecord -> CloudFormationStackRecord -> Bool
$c== :: CloudFormationStackRecord -> CloudFormationStackRecord -> Bool
Prelude.Eq, ReadPrec [CloudFormationStackRecord]
ReadPrec CloudFormationStackRecord
Int -> ReadS CloudFormationStackRecord
ReadS [CloudFormationStackRecord]
(Int -> ReadS CloudFormationStackRecord)
-> ReadS [CloudFormationStackRecord]
-> ReadPrec CloudFormationStackRecord
-> ReadPrec [CloudFormationStackRecord]
-> Read CloudFormationStackRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudFormationStackRecord]
$creadListPrec :: ReadPrec [CloudFormationStackRecord]
readPrec :: ReadPrec CloudFormationStackRecord
$creadPrec :: ReadPrec CloudFormationStackRecord
readList :: ReadS [CloudFormationStackRecord]
$creadList :: ReadS [CloudFormationStackRecord]
readsPrec :: Int -> ReadS CloudFormationStackRecord
$creadsPrec :: Int -> ReadS CloudFormationStackRecord
Prelude.Read, Int -> CloudFormationStackRecord -> ShowS
[CloudFormationStackRecord] -> ShowS
CloudFormationStackRecord -> String
(Int -> CloudFormationStackRecord -> ShowS)
-> (CloudFormationStackRecord -> String)
-> ([CloudFormationStackRecord] -> ShowS)
-> Show CloudFormationStackRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudFormationStackRecord] -> ShowS
$cshowList :: [CloudFormationStackRecord] -> ShowS
show :: CloudFormationStackRecord -> String
$cshow :: CloudFormationStackRecord -> String
showsPrec :: Int -> CloudFormationStackRecord -> ShowS
$cshowsPrec :: Int -> CloudFormationStackRecord -> ShowS
Prelude.Show, (forall x.
 CloudFormationStackRecord -> Rep CloudFormationStackRecord x)
-> (forall x.
    Rep CloudFormationStackRecord x -> CloudFormationStackRecord)
-> Generic CloudFormationStackRecord
forall x.
Rep CloudFormationStackRecord x -> CloudFormationStackRecord
forall x.
CloudFormationStackRecord -> Rep CloudFormationStackRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudFormationStackRecord x -> CloudFormationStackRecord
$cfrom :: forall x.
CloudFormationStackRecord -> Rep CloudFormationStackRecord x
Prelude.Generic)

-- |
-- Create a value of 'CloudFormationStackRecord' 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', 'cloudFormationStackRecord_state' - The current state of the CloudFormation stack record.
--
-- 'destinationInfo', 'cloudFormationStackRecord_destinationInfo' - A list of objects describing the destination service, which is AWS
-- CloudFormation, and the Amazon Resource Name (ARN) of the AWS
-- CloudFormation stack.
--
-- 'resourceType', 'cloudFormationStackRecord_resourceType' - The Lightsail resource type (e.g., @CloudFormationStackRecord@).
--
-- 'arn', 'cloudFormationStackRecord_arn' - The Amazon Resource Name (ARN) of the CloudFormation stack record.
--
-- 'createdAt', 'cloudFormationStackRecord_createdAt' - The date when the CloudFormation stack record was created.
--
-- 'location', 'cloudFormationStackRecord_location' - A list of objects describing the Availability Zone and AWS Region of the
-- CloudFormation stack record.
--
-- 'name', 'cloudFormationStackRecord_name' - The name of the CloudFormation stack record. It starts with
-- @CloudFormationStackRecord@ followed by a GUID.
--
-- 'sourceInfo', 'cloudFormationStackRecord_sourceInfo' - A list of objects describing the source of the CloudFormation stack
-- record.
newCloudFormationStackRecord ::
  CloudFormationStackRecord
newCloudFormationStackRecord :: CloudFormationStackRecord
newCloudFormationStackRecord =
  CloudFormationStackRecord' :: Maybe RecordState
-> Maybe DestinationInfo
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe [CloudFormationStackRecordSourceInfo]
-> CloudFormationStackRecord
CloudFormationStackRecord'
    { $sel:state:CloudFormationStackRecord' :: Maybe RecordState
state = Maybe RecordState
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationInfo:CloudFormationStackRecord' :: Maybe DestinationInfo
destinationInfo = Maybe DestinationInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:CloudFormationStackRecord' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CloudFormationStackRecord' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CloudFormationStackRecord' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:location:CloudFormationStackRecord' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CloudFormationStackRecord' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceInfo:CloudFormationStackRecord' :: Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo = Maybe [CloudFormationStackRecordSourceInfo]
forall a. Maybe a
Prelude.Nothing
    }

-- | The current state of the CloudFormation stack record.
cloudFormationStackRecord_state :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe RecordState)
cloudFormationStackRecord_state :: (Maybe RecordState -> f (Maybe RecordState))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_state = (CloudFormationStackRecord -> Maybe RecordState)
-> (CloudFormationStackRecord
    -> Maybe RecordState -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe RecordState)
     (Maybe RecordState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe RecordState
state :: Maybe RecordState
$sel:state:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe RecordState
state} -> Maybe RecordState
state) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe RecordState
a -> CloudFormationStackRecord
s {$sel:state:CloudFormationStackRecord' :: Maybe RecordState
state = Maybe RecordState
a} :: CloudFormationStackRecord)

-- | A list of objects describing the destination service, which is AWS
-- CloudFormation, and the Amazon Resource Name (ARN) of the AWS
-- CloudFormation stack.
cloudFormationStackRecord_destinationInfo :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe DestinationInfo)
cloudFormationStackRecord_destinationInfo :: (Maybe DestinationInfo -> f (Maybe DestinationInfo))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_destinationInfo = (CloudFormationStackRecord -> Maybe DestinationInfo)
-> (CloudFormationStackRecord
    -> Maybe DestinationInfo -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe DestinationInfo)
     (Maybe DestinationInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe DestinationInfo
destinationInfo :: Maybe DestinationInfo
$sel:destinationInfo:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe DestinationInfo
destinationInfo} -> Maybe DestinationInfo
destinationInfo) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe DestinationInfo
a -> CloudFormationStackRecord
s {$sel:destinationInfo:CloudFormationStackRecord' :: Maybe DestinationInfo
destinationInfo = Maybe DestinationInfo
a} :: CloudFormationStackRecord)

-- | The Lightsail resource type (e.g., @CloudFormationStackRecord@).
cloudFormationStackRecord_resourceType :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe ResourceType)
cloudFormationStackRecord_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_resourceType = (CloudFormationStackRecord -> Maybe ResourceType)
-> (CloudFormationStackRecord
    -> Maybe ResourceType -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe ResourceType)
     (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe ResourceType
a -> CloudFormationStackRecord
s {$sel:resourceType:CloudFormationStackRecord' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: CloudFormationStackRecord)

-- | The Amazon Resource Name (ARN) of the CloudFormation stack record.
cloudFormationStackRecord_arn :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe Prelude.Text)
cloudFormationStackRecord_arn :: (Maybe Text -> f (Maybe Text))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_arn = (CloudFormationStackRecord -> Maybe Text)
-> (CloudFormationStackRecord
    -> Maybe Text -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe Text
arn :: Maybe Text
$sel:arn:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe Text
a -> CloudFormationStackRecord
s {$sel:arn:CloudFormationStackRecord' :: Maybe Text
arn = Maybe Text
a} :: CloudFormationStackRecord)

-- | The date when the CloudFormation stack record was created.
cloudFormationStackRecord_createdAt :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe Prelude.UTCTime)
cloudFormationStackRecord_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_createdAt = (CloudFormationStackRecord -> Maybe POSIX)
-> (CloudFormationStackRecord
    -> Maybe POSIX -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe POSIX
a -> CloudFormationStackRecord
s {$sel:createdAt:CloudFormationStackRecord' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: CloudFormationStackRecord) ((Maybe POSIX -> f (Maybe POSIX))
 -> CloudFormationStackRecord -> f CloudFormationStackRecord)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CloudFormationStackRecord
-> f CloudFormationStackRecord
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

-- | A list of objects describing the Availability Zone and AWS Region of the
-- CloudFormation stack record.
cloudFormationStackRecord_location :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe ResourceLocation)
cloudFormationStackRecord_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_location = (CloudFormationStackRecord -> Maybe ResourceLocation)
-> (CloudFormationStackRecord
    -> Maybe ResourceLocation -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe ResourceLocation)
     (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe ResourceLocation
a -> CloudFormationStackRecord
s {$sel:location:CloudFormationStackRecord' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: CloudFormationStackRecord)

-- | The name of the CloudFormation stack record. It starts with
-- @CloudFormationStackRecord@ followed by a GUID.
cloudFormationStackRecord_name :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe Prelude.Text)
cloudFormationStackRecord_name :: (Maybe Text -> f (Maybe Text))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_name = (CloudFormationStackRecord -> Maybe Text)
-> (CloudFormationStackRecord
    -> Maybe Text -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe Text
name :: Maybe Text
$sel:name:CloudFormationStackRecord' :: CloudFormationStackRecord -> Maybe Text
name} -> Maybe Text
name) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe Text
a -> CloudFormationStackRecord
s {$sel:name:CloudFormationStackRecord' :: Maybe Text
name = Maybe Text
a} :: CloudFormationStackRecord)

-- | A list of objects describing the source of the CloudFormation stack
-- record.
cloudFormationStackRecord_sourceInfo :: Lens.Lens' CloudFormationStackRecord (Prelude.Maybe [CloudFormationStackRecordSourceInfo])
cloudFormationStackRecord_sourceInfo :: (Maybe [CloudFormationStackRecordSourceInfo]
 -> f (Maybe [CloudFormationStackRecordSourceInfo]))
-> CloudFormationStackRecord -> f CloudFormationStackRecord
cloudFormationStackRecord_sourceInfo = (CloudFormationStackRecord
 -> Maybe [CloudFormationStackRecordSourceInfo])
-> (CloudFormationStackRecord
    -> Maybe [CloudFormationStackRecordSourceInfo]
    -> CloudFormationStackRecord)
-> Lens
     CloudFormationStackRecord
     CloudFormationStackRecord
     (Maybe [CloudFormationStackRecordSourceInfo])
     (Maybe [CloudFormationStackRecordSourceInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationStackRecord' {Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo :: Maybe [CloudFormationStackRecordSourceInfo]
$sel:sourceInfo:CloudFormationStackRecord' :: CloudFormationStackRecord
-> Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo} -> Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo) (\s :: CloudFormationStackRecord
s@CloudFormationStackRecord' {} Maybe [CloudFormationStackRecordSourceInfo]
a -> CloudFormationStackRecord
s {$sel:sourceInfo:CloudFormationStackRecord' :: Maybe [CloudFormationStackRecordSourceInfo]
sourceInfo = Maybe [CloudFormationStackRecordSourceInfo]
a} :: CloudFormationStackRecord) ((Maybe [CloudFormationStackRecordSourceInfo]
  -> f (Maybe [CloudFormationStackRecordSourceInfo]))
 -> CloudFormationStackRecord -> f CloudFormationStackRecord)
-> ((Maybe [CloudFormationStackRecordSourceInfo]
     -> f (Maybe [CloudFormationStackRecordSourceInfo]))
    -> Maybe [CloudFormationStackRecordSourceInfo]
    -> f (Maybe [CloudFormationStackRecordSourceInfo]))
-> (Maybe [CloudFormationStackRecordSourceInfo]
    -> f (Maybe [CloudFormationStackRecordSourceInfo]))
-> CloudFormationStackRecord
-> f CloudFormationStackRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
-> Iso
     (Maybe [CloudFormationStackRecordSourceInfo])
     (Maybe [CloudFormationStackRecordSourceInfo])
     (Maybe [CloudFormationStackRecordSourceInfo])
     (Maybe [CloudFormationStackRecordSourceInfo])
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
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
  [CloudFormationStackRecordSourceInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON CloudFormationStackRecord where
  parseJSON :: Value -> Parser CloudFormationStackRecord
parseJSON =
    String
-> (Object -> Parser CloudFormationStackRecord)
-> Value
-> Parser CloudFormationStackRecord
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CloudFormationStackRecord"
      ( \Object
x ->
          Maybe RecordState
-> Maybe DestinationInfo
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe [CloudFormationStackRecordSourceInfo]
-> CloudFormationStackRecord
CloudFormationStackRecord'
            (Maybe RecordState
 -> Maybe DestinationInfo
 -> Maybe ResourceType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ResourceLocation
 -> Maybe Text
 -> Maybe [CloudFormationStackRecordSourceInfo]
 -> CloudFormationStackRecord)
-> Parser (Maybe RecordState)
-> Parser
     (Maybe DestinationInfo
      -> Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RecordState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe DestinationInfo
   -> Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe DestinationInfo)
-> Parser
     (Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DestinationInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"destinationInfo")
            Parser
  (Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe ResourceType)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
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 ResourceLocation
   -> Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
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 ResourceLocation
   -> Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe ResourceLocation)
-> Parser
     (Maybe Text
      -> Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe Text
   -> Maybe [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe [CloudFormationStackRecordSourceInfo]
      -> CloudFormationStackRecord)
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 [CloudFormationStackRecordSourceInfo]
   -> CloudFormationStackRecord)
-> Parser (Maybe [CloudFormationStackRecordSourceInfo])
-> Parser CloudFormationStackRecord
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (Maybe [CloudFormationStackRecordSourceInfo]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceInfo" Parser (Maybe (Maybe [CloudFormationStackRecordSourceInfo]))
-> Maybe [CloudFormationStackRecordSourceInfo]
-> Parser (Maybe [CloudFormationStackRecordSourceInfo])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CloudFormationStackRecordSourceInfo]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable CloudFormationStackRecord

instance Prelude.NFData CloudFormationStackRecord