{-# 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.SchemaListItem
-- 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.SchemaListItem 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.SchemaStatus
import qualified Amazonka.Prelude as Prelude

-- | An object that contains minimal details for a schema.
--
-- /See:/ 'newSchemaListItem' smart constructor.
data SchemaListItem = SchemaListItem'
  { -- | The date and time that a schema was created.
    SchemaListItem -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | A description for the schema.
    SchemaListItem -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | the name of the registry where the schema resides.
    SchemaListItem -> Maybe Text
registryName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the schema.
    SchemaListItem -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the schema.
    SchemaListItem -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | The status of the schema.
    SchemaListItem -> Maybe SchemaStatus
schemaStatus :: Prelude.Maybe SchemaStatus,
    -- | The date and time that a schema was updated.
    SchemaListItem -> Maybe Text
updatedTime :: Prelude.Maybe Prelude.Text
  }
  deriving (SchemaListItem -> SchemaListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaListItem -> SchemaListItem -> Bool
$c/= :: SchemaListItem -> SchemaListItem -> Bool
== :: SchemaListItem -> SchemaListItem -> Bool
$c== :: SchemaListItem -> SchemaListItem -> Bool
Prelude.Eq, ReadPrec [SchemaListItem]
ReadPrec SchemaListItem
Int -> ReadS SchemaListItem
ReadS [SchemaListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaListItem]
$creadListPrec :: ReadPrec [SchemaListItem]
readPrec :: ReadPrec SchemaListItem
$creadPrec :: ReadPrec SchemaListItem
readList :: ReadS [SchemaListItem]
$creadList :: ReadS [SchemaListItem]
readsPrec :: Int -> ReadS SchemaListItem
$creadsPrec :: Int -> ReadS SchemaListItem
Prelude.Read, Int -> SchemaListItem -> ShowS
[SchemaListItem] -> ShowS
SchemaListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaListItem] -> ShowS
$cshowList :: [SchemaListItem] -> ShowS
show :: SchemaListItem -> String
$cshow :: SchemaListItem -> String
showsPrec :: Int -> SchemaListItem -> ShowS
$cshowsPrec :: Int -> SchemaListItem -> ShowS
Prelude.Show, forall x. Rep SchemaListItem x -> SchemaListItem
forall x. SchemaListItem -> Rep SchemaListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaListItem x -> SchemaListItem
$cfrom :: forall x. SchemaListItem -> Rep SchemaListItem x
Prelude.Generic)

-- |
-- Create a value of 'SchemaListItem' 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', 'schemaListItem_createdTime' - The date and time that a schema was created.
--
-- 'description', 'schemaListItem_description' - A description for the schema.
--
-- 'registryName', 'schemaListItem_registryName' - the name of the registry where the schema resides.
--
-- 'schemaArn', 'schemaListItem_schemaArn' - The Amazon Resource Name (ARN) for the schema.
--
-- 'schemaName', 'schemaListItem_schemaName' - The name of the schema.
--
-- 'schemaStatus', 'schemaListItem_schemaStatus' - The status of the schema.
--
-- 'updatedTime', 'schemaListItem_updatedTime' - The date and time that a schema was updated.
newSchemaListItem ::
  SchemaListItem
newSchemaListItem :: SchemaListItem
newSchemaListItem =
  SchemaListItem'
    { $sel:createdTime:SchemaListItem' :: Maybe Text
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SchemaListItem' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:registryName:SchemaListItem' :: Maybe Text
registryName = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:SchemaListItem' :: Maybe Text
schemaArn = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:SchemaListItem' :: Maybe Text
schemaName = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaStatus:SchemaListItem' :: Maybe SchemaStatus
schemaStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTime:SchemaListItem' :: Maybe Text
updatedTime = forall a. Maybe a
Prelude.Nothing
    }

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

-- | A description for the schema.
schemaListItem_description :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_description :: Lens' SchemaListItem (Maybe Text)
schemaListItem_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaListItem' {Maybe Text
description :: Maybe Text
$sel:description:SchemaListItem' :: SchemaListItem -> Maybe Text
description} -> Maybe Text
description) (\s :: SchemaListItem
s@SchemaListItem' {} Maybe Text
a -> SchemaListItem
s {$sel:description:SchemaListItem' :: Maybe Text
description = Maybe Text
a} :: SchemaListItem)

