{-# 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.Glue.Types.LastActiveDefinition
-- 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.Glue.Types.LastActiveDefinition where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | When there are multiple versions of a blueprint and the latest version
-- has some errors, this attribute indicates the last successful blueprint
-- definition that is available with the service.
--
-- /See:/ 'newLastActiveDefinition' smart constructor.
data LastActiveDefinition = LastActiveDefinition'
  { -- | A JSON string specifying the parameters for the blueprint.
    LastActiveDefinition -> Maybe Text
parameterSpec :: Prelude.Maybe Prelude.Text,
    -- | Specifies a path in Amazon S3 where the blueprint is published by the
    -- Glue developer.
    LastActiveDefinition -> Maybe Text
blueprintLocation :: Prelude.Maybe Prelude.Text,
    -- | The date and time the blueprint was last modified.
    LastActiveDefinition -> Maybe POSIX
lastModifiedOn :: Prelude.Maybe Core.POSIX,
    -- | Specifies a path in Amazon S3 where the blueprint is copied when you
    -- create or update the blueprint.
    LastActiveDefinition -> Maybe Text
blueprintServiceLocation :: Prelude.Maybe Prelude.Text,
    -- | The description of the blueprint.
    LastActiveDefinition -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (LastActiveDefinition -> LastActiveDefinition -> Bool
(LastActiveDefinition -> LastActiveDefinition -> Bool)
-> (LastActiveDefinition -> LastActiveDefinition -> Bool)
-> Eq LastActiveDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LastActiveDefinition -> LastActiveDefinition -> Bool
$c/= :: LastActiveDefinition -> LastActiveDefinition -> Bool
== :: LastActiveDefinition -> LastActiveDefinition -> Bool
$c== :: LastActiveDefinition -> LastActiveDefinition -> Bool
Prelude.Eq, ReadPrec [LastActiveDefinition]
ReadPrec LastActiveDefinition
Int -> ReadS LastActiveDefinition
ReadS [LastActiveDefinition]
(Int -> ReadS LastActiveDefinition)
-> ReadS [LastActiveDefinition]
-> ReadPrec LastActiveDefinition
-> ReadPrec [LastActiveDefinition]
-> Read LastActiveDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LastActiveDefinition]
$creadListPrec :: ReadPrec [LastActiveDefinition]
readPrec :: ReadPrec LastActiveDefinition
$creadPrec :: ReadPrec LastActiveDefinition
readList :: ReadS [LastActiveDefinition]
$creadList :: ReadS [LastActiveDefinition]
readsPrec :: Int -> ReadS LastActiveDefinition
$creadsPrec :: Int -> ReadS LastActiveDefinition
Prelude.Read, Int -> LastActiveDefinition -> ShowS
[LastActiveDefinition] -> ShowS
LastActiveDefinition -> String
(Int -> LastActiveDefinition -> ShowS)
-> (LastActiveDefinition -> String)
-> ([LastActiveDefinition] -> ShowS)
-> Show LastActiveDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LastActiveDefinition] -> ShowS
$cshowList :: [LastActiveDefinition] -> ShowS
show :: LastActiveDefinition -> String
$cshow :: LastActiveDefinition -> String
showsPrec :: Int -> LastActiveDefinition -> ShowS
$cshowsPrec :: Int -> LastActiveDefinition -> ShowS
Prelude.Show, (forall x. LastActiveDefinition -> Rep LastActiveDefinition x)
-> (forall x. Rep LastActiveDefinition x -> LastActiveDefinition)
-> Generic LastActiveDefinition
forall x. Rep LastActiveDefinition x -> LastActiveDefinition
forall x. LastActiveDefinition -> Rep LastActiveDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LastActiveDefinition x -> LastActiveDefinition
$cfrom :: forall x. LastActiveDefinition -> Rep LastActiveDefinition x
Prelude.Generic)

-- |
-- Create a value of 'LastActiveDefinition' 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:
--
-- 'parameterSpec', 'lastActiveDefinition_parameterSpec' - A JSON string specifying the parameters for the blueprint.
--
-- 'blueprintLocation', 'lastActiveDefinition_blueprintLocation' - Specifies a path in Amazon S3 where the blueprint is published by the
-- Glue developer.
--
-- 'lastModifiedOn', 'lastActiveDefinition_lastModifiedOn' - The date and time the blueprint was last modified.
--
-- 'blueprintServiceLocation', 'lastActiveDefinition_blueprintServiceLocation' - Specifies a path in Amazon S3 where the blueprint is copied when you
-- create or update the blueprint.
--
-- 'description', 'lastActiveDefinition_description' - The description of the blueprint.
newLastActiveDefinition ::
  LastActiveDefinition
newLastActiveDefinition :: LastActiveDefinition
newLastActiveDefinition =
  LastActiveDefinition' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> LastActiveDefinition
LastActiveDefinition'
    { $sel:parameterSpec:LastActiveDefinition' :: Maybe Text
parameterSpec =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintLocation:LastActiveDefinition' :: Maybe Text
blueprintLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedOn:LastActiveDefinition' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintServiceLocation:LastActiveDefinition' :: Maybe Text
blueprintServiceLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:LastActiveDefinition' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A JSON string specifying the parameters for the blueprint.
lastActiveDefinition_parameterSpec :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.Text)
lastActiveDefinition_parameterSpec :: (Maybe Text -> f (Maybe Text))
-> LastActiveDefinition -> f LastActiveDefinition
lastActiveDefinition_parameterSpec = (LastActiveDefinition -> Maybe Text)
-> (LastActiveDefinition -> Maybe Text -> LastActiveDefinition)
-> Lens
     LastActiveDefinition LastActiveDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LastActiveDefinition' {Maybe Text
