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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.SchemaVersionStatus
import qualified Amazonka.Prelude as Prelude

-- | An object containing the details about a schema version.
--
-- /See:/ 'newSchemaVersionListItem' smart constructor.
data SchemaVersionListItem = SchemaVersionListItem'
  { -- | The date and time the schema version was created.
    SchemaVersionListItem -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the schema.
    SchemaVersionListItem -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the schema version.
    SchemaVersionListItem -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | The status of the schema version.
    SchemaVersionListItem -> Maybe SchemaVersionStatus
status :: Prelude.Maybe SchemaVersionStatus,
    -- | The version number of the schema.
    SchemaVersionListItem -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural
  }
  deriving (SchemaVersionListItem -> SchemaVersionListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaVersionListItem -> SchemaVersionListItem -> Bool
$c/= :: SchemaVersionListItem -> SchemaVersionListItem -> Bool
== :: SchemaVersionListItem -> SchemaVersionListItem -> Bool
$c== :: SchemaVersionListItem -> SchemaVersionListItem -> Bool
Prelude.Eq, ReadPrec [SchemaVersionListItem]
ReadPrec SchemaVersionListItem
Int -> ReadS SchemaVersionListItem
ReadS [SchemaVersionListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaVersionListItem]
$creadListPrec :: ReadPrec [SchemaVersionListItem]
readPrec :: ReadPrec SchemaVersionListItem
$creadPrec :: ReadPrec SchemaVersionListItem
readList :: ReadS [SchemaVersionListItem]
$creadList :: ReadS [SchemaVersionListItem]
readsPrec :: Int -> ReadS SchemaVersionListItem
$creadsPrec :: Int -> ReadS SchemaVersionListItem
Prelude.Read, Int -> SchemaVersionListItem -> ShowS
[SchemaVersionListItem] -> ShowS
SchemaVersionListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaVersionListItem] -> ShowS
$cshowList :: [SchemaVersionListItem] -> ShowS
show :: SchemaVersionListItem -> String
$cshow :: SchemaVersionListItem -> String
showsPrec :: Int -> SchemaVersionListItem -> ShowS
$cshowsPrec :: Int -> SchemaVersionListItem -> ShowS
Prelude.Show, forall x. Rep SchemaVersionListItem x -> SchemaVersionListItem
forall x. SchemaVersionListItem -> Rep SchemaVersionListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaVersionListItem x -> SchemaVersionListItem
$cfrom :: forall x. SchemaVersionListItem -> Rep SchemaVersionListItem x
Prelude.Generic)

-- |
-- Create a value of 'SchemaVersionListItem' 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:
--
-- 'createdTime', 'schemaVersionListItem_createdTime' - The date and time the schema version was created.
--
-- 'schemaArn', 'schemaVersionListItem_schemaArn' - The Amazon Resource Name (ARN) of the schema.
--
-- 'schemaVersionId', 'schemaVersionListItem_schemaVersionId' - The unique identifier of the schema version.
--
-- 'status', 'schemaVersionListItem_status' - The status of the schema version.
--
-- 'versionNumber', 'schemaVersionListItem_versionNumber' - The version number of the schema.
newSchemaVersionListItem ::
  SchemaVersionListItem
newSchemaVersionListItem :: SchemaVersionListItem
newSchemaVersionListItem =
  SchemaVersionListItem'
    { $sel:createdTime:SchemaVersionListItem' :: Maybe Text
createdTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:SchemaVersionListItem' :: Maybe Text
schemaArn = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersionId:SchemaVersionListItem' :: Maybe Text
schemaVersionId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:SchemaVersionListItem' :: Maybe SchemaVersionStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:SchemaVersionListItem' :: Maybe Natural
versionNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time the schema version was created.
schemaVersionListItem_createdTime :: Lens.Lens' SchemaVersionListItem (Prelude.Maybe Prelude.Text)
schemaVersionListItem_createdTime :: Lens' SchemaVersionListItem (Maybe Text)
schemaVersionListItem_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionListItem' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: SchemaVersionListItem
s@SchemaVersionListItem' {} Maybe Text
a -> SchemaVersionListItem
s {$sel:createdTime:SchemaVersionListItem' :: Maybe Text
createdTime = Maybe Text
a} :: SchemaVersionListItem)