-- | the name of the registry where the schema resides.
schemaListItem_registryName :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_registryName :: Lens' SchemaListItem (Maybe Text)
schemaListItem_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaListItem' {Maybe Text
registryName :: Maybe Text
$sel:registryName:SchemaListItem' :: SchemaListItem -> Maybe Text
registryName} -> Maybe Text
registryName) (\s :: SchemaListItem
s@SchemaListItem' {} Maybe Text
a -> SchemaListItem
s {$sel:registryName:SchemaListItem' :: Maybe Text
registryName = Maybe Text
a} :: SchemaListItem)

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

-- | The name of the schema.
schemaListItem_schemaName :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_schemaName :: Lens' SchemaListItem (Maybe Text)
schemaListItem_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaListItem' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:SchemaListItem' :: SchemaListItem -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: SchemaListItem
s@SchemaListItem' {} Maybe Text
a -> SchemaListItem
s {$sel:schemaName:SchemaListItem' :: Maybe Text
schemaName = Maybe Text
a} :: SchemaListItem)

-- | The status of the schema.
schemaListItem_schemaStatus :: Lens.Lens' SchemaListItem (Prelude.Maybe SchemaStatus)
schemaListItem_schemaStatus :: Lens' SchemaListItem (Maybe SchemaStatus)
schemaListItem_schemaStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaListItem' {Maybe SchemaStatus
schemaStatus :: Maybe SchemaStatus
$sel:schemaStatus:SchemaListItem' :: SchemaListItem -> Maybe SchemaStatus
schemaStatus} -> Maybe SchemaStatus
schemaStatus) (\s :: SchemaListItem
s@SchemaListItem' {} Maybe SchemaStatus
a -> SchemaListItem
s {$sel:schemaStatus:SchemaListItem' :: Maybe SchemaStatus
schemaStatus = Maybe SchemaStatus
a} :: SchemaListItem)

-- | The date and time that a schema was updated.
schemaListItem_updatedTime :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_updatedTime :: Lens' SchemaListItem (Maybe Text)
schemaListItem_updatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaListItem' {Maybe Text
updatedTime :: Maybe Text
$sel:updatedTime:SchemaListItem' :: SchemaListItem -> Maybe Text
updatedTime} -> Maybe Text
updatedTime) (\s :: SchemaListItem
s@SchemaListItem' {} Maybe Text
a -> SchemaListItem
s {$sel:updatedTime:SchemaListItem' :: Maybe Text
updatedTime = Maybe Text
a} :: SchemaListItem)

instance Data.FromJSON SchemaListItem where
  parseJSON :: Value -> Parser SchemaListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SchemaListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SchemaStatus
-> Maybe Text
-> SchemaListItem
SchemaListItem'
            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
"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
"RegistryName")
            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
"SchemaName")
            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
"SchemaStatus")
            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
"UpdatedTime")
      )

instance Prelude.Hashable SchemaListItem where
  hashWithSalt :: Int -> SchemaListItem -> Int
hashWithSalt Int
_salt SchemaListItem' {Maybe Text
Maybe SchemaStatus
updatedTime :: Maybe Text
schemaStatus :: Maybe SchemaStatus
schemaName :: Maybe Text
schemaArn :: Maybe Text
registryName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
$sel:updatedTime:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:schemaStatus:SchemaListItem' :: SchemaListItem -> Maybe SchemaStatus
$sel:schemaName:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:schemaArn:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:registryName:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:description:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:createdTime:SchemaListItem' :: SchemaListItem -> 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
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
registryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaStatus
schemaStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
updatedTime

instance Prelude.NFData SchemaListItem where
  rnf :: SchemaListItem -> ()
rnf SchemaListItem' {Maybe Text
Maybe SchemaStatus
updatedTime :: Maybe Text
schemaStatus :: Maybe SchemaStatus
schemaName :: Maybe Text
schemaArn :: Maybe Text
registryName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
$sel:updatedTime:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:schemaStatus:SchemaListItem' :: SchemaListItem -> Maybe SchemaStatus
$sel:schemaName:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:schemaArn:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:registryName:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:description:SchemaListItem' :: SchemaListItem -> Maybe Text
$sel:createdTime:SchemaListItem' :: SchemaListItem -> 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
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registryName
      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
schemaName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SchemaStatus
schemaStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
updatedTime