parameterSpec :: Maybe Text
$sel:parameterSpec:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
parameterSpec} -> Maybe Text
parameterSpec) (\s :: LastActiveDefinition
s@LastActiveDefinition' {} Maybe Text
a -> LastActiveDefinition
s {$sel:parameterSpec:LastActiveDefinition' :: Maybe Text
parameterSpec = Maybe Text
a} :: LastActiveDefinition)

-- | Specifies a path in Amazon S3 where the blueprint is published by the
-- Glue developer.
lastActiveDefinition_blueprintLocation :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.Text)
lastActiveDefinition_blueprintLocation :: (Maybe Text -> f (Maybe Text))
-> LastActiveDefinition -> f LastActiveDefinition
lastActiveDefinition_blueprintLocation = (LastActiveDefinition -> Maybe Text)
-> (LastActiveDefinition -> Maybe Text -> LastActiveDefinition)
-> Lens
     LastActiveDefinition LastActiveDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LastActiveDefinition' {Maybe Text
blueprintLocation :: Maybe Text
$sel:blueprintLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
blueprintLocation} -> Maybe Text
blueprintLocation) (\s :: LastActiveDefinition
s@LastActiveDefinition' {} Maybe Text
a -> LastActiveDefinition
s {$sel:blueprintLocation:LastActiveDefinition' :: Maybe Text
blueprintLocation = Maybe Text
a} :: LastActiveDefinition)

-- | The date and time the blueprint was last modified.
lastActiveDefinition_lastModifiedOn :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.UTCTime)
lastActiveDefinition_lastModifiedOn :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LastActiveDefinition -> f LastActiveDefinition
lastActiveDefinition_lastModifiedOn = (LastActiveDefinition -> Maybe POSIX)
-> (LastActiveDefinition -> Maybe POSIX -> LastActiveDefinition)
-> Lens
     LastActiveDefinition
     LastActiveDefinition
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LastActiveDefinition' {Maybe POSIX
lastModifiedOn :: Maybe POSIX
$sel:lastModifiedOn:LastActiveDefinition' :: LastActiveDefinition -> Maybe POSIX
lastModifiedOn} -> Maybe POSIX
lastModifiedOn) (\s :: LastActiveDefinition
s@LastActiveDefinition' {} Maybe POSIX
a -> LastActiveDefinition
s {$sel:lastModifiedOn:LastActiveDefinition' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
a} :: LastActiveDefinition) ((Maybe POSIX -> f (Maybe POSIX))
 -> LastActiveDefinition -> f LastActiveDefinition)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LastActiveDefinition
-> f LastActiveDefinition
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

-- | Specifies a path in Amazon S3 where the blueprint is copied when you
-- create or update the blueprint.
lastActiveDefinition_blueprintServiceLocation :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.Text)
lastActiveDefinition_blueprintServiceLocation :: (Maybe Text -> f (Maybe Text))
-> LastActiveDefinition -> f LastActiveDefinition
lastActiveDefinition_blueprintServiceLocation = (LastActiveDefinition -> Maybe Text)
-> (LastActiveDefinition -> Maybe Text -> LastActiveDefinition)
-> Lens
     LastActiveDefinition LastActiveDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LastActiveDefinition' {Maybe Text
blueprintServiceLocation :: Maybe Text
$sel:blueprintServiceLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
blueprintServiceLocation} -> Maybe Text
blueprintServiceLocation) (\s :: LastActiveDefinition
s@LastActiveDefinition' {} Maybe Text
a -> LastActiveDefinition
s {$sel:blueprintServiceLocation:LastActiveDefinition' :: Maybe Text
blueprintServiceLocation = Maybe Text
a} :: LastActiveDefinition)

-- | The description of the blueprint.
lastActiveDefinition_description :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.Text)
lastActiveDefinition_description :: (Maybe Text -> f (Maybe Text))
-> LastActiveDefinition -> f LastActiveDefinition
lastActiveDefinition_description = (LastActiveDefinition -> Maybe Text)
-> (LastActiveDefinition -> Maybe Text -> LastActiveDefinition)
-> Lens
     LastActiveDefinition LastActiveDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LastActiveDefinition' {Maybe Text
description :: Maybe Text
$sel:description:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
description} -> Maybe Text
description) (\s :: LastActiveDefinition
s@LastActiveDefinition' {} Maybe Text
a -> LastActiveDefinition
s {$sel:description:LastActiveDefinition' :: Maybe Text
description = Maybe Text
a} :: LastActiveDefinition)

instance Core.FromJSON LastActiveDefinition where
  parseJSON :: Value -> Parser LastActiveDefinition
parseJSON =
    String
-> (Object -> Parser LastActiveDefinition)
-> Value
-> Parser LastActiveDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LastActiveDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> LastActiveDefinition
LastActiveDefinition'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> LastActiveDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe Text -> LastActiveDefinition)
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
"ParameterSpec")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe Text -> LastActiveDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe Text -> LastActiveDefinition)
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
"BlueprintLocation")
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe Text -> LastActiveDefinition)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> LastActiveDefinition)
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
"LastModifiedOn")
            Parser (Maybe Text -> Maybe Text -> LastActiveDefinition)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LastActiveDefinition)
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
"BlueprintServiceLocation")
            Parser (Maybe Text -> LastActiveDefinition)
-> Parser (Maybe Text) -> Parser LastActiveDefinition
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
"Description")
      )

instance Prelude.Hashable LastActiveDefinition

instance Prelude.NFData LastActiveDefinition