{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.LastActiveDefinition where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | Specifies a path in Amazon S3 where the blueprint is published by the
    -- Glue developer.
    LastActiveDefinition -> Maybe Text
blueprintLocation :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | The date and time the blueprint was last modified.
    LastActiveDefinition -> Maybe POSIX
lastModifiedOn :: Prelude.Maybe Data.POSIX,
    -- | A JSON string specifying the parameters for the blueprint.
    LastActiveDefinition -> Maybe Text
parameterSpec :: Prelude.Maybe Prelude.Text
  }
  deriving (LastActiveDefinition -> LastActiveDefinition -> Bool
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]
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
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. 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:
--
-- 'blueprintLocation', 'lastActiveDefinition_blueprintLocation' - Specifies a path in Amazon S3 where the blueprint is published by the
-- Glue developer.
--
-- '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.
--
-- 'lastModifiedOn', 'lastActiveDefinition_lastModifiedOn' - The date and time the blueprint was last modified.
--
-- 'parameterSpec', 'lastActiveDefinition_parameterSpec' - A JSON string specifying the parameters for the blueprint.
newLastActiveDefinition ::
  LastActiveDefinition
newLastActiveDefinition :: LastActiveDefinition
newLastActiveDefinition =
  LastActiveDefinition'
    { $sel:blueprintLocation:LastActiveDefinition' :: Maybe Text
blueprintLocation =
        forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintServiceLocation:LastActiveDefinition' :: Maybe Text
blueprintServiceLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:description:LastActiveDefinition' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedOn:LastActiveDefinition' :: Maybe POSIX
lastModifiedOn = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterSpec:LastActiveDefinition' :: Maybe Text
parameterSpec = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' LastActiveDefinition (Maybe Text)
lastActiveDefinition_blueprintLocation = 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)

-- | 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 :: Lens' LastActiveDefinition (Maybe Text)
lastActiveDefinition_blueprintServiceLocation = 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 :: Lens' LastActiveDefinition (Maybe Text)
lastActiveDefinition_description = 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)

-- | The date and time the blueprint was last modified.
lastActiveDefinition_lastModifiedOn :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.UTCTime)
lastActiveDefinition_lastModifiedOn :: Lens' LastActiveDefinition (Maybe UTCTime)
lastActiveDefinition_lastModifiedOn = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A JSON string specifying the parameters for the blueprint.
lastActiveDefinition_parameterSpec :: Lens.Lens' LastActiveDefinition (Prelude.Maybe Prelude.Text)
lastActiveDefinition_parameterSpec :: Lens' LastActiveDefinition (Maybe Text)
lastActiveDefinition_parameterSpec = 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)

instance Data.FromJSON LastActiveDefinition where
  parseJSON :: Value -> Parser LastActiveDefinition
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LastActiveDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> LastActiveDefinition
LastActiveDefinition'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BlueprintLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BlueprintServiceLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastModifiedOn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParameterSpec")
      )

instance Prelude.Hashable LastActiveDefinition where
  hashWithSalt :: Int -> LastActiveDefinition -> Int
hashWithSalt Int
_salt LastActiveDefinition' {Maybe Text
Maybe POSIX
parameterSpec :: Maybe Text
lastModifiedOn :: Maybe POSIX
description :: Maybe Text
blueprintServiceLocation :: Maybe Text
blueprintLocation :: Maybe Text
$sel:parameterSpec:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:lastModifiedOn:LastActiveDefinition' :: LastActiveDefinition -> Maybe POSIX
$sel:description:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:blueprintServiceLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:blueprintLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
blueprintLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
blueprintServiceLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedOn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterSpec

instance Prelude.NFData LastActiveDefinition where
  rnf :: LastActiveDefinition -> ()
rnf LastActiveDefinition' {Maybe Text
Maybe POSIX
parameterSpec :: Maybe Text
lastModifiedOn :: Maybe POSIX
description :: Maybe Text
blueprintServiceLocation :: Maybe Text
blueprintLocation :: Maybe Text
$sel:parameterSpec:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:lastModifiedOn:LastActiveDefinition' :: LastActiveDefinition -> Maybe POSIX
$sel:description:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:blueprintServiceLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
$sel:blueprintLocation:LastActiveDefinition' :: LastActiveDefinition -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
blueprintLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
blueprintServiceLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedOn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterSpec