{-# 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 #-}
module Amazonka.Glue.Types.SchemaVersionNumber where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SchemaVersionNumber = SchemaVersionNumber'
{
SchemaVersionNumber -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural,
SchemaVersionNumber -> Maybe Bool
latestVersion :: Prelude.Maybe Prelude.Bool
}
deriving (SchemaVersionNumber -> SchemaVersionNumber -> Bool
(SchemaVersionNumber -> SchemaVersionNumber -> Bool)
-> (SchemaVersionNumber -> SchemaVersionNumber -> Bool)
-> Eq SchemaVersionNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaVersionNumber -> SchemaVersionNumber -> Bool
$c/= :: SchemaVersionNumber -> SchemaVersionNumber -> Bool
== :: SchemaVersionNumber -> SchemaVersionNumber -> Bool
$c== :: SchemaVersionNumber -> SchemaVersionNumber -> Bool
Prelude.Eq, ReadPrec [SchemaVersionNumber]
ReadPrec SchemaVersionNumber
Int -> ReadS SchemaVersionNumber
ReadS [SchemaVersionNumber]
(Int -> ReadS SchemaVersionNumber)
-> ReadS [SchemaVersionNumber]
-> ReadPrec SchemaVersionNumber
-> ReadPrec [SchemaVersionNumber]
-> Read SchemaVersionNumber
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaVersionNumber]
$creadListPrec :: ReadPrec [SchemaVersionNumber]
readPrec :: ReadPrec SchemaVersionNumber
$creadPrec :: ReadPrec SchemaVersionNumber
readList :: ReadS [SchemaVersionNumber]
$creadList :: ReadS [SchemaVersionNumber]
readsPrec :: Int -> ReadS SchemaVersionNumber
$creadsPrec :: Int -> ReadS SchemaVersionNumber
Prelude.Read, Int -> SchemaVersionNumber -> ShowS
[SchemaVersionNumber] -> ShowS
SchemaVersionNumber -> String
(Int -> SchemaVersionNumber -> ShowS)
-> (SchemaVersionNumber -> String)
-> ([SchemaVersionNumber] -> ShowS)
-> Show SchemaVersionNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaVersionNumber] -> ShowS
$cshowList :: [SchemaVersionNumber] -> ShowS
show :: SchemaVersionNumber -> String
$cshow :: SchemaVersionNumber -> String
showsPrec :: Int -> SchemaVersionNumber -> ShowS
$cshowsPrec :: Int -> SchemaVersionNumber -> ShowS
Prelude.Show, (forall x. SchemaVersionNumber -> Rep SchemaVersionNumber x)
-> (forall x. Rep SchemaVersionNumber x -> SchemaVersionNumber)
-> Generic SchemaVersionNumber
forall x. Rep SchemaVersionNumber x -> SchemaVersionNumber
forall x. SchemaVersionNumber -> Rep SchemaVersionNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaVersionNumber x -> SchemaVersionNumber
$cfrom :: forall x. SchemaVersionNumber -> Rep SchemaVersionNumber x
Prelude.Generic)
newSchemaVersionNumber ::
SchemaVersionNumber
newSchemaVersionNumber :: SchemaVersionNumber
newSchemaVersionNumber =
SchemaVersionNumber' :: Maybe Natural -> Maybe Bool -> SchemaVersionNumber
SchemaVersionNumber'
{ $sel:versionNumber:SchemaVersionNumber' :: Maybe Natural
versionNumber =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:latestVersion:SchemaVersionNumber' :: Maybe Bool
latestVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
schemaVersionNumber_versionNumber :: Lens.Lens' SchemaVersionNumber (Prelude.Maybe Prelude.Natural)
schemaVersionNumber_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> SchemaVersionNumber -> f SchemaVersionNumber
schemaVersionNumber_versionNumber = (SchemaVersionNumber -> Maybe Natural)
-> (SchemaVersionNumber -> Maybe Natural -> SchemaVersionNumber)
-> Lens
SchemaVersionNumber
SchemaVersionNumber
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionNumber' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:SchemaVersionNumber' :: SchemaVersionNumber -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: SchemaVersionNumber
s@SchemaVersionNumber' {} Maybe Natural
a -> SchemaVersionNumber
s {$sel:versionNumber:SchemaVersionNumber' :: Maybe Natural
versionNumber = Maybe Natural
a} :: SchemaVersionNumber)
schemaVersionNumber_latestVersion :: Lens.Lens' SchemaVersionNumber (Prelude.Maybe Prelude.Bool)
schemaVersionNumber_latestVersion :: (Maybe Bool -> f (Maybe Bool))
-> SchemaVersionNumber -> f SchemaVersionNumber
schemaVersionNumber_latestVersion = (SchemaVersionNumber -> Maybe Bool)
-> (SchemaVersionNumber -> Maybe Bool -> SchemaVersionNumber)
-> Lens
SchemaVersionNumber SchemaVersionNumber (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaVersionNumber' {Maybe Bool
latestVersion :: Maybe Bool
$sel:latestVersion:SchemaVersionNumber' :: SchemaVersionNumber -> Maybe Bool
latestVersion} -> Maybe Bool
latestVersion) (\s :: SchemaVersionNumber
s@SchemaVersionNumber' {} Maybe Bool
a -> SchemaVersionNumber
s {$sel:latestVersion:SchemaVersionNumber' :: Maybe Bool
latestVersion = Maybe Bool
a} :: SchemaVersionNumber)
instance Prelude.Hashable SchemaVersionNumber
instance Prelude.NFData SchemaVersionNumber
instance Core.ToJSON SchemaVersionNumber where
toJSON :: SchemaVersionNumber -> Value
toJSON SchemaVersionNumber' {Maybe Bool
Maybe Natural
latestVersion :: Maybe Bool
versionNumber :: Maybe Natural
$sel:latestVersion:SchemaVersionNumber' :: SchemaVersionNumber -> Maybe Bool
$sel:versionNumber:SchemaVersionNumber' :: SchemaVersionNumber -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VersionNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
versionNumber,
(Text
"LatestVersion" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
latestVersion
]
)