-- | The Amazon Resource Name (ARN) of the schema.
schemaVersionListItem_schemaArn :: Lens.Lens' SchemaVersionListItem (Prelude.Maybe Prelude.Text)
schemaVersionListItem_schemaArn :: Lens' SchemaVersionListItem (Maybe Text)
schemaVersionListItem_schemaArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionListItem' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: SchemaVersionListItem
s@SchemaVersionListItem' {} Maybe Text
a -> SchemaVersionListItem
s {$sel:schemaArn:SchemaVersionListItem' :: Maybe Text
schemaArn = Maybe Text
a} :: SchemaVersionListItem)

-- | The unique identifier of the schema version.
schemaVersionListItem_schemaVersionId :: Lens.Lens' SchemaVersionListItem (Prelude.Maybe Prelude.Text)
schemaVersionListItem_schemaVersionId :: Lens' SchemaVersionListItem (Maybe Text)
schemaVersionListItem_schemaVersionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionListItem' {Maybe Text
schemaVersionId :: Maybe Text
$sel:schemaVersionId:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
schemaVersionId} -> Maybe Text
schemaVersionId) (\s :: SchemaVersionListItem
s@SchemaVersionListItem' {} Maybe Text
a -> SchemaVersionListItem
s {$sel:schemaVersionId:SchemaVersionListItem' :: Maybe Text
schemaVersionId = Maybe Text
a} :: SchemaVersionListItem)

-- | The status of the schema version.
schemaVersionListItem_status :: Lens.Lens' SchemaVersionListItem (Prelude.Maybe SchemaVersionStatus)
schemaVersionListItem_status :: Lens' SchemaVersionListItem (Maybe SchemaVersionStatus)
schemaVersionListItem_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionListItem' {Maybe SchemaVersionStatus
status :: Maybe SchemaVersionStatus
$sel:status:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe SchemaVersionStatus
status} -> Maybe SchemaVersionStatus
status) (\s :: SchemaVersionListItem
s@SchemaVersionListItem' {} Maybe SchemaVersionStatus
a -> SchemaVersionListItem
s {$sel:status:SchemaVersionListItem' :: Maybe SchemaVersionStatus
status = Maybe SchemaVersionStatus
a} :: SchemaVersionListItem)

-- | The version number of the schema.
schemaVersionListItem_versionNumber :: Lens.Lens' SchemaVersionListItem (Prelude.Maybe Prelude.Natural)
schemaVersionListItem_versionNumber :: Lens' SchemaVersionListItem (Maybe Natural)
schemaVersionListItem_versionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionListItem' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: SchemaVersionListItem
s@SchemaVersionListItem' {} Maybe Natural
a -> SchemaVersionListItem
s {$sel:versionNumber:SchemaVersionListItem' :: Maybe Natural
versionNumber = Maybe Natural
a} :: SchemaVersionListItem)

instance Data.FromJSON SchemaVersionListItem where
  parseJSON :: Value -> Parser SchemaVersionListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SchemaVersionListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SchemaVersionStatus
-> Maybe Natural
-> SchemaVersionListItem
SchemaVersionListItem'
            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
"CreatedTime")
            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
"SchemaArn")
            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
"SchemaVersionId")
            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
"Status")
            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
"VersionNumber")
      )

instance Prelude.Hashable SchemaVersionListItem where
  hashWithSalt :: Int -> SchemaVersionListItem -> Int
hashWithSalt Int
_salt SchemaVersionListItem' {Maybe Natural
Maybe Text
Maybe SchemaVersionStatus
versionNumber :: Maybe Natural
status :: Maybe SchemaVersionStatus
schemaVersionId :: Maybe Text
schemaArn :: Maybe Text
createdTime :: Maybe Text
$sel:versionNumber:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Natural
$sel:status:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe SchemaVersionStatus
$sel:schemaVersionId:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
$sel:schemaArn:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
$sel:createdTime:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaVersionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaVersionStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
versionNumber

instance Prelude.NFData SchemaVersionListItem where
  rnf :: SchemaVersionListItem -> ()
rnf SchemaVersionListItem' {Maybe Natural
Maybe Text
Maybe SchemaVersionStatus
versionNumber :: Maybe Natural
status :: Maybe SchemaVersionStatus
schemaVersionId :: Maybe Text
schemaArn :: Maybe Text
createdTime :: Maybe Text
$sel:versionNumber:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Natural
$sel:status:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe SchemaVersionStatus
$sel:schemaVersionId:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
$sel:schemaArn:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
$sel:createdTime:SchemaVersionListItem' :: SchemaVersionListItem -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaVersionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SchemaVersionStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
versionNumber