{-# 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.Schemas.Types.SchemaVersionSummary
-- 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.Schemas.Types.SchemaVersionSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Schemas.Types.Type

-- | /See:/ 'newSchemaVersionSummary' smart constructor.
data SchemaVersionSummary = SchemaVersionSummary'
  { -- | The version number of the schema.
    SchemaVersionSummary -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the schema.
    SchemaVersionSummary -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the schema version.
    SchemaVersionSummary -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The type of schema.
    SchemaVersionSummary -> Maybe Type
type' :: Prelude.Maybe Type
  }
  deriving (SchemaVersionSummary -> SchemaVersionSummary -> Bool
(SchemaVersionSummary -> SchemaVersionSummary -> Bool)
-> (SchemaVersionSummary -> SchemaVersionSummary -> Bool)
-> Eq SchemaVersionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaVersionSummary -> SchemaVersionSummary -> Bool
$c/= :: SchemaVersionSummary -> SchemaVersionSummary -> Bool
== :: SchemaVersionSummary -> SchemaVersionSummary -> Bool
$c== :: SchemaVersionSummary -> SchemaVersionSummary -> Bool
Prelude.Eq, ReadPrec [SchemaVersionSummary]
ReadPrec SchemaVersionSummary
Int -> ReadS SchemaVersionSummary
ReadS [SchemaVersionSummary]
(Int -> ReadS SchemaVersionSummary)
-> ReadS [SchemaVersionSummary]
-> ReadPrec SchemaVersionSummary
-> ReadPrec [SchemaVersionSummary]
-> Read SchemaVersionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaVersionSummary]
$creadListPrec :: ReadPrec [SchemaVersionSummary]
readPrec :: ReadPrec SchemaVersionSummary
$creadPrec :: ReadPrec SchemaVersionSummary
readList :: ReadS [SchemaVersionSummary]
$creadList :: ReadS [SchemaVersionSummary]
readsPrec :: Int -> ReadS SchemaVersionSummary
$creadsPrec :: Int -> ReadS SchemaVersionSummary
Prelude.Read, Int -> SchemaVersionSummary -> ShowS
[SchemaVersionSummary] -> ShowS
SchemaVersionSummary -> String
(Int -> SchemaVersionSummary -> ShowS)
-> (SchemaVersionSummary -> String)
-> ([SchemaVersionSummary] -> ShowS)
-> Show SchemaVersionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaVersionSummary] -> ShowS
$cshowList :: [SchemaVersionSummary] -> ShowS
show :: SchemaVersionSummary -> String
$cshow :: SchemaVersionSummary -> String
showsPrec :: Int -> SchemaVersionSummary -> ShowS
$cshowsPrec :: Int -> SchemaVersionSummary -> ShowS
Prelude.Show, (forall x. SchemaVersionSummary -> Rep SchemaVersionSummary x)
-> (forall x. Rep SchemaVersionSummary x -> SchemaVersionSummary)
-> Generic SchemaVersionSummary
forall x. Rep SchemaVersionSummary x -> SchemaVersionSummary
forall x. SchemaVersionSummary -> Rep SchemaVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaVersionSummary x -> SchemaVersionSummary
$cfrom :: forall x. SchemaVersionSummary -> Rep SchemaVersionSummary x
Prelude.Generic)

-- |
-- Create a value of 'SchemaVersionSummary' 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:
--
-- 'schemaVersion', 'schemaVersionSummary_schemaVersion' - The version number of the schema.
--
-- 'schemaName', 'schemaVersionSummary_schemaName' - The name of the schema.
--
-- 'schemaArn', 'schemaVersionSummary_schemaArn' - The ARN of the schema version.
--
-- 'type'', 'schemaVersionSummary_type' - The type of schema.
newSchemaVersionSummary ::
  SchemaVersionSummary
newSchemaVersionSummary :: SchemaVersionSummary
newSchemaVersionSummary =
  SchemaVersionSummary' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Type -> SchemaVersionSummary
