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

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

-- | Defines a point that a job can resume processing.
--
-- /See:/ 'newJobBookmarkEntry' smart constructor.
data JobBookmarkEntry = JobBookmarkEntry'
  { -- | The name of the job in question.
    JobBookmarkEntry -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The run ID number.
    JobBookmarkEntry -> Maybe Int
run :: Prelude.Maybe Prelude.Int,
    -- | The run ID number.
    JobBookmarkEntry -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | The version of the job.
    JobBookmarkEntry -> Maybe Int
version :: Prelude.Maybe Prelude.Int,
    -- | The unique run identifier associated with the previous job run.
    JobBookmarkEntry -> Maybe Text
previousRunId :: Prelude.Maybe Prelude.Text,
    -- | The attempt ID number.
    JobBookmarkEntry -> Maybe Int
attempt :: Prelude.Maybe Prelude.Int,
    -- | The bookmark itself.
    JobBookmarkEntry -> Maybe Text
jobBookmark :: Prelude.Maybe Prelude.Text
  }
  deriving (JobBookmarkEntry -> JobBookmarkEntry -> Bool
(JobBookmarkEntry -> JobBookmarkEntry -> Bool)
-> (JobBookmarkEntry -> JobBookmarkEntry -> Bool)
-> Eq JobBookmarkEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobBookmarkEntry -> JobBookmarkEntry -> Bool
$c/= :: JobBookmarkEntry -> JobBookmarkEntry -> Bool
== :: JobBookmarkEntry -> JobBookmarkEntry -> Bool
$c== :: JobBookmarkEntry -> JobBookmarkEntry -> Bool
Prelude.Eq, ReadPrec [JobBookmarkEntry]
ReadPrec JobBookmarkEntry
Int -> ReadS JobBookmarkEntry
ReadS [JobBookmarkEntry]
(Int -> ReadS JobBookmarkEntry)
-> ReadS [JobBookmarkEntry]
-> ReadPrec JobBookmarkEntry
-> ReadPrec [JobBookmarkEntry]
-> Read JobBookmarkEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobBookmarkEntry]
$creadListPrec :: ReadPrec [JobBookmarkEntry]
readPrec :: ReadPrec JobBookmarkEntry
$creadPrec :: ReadPrec JobBookmarkEntry
readList :: ReadS [JobBookmarkEntry]
$creadList :: ReadS [JobBookmarkEntry]
readsPrec :: Int -> ReadS JobBookmarkEntry
$creadsPrec :: Int -> ReadS JobBookmarkEntry
Prelude.Read, Int -> JobBookmarkEntry -> ShowS
[JobBookmarkEntry] -> ShowS
JobBookmarkEntry -> String
(Int -> JobBookmarkEntry -> ShowS)
-> (JobBookmarkEntry -> String)
-> ([JobBookmarkEntry] -> ShowS)
-> Show JobBookmarkEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobBookmarkEntry] -> ShowS
$cshowList :: [JobBookmarkEntry] -> ShowS
show :: JobBookmarkEntry -> String
$cshow :: JobBookmarkEntry -> String
showsPrec :: Int -> JobBookmarkEntry -> ShowS
$cshowsPrec :: Int -> JobBookmarkEntry -> ShowS
Prelude.Show, (forall x. JobBookmarkEntry -> Rep JobBookmarkEntry x)
-> (forall x. Rep JobBookmarkEntry x -> JobBookmarkEntry)
-> Generic JobBookmarkEntry
forall x. Rep JobBookmarkEntry x -> JobBookmarkEntry
forall x. JobBookmarkEntry -> Rep JobBookmarkEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobBookmarkEntry x -> JobBookmarkEntry
$cfrom :: forall x. JobBookmarkEntry -> Rep JobBookmarkEntry x
Prelude.Generic)

-- |
-- Create a value of 'JobBookmarkEntry' 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:
--
-- 'jobName', 'jobBookmarkEntry_jobName' - The name of the job in question.
--
-- 'run', 'jobBookmarkEntry_run' - The run ID number.
--
-- 'runId', 'jobBookmarkEntry_runId' - The run ID number.
--
-- 'version', 'jobBookmarkEntry_version' - The version of the job.
--
-- 'previousRunId', 'jobBookmarkEntry_previousRunId' - The unique run identifier associated with the previous job run.
--
-- 'attempt', 'jobBookmarkEntry_attempt' - The attempt ID number.
--
-- 'jobBookmark', 'jobBookmarkEntry_jobBookmark' - The bookmark itself.
newJobBookmarkEntry ::
  JobBookmarkEntry
newJobBookmarkEntry :: JobBookmarkEntry
newJobBookmarkEntry =
  JobBookmarkEntry' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> JobBookmarkEntry
JobBookmarkEntry'
    { $sel:jobName:JobBookmarkEntry' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:run:JobBookmarkEntry' :: Maybe Int
run = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:runId:JobBookmarkEntry' :: Maybe Text
runId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:JobBookmarkEntry' :: Maybe Int
version = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:previousRunId:JobBookmarkEntry' :: Maybe Text
previousRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attempt:JobBookmarkEntry' :: Maybe Int
attempt = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:jobBookmark:JobBookmarkEntry' :: Maybe Text
jobBookmark = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the job in question.
jobBookmarkEntry_jobName :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Text)
jobBookmarkEntry_jobName :: (Maybe Text -> f (Maybe Text))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_jobName = (JobBookmarkEntry -> Maybe Text)
-> (JobBookmarkEntry -> Maybe Text -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Text
jobName :: Maybe Text
$sel:jobName:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Text
a -> JobBookmarkEntry
s {$sel:jobName:JobBookmarkEntry' :: Maybe Text
jobName = Maybe Text
a} :: JobBookmarkEntry)

