{-# 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.KeySchemaElement where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data KeySchemaElement = KeySchemaElement'
{
KeySchemaElement -> Text
name :: Prelude.Text,
KeySchemaElement -> Text
type' :: Prelude.Text
}
deriving (KeySchemaElement -> KeySchemaElement -> Bool
(KeySchemaElement -> KeySchemaElement -> Bool)
-> (KeySchemaElement -> KeySchemaElement -> Bool)
-> Eq KeySchemaElement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeySchemaElement -> KeySchemaElement -> Bool
$c/= :: KeySchemaElement -> KeySchemaElement -> Bool
== :: KeySchemaElement -> KeySchemaElement -> Bool
$c== :: KeySchemaElement -> KeySchemaElement -> Bool
Prelude.Eq, ReadPrec [KeySchemaElement]
ReadPrec KeySchemaElement
Int -> ReadS KeySchemaElement
ReadS [KeySchemaElement]
(Int -> ReadS KeySchemaElement)
-> ReadS [KeySchemaElement]
-> ReadPrec KeySchemaElement
-> ReadPrec [KeySchemaElement]
-> Read KeySchemaElement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeySchemaElement]
$creadListPrec :: ReadPrec [KeySchemaElement]
readPrec :: ReadPrec KeySchemaElement
$creadPrec :: ReadPrec KeySchemaElement
readList :: ReadS [KeySchemaElement]
$creadList :: ReadS [KeySchemaElement]
readsPrec :: Int -> ReadS KeySchemaElement
$creadsPrec :: Int -> ReadS KeySchemaElement
Prelude.Read, Int -> KeySchemaElement -> ShowS
[KeySchemaElement] -> ShowS
KeySchemaElement -> String
(Int -> KeySchemaElement -> ShowS)
-> (KeySchemaElement -> String)
-> ([KeySchemaElement] -> ShowS)
-> Show KeySchemaElement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeySchemaElement] -> ShowS
$cshowList :: [KeySchemaElement] -> ShowS
show :: KeySchemaElement -> String
$cshow :: KeySchemaElement -> String
showsPrec :: Int -> KeySchemaElement -> ShowS
$cshowsPrec :: Int -> KeySchemaElement -> ShowS
Prelude.Show, (forall x. KeySchemaElement -> Rep KeySchemaElement x)
-> (forall x. Rep KeySchemaElement x -> KeySchemaElement)
-> Generic KeySchemaElement
forall x. Rep KeySchemaElement x -> KeySchemaElement
forall x. KeySchemaElement -> Rep KeySchemaElement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeySchemaElement x -> KeySchemaElement
$cfrom :: forall x. KeySchemaElement -> Rep KeySchemaElement x
Prelude.Generic)
newKeySchemaElement ::
Prelude.Text ->
Prelude.Text ->
KeySchemaElement
newKeySchemaElement :: Text -> Text -> KeySchemaElement
newKeySchemaElement Text
pName_ Text
pType_ =
KeySchemaElement' :: Text -> Text -> KeySchemaElement
KeySchemaElement' {$sel:name:KeySchemaElement' :: Text
name = Text
pName_, $sel:type':KeySchemaElement' :: Text
type' = Text
pType_}
keySchemaElement_name :: Lens.Lens' KeySchemaElement Prelude.Text
keySchemaElement_name :: (Text -> f Text) -> KeySchemaElement -> f KeySchemaElement
keySchemaElement_name = (KeySchemaElement -> Text)
-> (KeySchemaElement -> Text -> KeySchemaElement)
-> Lens KeySchemaElement KeySchemaElement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeySchemaElement' {Text
name :: Text
$sel:name:KeySchemaElement' :: KeySchemaElement -> Text
name} -> Text
name) (\s :: KeySchemaElement
s@KeySchemaElement' {} Text
a -> KeySchemaElement
s {$sel:name:KeySchemaElement' :: Text
name = Text
a} :: KeySchemaElement)
keySchemaElement_type :: Lens.Lens' KeySchemaElement Prelude.Text
keySchemaElement_type :: (Text -> f Text) -> KeySchemaElement -> f KeySchemaElement
keySchemaElement_type = (KeySchemaElement -> Text)
-> (KeySchemaElement -> Text -> KeySchemaElement)
-> Lens KeySchemaElement KeySchemaElement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeySchemaElement' {Text
type' :: Text
$sel:type':KeySchemaElement' :: KeySchemaElement -> Text
type'} -> Text
type') (\s :: KeySchemaElement
s@KeySchemaElement' {} Text
a -> KeySchemaElement
s {$sel:type':KeySchemaElement' :: Text
type' = Text
a} :: KeySchemaElement)
instance Core.FromJSON KeySchemaElement where
parseJSON :: Value -> Parser KeySchemaElement
parseJSON =
String
-> (Object -> Parser KeySchemaElement)
-> Value
-> Parser KeySchemaElement
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"KeySchemaElement"
( \Object
x ->
Text -> Text -> KeySchemaElement
KeySchemaElement'
(Text -> Text -> KeySchemaElement)
-> Parser Text -> Parser (Text -> KeySchemaElement)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name") Parser (Text -> KeySchemaElement)
-> Parser Text -> Parser KeySchemaElement
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
)
instance Prelude.Hashable KeySchemaElement
instance Prelude.NFData KeySchemaElement