SchemaVersionSummary'
    { $sel:schemaVersion:SchemaVersionSummary' :: Maybe Text
schemaVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:SchemaVersionSummary' :: Maybe Text
schemaName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:SchemaVersionSummary' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':SchemaVersionSummary' :: Maybe Type
type' = Maybe Type
forall a. Maybe a
Prelude.Nothing
    }

-- | The version number of the schema.
schemaVersionSummary_schemaVersion :: Lens.Lens' SchemaVersionSummary (Prelude.Maybe Prelude.Text)
schemaVersionSummary_schemaVersion :: (Maybe Text -> f (Maybe Text))
-> SchemaVersionSummary -> f SchemaVersionSummary
schemaVersionSummary_schemaVersion = (SchemaVersionSummary -> Maybe Text)
-> (SchemaVersionSummary -> Maybe Text -> SchemaVersionSummary)
-> Lens
     SchemaVersionSummary SchemaVersionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionSummary' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:SchemaVersionSummary' :: SchemaVersionSummary -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: SchemaVersionSummary
s@SchemaVersionSummary' {} Maybe Text
a -> SchemaVersionSummary
s {$sel:schemaVersion:SchemaVersionSummary' :: Maybe Text
schemaVersion = Maybe Text
a} :: SchemaVersionSummary)

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

-- | The ARN of the schema version.
schemaVersionSummary_schemaArn :: Lens.Lens' SchemaVersionSummary (Prelude.Maybe Prelude.Text)
schemaVersionSummary_schemaArn :: (Maybe Text -> f (Maybe Text))
-> SchemaVersionSummary -> f SchemaVersionSummary
schemaVersionSummary_schemaArn = (SchemaVersionSummary -> Maybe Text)
-> (SchemaVersionSummary -> Maybe Text -> SchemaVersionSummary)
-> Lens
     SchemaVersionSummary SchemaVersionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionSummary' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:SchemaVersionSummary' :: SchemaVersionSummary -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: SchemaVersionSummary
s@SchemaVersionSummary' {} Maybe Text
a -> SchemaVersionSummary
s {$sel:schemaArn:SchemaVersionSummary' :: Maybe Text
schemaArn = Maybe Text
a} :: SchemaVersionSummary)

-- | The type of schema.
schemaVersionSummary_type :: Lens.Lens' SchemaVersionSummary (Prelude.Maybe Type)
schemaVersionSummary_type :: (Maybe Type -> f (Maybe Type))
-> SchemaVersionSummary -> f SchemaVersionSummary
schemaVersionSummary_type = (SchemaVersionSummary -> Maybe Type)
-> (SchemaVersionSummary -> Maybe Type -> SchemaVersionSummary)
-> Lens
     SchemaVersionSummary SchemaVersionSummary (Maybe Type) (Maybe Type)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionSummary' {Maybe Type
type' :: Maybe Type
$sel:type':SchemaVersionSummary' :: SchemaVersionSummary -> Maybe Type
type'} -> Maybe Type
type') (\s :: SchemaVersionSummary
s@SchemaVersionSummary' {} Maybe Type
a -> SchemaVersionSummary
s {$sel:type':SchemaVersionSummary' :: Maybe Type
type' = Maybe Type
a} :: SchemaVersionSummary)

instance Core.FromJSON SchemaVersionSummary where
  parseJSON :: Value -> Parser SchemaVersionSummary
parseJSON =
    String
-> (Object -> Parser SchemaVersionSummary)
-> Value
-> Parser SchemaVersionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SchemaVersionSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Type -> SchemaVersionSummary
SchemaVersionSummary'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Type -> SchemaVersionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Type -> SchemaVersionSummary)
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
"SchemaVersion")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Type -> SchemaVersionSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Type -> SchemaVersionSummary)
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 Type -> SchemaVersionSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Type -> SchemaVersionSummary)
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 Type -> SchemaVersionSummary)
-> Parser (Maybe Type) -> Parser SchemaVersionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Type)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable SchemaVersionSummary

instance Prelude.NFData SchemaVersionSummary