-- | The run ID number.
jobBookmarkEntry_run :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Int)
jobBookmarkEntry_run :: (Maybe Int -> f (Maybe Int))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_run = (JobBookmarkEntry -> Maybe Int)
-> (JobBookmarkEntry -> Maybe Int -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Int
run :: Maybe Int
$sel:run:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Int
run} -> Maybe Int
run) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Int
a -> JobBookmarkEntry
s {$sel:run:JobBookmarkEntry' :: Maybe Int
run = Maybe Int
a} :: JobBookmarkEntry)

-- | The run ID number.
jobBookmarkEntry_runId :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Text)
jobBookmarkEntry_runId :: (Maybe Text -> f (Maybe Text))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_runId = (JobBookmarkEntry -> Maybe Text)
-> (JobBookmarkEntry -> Maybe Text -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Text
runId :: Maybe Text
$sel:runId:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Text
runId} -> Maybe Text
runId) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Text
a -> JobBookmarkEntry
s {$sel:runId:JobBookmarkEntry' :: Maybe Text
runId = Maybe Text
a} :: JobBookmarkEntry)

-- | The version of the job.
jobBookmarkEntry_version :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Int)
jobBookmarkEntry_version :: (Maybe Int -> f (Maybe Int))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_version = (JobBookmarkEntry -> Maybe Int)
-> (JobBookmarkEntry -> Maybe Int -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Int
version :: Maybe Int
$sel:version:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Int
version} -> Maybe Int
version) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Int
a -> JobBookmarkEntry
s {$sel:version:JobBookmarkEntry' :: Maybe Int
version = Maybe Int
a} :: JobBookmarkEntry)

-- | The unique run identifier associated with the previous job run.
jobBookmarkEntry_previousRunId :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Text)
jobBookmarkEntry_previousRunId :: (Maybe Text -> f (Maybe Text))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_previousRunId = (JobBookmarkEntry -> Maybe Text)
-> (JobBookmarkEntry -> Maybe Text -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Text
previousRunId :: Maybe Text
$sel:previousRunId:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Text
previousRunId} -> Maybe Text
previousRunId) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Text
a -> JobBookmarkEntry
s {$sel:previousRunId:JobBookmarkEntry' :: Maybe Text
previousRunId = Maybe Text
a} :: JobBookmarkEntry)

-- | The attempt ID number.
jobBookmarkEntry_attempt :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Int)
jobBookmarkEntry_attempt :: (Maybe Int -> f (Maybe Int))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_attempt = (JobBookmarkEntry -> Maybe Int)
-> (JobBookmarkEntry -> Maybe Int -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Int
attempt :: Maybe Int
$sel:attempt:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Int
attempt} -> Maybe Int
attempt) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Int
a -> JobBookmarkEntry
s {$sel:attempt:JobBookmarkEntry' :: Maybe Int
attempt = Maybe Int
a} :: JobBookmarkEntry)

-- | The bookmark itself.
jobBookmarkEntry_jobBookmark :: Lens.Lens' JobBookmarkEntry (Prelude.Maybe Prelude.Text)
jobBookmarkEntry_jobBookmark :: (Maybe Text -> f (Maybe Text))
-> JobBookmarkEntry -> f JobBookmarkEntry
jobBookmarkEntry_jobBookmark = (JobBookmarkEntry -> Maybe Text)
-> (JobBookmarkEntry -> Maybe Text -> JobBookmarkEntry)
-> Lens JobBookmarkEntry JobBookmarkEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobBookmarkEntry' {Maybe Text
jobBookmark :: Maybe Text
$sel:jobBookmark:JobBookmarkEntry' :: JobBookmarkEntry -> Maybe Text
jobBookmark} -> Maybe Text
jobBookmark) (\s :: JobBookmarkEntry
s@JobBookmarkEntry' {} Maybe Text
a -> JobBookmarkEntry
s {$sel:jobBookmark:JobBookmarkEntry' :: Maybe Text
jobBookmark = Maybe Text
a} :: JobBookmarkEntry)

instance Core.FromJSON JobBookmarkEntry where
  parseJSON :: Value -> Parser JobBookmarkEntry
parseJSON =
    String
-> (Object -> Parser JobBookmarkEntry)
-> Value
-> Parser JobBookmarkEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobBookmarkEntry"
      ( \Object
x ->
          Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> JobBookmarkEntry
JobBookmarkEntry'
            (Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> JobBookmarkEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> JobBookmarkEntry)
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
"JobName")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> JobBookmarkEntry)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> JobBookmarkEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Run")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> JobBookmarkEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text -> Maybe Int -> Maybe Text -> JobBookmarkEntry)
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
"RunId")
            Parser
  (Maybe Int
   -> Maybe Text -> Maybe Int -> Maybe Text -> JobBookmarkEntry)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text -> Maybe Int -> Maybe Text -> JobBookmarkEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser (Maybe Text -> Maybe Int -> Maybe Text -> JobBookmarkEntry)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> JobBookmarkEntry)
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
"PreviousRunId")
            Parser (Maybe Int -> Maybe Text -> JobBookmarkEntry)
-> Parser (Maybe Int) -> Parser (Maybe Text -> JobBookmarkEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attempt")
            Parser (Maybe Text -> JobBookmarkEntry)
-> Parser (Maybe Text) -> Parser JobBookmarkEntry
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
"JobBookmark")
      )

instance Prelude.Hashable JobBookmarkEntry

instance Prelude.NFData JobBookmarkEntry