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

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.SchemaStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that contains minimal details for a schema.
--
-- /See:/ 'newSchemaListItem' smart constructor.
data SchemaListItem = SchemaListItem'
  { -- | the name of the registry where the schema resides.
    SchemaListItem -> Maybe Text
registryName :: Prelude.Maybe Prelude.Text,
    -- | The date and time that a schema was created.
    SchemaListItem -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The status of the schema.
    SchemaListItem -> Maybe SchemaStatus
schemaStatus :: Prelude.Maybe SchemaStatus,
    -- | The name of the schema.
    SchemaListItem -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the schema.
    SchemaListItem -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that a schema was updated.
    SchemaListItem -> Maybe Text
updatedTime :: Prelude.Maybe Prelude.Text,
    -- | A description for the schema.
    SchemaListItem -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (SchemaListItem -> SchemaListItem -> Bool
(SchemaListItem -> SchemaListItem -> Bool)
-> (SchemaListItem -> SchemaListItem -> Bool) -> Eq SchemaListItem
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]
(Int -> ReadS SchemaListItem)
-> ReadS [SchemaListItem]
-> ReadPrec SchemaListItem
-> ReadPrec [SchemaListItem]
-> Read 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
(Int -> SchemaListItem -> ShowS)
-> (SchemaListItem -> String)
-> ([SchemaListItem] -> ShowS)
-> Show SchemaListItem
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. SchemaListItem -> Rep SchemaListItem x)
-> (forall x. Rep SchemaListItem x -> SchemaListItem)
-> Generic SchemaListItem
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:
--
-- 'registryName', 'schemaListItem_registryName' - the name of the registry where the schema resides.
--
-- 'createdTime', 'schemaListItem_createdTime' - The date and time that a schema was created.
--
-- 'schemaStatus', 'schemaListItem_schemaStatus' - The status of the schema.
--
-- 'schemaName', 'schemaListItem_schemaName' - The name of the schema.
--
-- 'schemaArn', 'schemaListItem_schemaArn' - The Amazon Resource Name (ARN) for the schema.
--
-- 'updatedTime', 'schemaListItem_updatedTime' - The date and time that a schema was updated.
--
-- 'description', 'schemaListItem_description' - A description for the schema.
newSchemaListItem ::
  SchemaListItem
newSchemaListItem :: SchemaListItem
newSchemaListItem =
  SchemaListItem' :: Maybe Text
-> Maybe Text
-> Maybe SchemaStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaListItem
SchemaListItem'
    { $sel:registryName:SchemaListItem' :: Maybe Text
registryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:SchemaListItem' :: Maybe Text
createdTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaStatus:SchemaListItem' :: Maybe SchemaStatus
schemaStatus = Maybe SchemaStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:SchemaListItem' :: Maybe Text
schemaName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:SchemaListItem' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTime:SchemaListItem' :: Maybe Text
updatedTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:SchemaListItem' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | the name of the registry where the schema resides.
schemaListItem_registryName :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_registryName :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_registryName = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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 date and time that a schema was created.
schemaListItem_createdTime :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_createdTime :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_createdTime = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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)

-- | The status of the schema.
schemaListItem_schemaStatus :: Lens.Lens' SchemaListItem (Prelude.Maybe SchemaStatus)
schemaListItem_schemaStatus :: (Maybe SchemaStatus -> f (Maybe SchemaStatus))
-> SchemaListItem -> f SchemaListItem
schemaListItem_schemaStatus = (SchemaListItem -> Maybe SchemaStatus)
-> (SchemaListItem -> Maybe SchemaStatus -> SchemaListItem)
-> Lens
     SchemaListItem
     SchemaListItem
     (Maybe SchemaStatus)
     (Maybe 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 name of the schema.
schemaListItem_schemaName :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_schemaName :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_schemaName = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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 Amazon Resource Name (ARN) for the schema.
schemaListItem_schemaArn :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_schemaArn :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_schemaArn = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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 date and time that a schema was updated.
schemaListItem_updatedTime :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_updatedTime :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_updatedTime = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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)

-- | A description for the schema.
schemaListItem_description :: Lens.Lens' SchemaListItem (Prelude.Maybe Prelude.Text)
schemaListItem_description :: (Maybe Text -> f (Maybe Text))
-> SchemaListItem -> f SchemaListItem
schemaListItem_description = (SchemaListItem -> Maybe Text)
-> (SchemaListItem -> Maybe Text -> SchemaListItem)
-> Lens SchemaListItem SchemaListItem (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON SchemaListItem where
  parseJSON :: Value -> Parser SchemaListItem
parseJSON =
    String
-> (Object -> Parser SchemaListItem)
-> Value
-> Parser SchemaListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SchemaListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe SchemaStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SchemaListItem
SchemaListItem'
            (Maybe Text
 -> Maybe Text
 -> Maybe SchemaStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> SchemaListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe SchemaStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> SchemaListItem)
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
"RegistryName")
            Parser
  (Maybe Text
   -> Maybe SchemaStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> SchemaListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe SchemaStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> SchemaListItem)
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
"CreatedTime")
            Parser
  (Maybe SchemaStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> SchemaListItem)
-> Parser (Maybe SchemaStatus)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> SchemaListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SchemaStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SchemaStatus")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> SchemaListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> SchemaListItem)
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
"SchemaName")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> SchemaListItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SchemaListItem)
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
"SchemaArn")
            Parser (Maybe Text -> Maybe Text -> SchemaListItem)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SchemaListItem)
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
"UpdatedTime")
            Parser (Maybe Text -> SchemaListItem)
-> Parser (Maybe Text) -> Parser SchemaListItem
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
"Description")
      )

instance Prelude.Hashable SchemaListItem

instance Prelude.NFData SchemaListItem