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

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

-- | The details of a blueprint.
--
-- /See:/ 'newBlueprintDetails' smart constructor.
data BlueprintDetails = BlueprintDetails'
  { -- | The run ID for this blueprint.
    BlueprintDetails -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | The name of the blueprint.
    BlueprintDetails -> Maybe Text
blueprintName :: Prelude.Maybe Prelude.Text
  }
  deriving (BlueprintDetails -> BlueprintDetails -> Bool
(BlueprintDetails -> BlueprintDetails -> Bool)
-> (BlueprintDetails -> BlueprintDetails -> Bool)
-> Eq BlueprintDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlueprintDetails -> BlueprintDetails -> Bool
$c/= :: BlueprintDetails -> BlueprintDetails -> Bool
== :: BlueprintDetails -> BlueprintDetails -> Bool
$c== :: BlueprintDetails -> BlueprintDetails -> Bool
Prelude.Eq, ReadPrec [BlueprintDetails]
ReadPrec BlueprintDetails
Int -> ReadS BlueprintDetails
ReadS [BlueprintDetails]
(Int -> ReadS BlueprintDetails)
-> ReadS [BlueprintDetails]
-> ReadPrec BlueprintDetails
-> ReadPrec [BlueprintDetails]
-> Read BlueprintDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlueprintDetails]
$creadListPrec :: ReadPrec [BlueprintDetails]
readPrec :: ReadPrec BlueprintDetails
$creadPrec :: ReadPrec BlueprintDetails
readList :: ReadS [BlueprintDetails]
$creadList :: ReadS [BlueprintDetails]
readsPrec :: Int -> ReadS BlueprintDetails
$creadsPrec :: Int -> ReadS BlueprintDetails
Prelude.Read, Int -> BlueprintDetails -> ShowS
[BlueprintDetails] -> ShowS
BlueprintDetails -> String
(Int -> BlueprintDetails -> ShowS)
-> (BlueprintDetails -> String)
-> ([BlueprintDetails] -> ShowS)
-> Show BlueprintDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlueprintDetails] -> ShowS
$cshowList :: [BlueprintDetails] -> ShowS
show :: BlueprintDetails -> String
$cshow :: BlueprintDetails -> String
showsPrec :: Int -> BlueprintDetails -> ShowS
$cshowsPrec :: Int -> BlueprintDetails -> ShowS
Prelude.Show, (forall x. BlueprintDetails -> Rep BlueprintDetails x)
-> (forall x. Rep BlueprintDetails x -> BlueprintDetails)
-> Generic BlueprintDetails
forall x. Rep BlueprintDetails x -> BlueprintDetails
forall x. BlueprintDetails -> Rep BlueprintDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BlueprintDetails x -> BlueprintDetails
$cfrom :: forall x. BlueprintDetails -> Rep BlueprintDetails x
Prelude.Generic)

-- |
-- Create a value of 'BlueprintDetails' 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:
--
-- 'runId', 'blueprintDetails_runId' - The run ID for this blueprint.
--
-- 'blueprintName', 'blueprintDetails_blueprintName' - The name of the blueprint.
newBlueprintDetails ::
  BlueprintDetails
newBlueprintDetails :: BlueprintDetails
newBlueprintDetails =
  BlueprintDetails' :: Maybe Text -> Maybe Text -> BlueprintDetails
BlueprintDetails'
    { $sel:runId:BlueprintDetails' :: Maybe Text
runId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintName:BlueprintDetails' :: Maybe Text
blueprintName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The run ID for this blueprint.
blueprintDetails_runId :: Lens.Lens' BlueprintDetails (Prelude.Maybe Prelude.Text)
blueprintDetails_runId :: (Maybe Text -> f (Maybe Text))
-> BlueprintDetails -> f BlueprintDetails
blueprintDetails_runId = (BlueprintDetails -> Maybe Text)
-> (BlueprintDetails -> Maybe Text -> BlueprintDetails)
-> Lens BlueprintDetails BlueprintDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlueprintDetails' {Maybe Text
runId :: Maybe Text
$sel:runId:BlueprintDetails' :: BlueprintDetails -> Maybe Text
runId} -> Maybe Text
runId) (\s :: BlueprintDetails
s@BlueprintDetails' {} Maybe Text
a -> BlueprintDetails
s {$sel:runId:BlueprintDetails' :: Maybe Text
runId = Maybe Text
a} :: BlueprintDetails)

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

instance Core.FromJSON BlueprintDetails where
  parseJSON :: Value -> Parser BlueprintDetails
parseJSON =
    String
-> (Object -> Parser BlueprintDetails)
-> Value
-> Parser BlueprintDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BlueprintDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> BlueprintDetails
BlueprintDetails'
            (Maybe Text -> Maybe Text -> BlueprintDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BlueprintDetails)
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
"RunId")
            Parser (Maybe Text -> BlueprintDetails)
-> Parser (Maybe Text) -> Parser BlueprintDetails
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
"BlueprintName")
      )

instance Prelude.Hashable BlueprintDetails

instance Prelude.NFData BlueprintDetails