{-# 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.APIGateway.Types.UsagePlanKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UsagePlanKey = UsagePlanKey'
{
UsagePlanKey -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
UsagePlanKey -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UsagePlanKey -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
UsagePlanKey -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (UsagePlanKey -> UsagePlanKey -> Bool
(UsagePlanKey -> UsagePlanKey -> Bool)
-> (UsagePlanKey -> UsagePlanKey -> Bool) -> Eq UsagePlanKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsagePlanKey -> UsagePlanKey -> Bool
$c/= :: UsagePlanKey -> UsagePlanKey -> Bool
== :: UsagePlanKey -> UsagePlanKey -> Bool
$c== :: UsagePlanKey -> UsagePlanKey -> Bool
Prelude.Eq, ReadPrec [UsagePlanKey]
ReadPrec UsagePlanKey
Int -> ReadS UsagePlanKey
ReadS [UsagePlanKey]
(Int -> ReadS UsagePlanKey)
-> ReadS [UsagePlanKey]
-> ReadPrec UsagePlanKey
-> ReadPrec [UsagePlanKey]
-> Read UsagePlanKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsagePlanKey]
$creadListPrec :: ReadPrec [UsagePlanKey]
readPrec :: ReadPrec UsagePlanKey
$creadPrec :: ReadPrec UsagePlanKey
readList :: ReadS [UsagePlanKey]
$creadList :: ReadS [UsagePlanKey]
readsPrec :: Int -> ReadS UsagePlanKey
$creadsPrec :: Int -> ReadS UsagePlanKey
Prelude.Read, Int -> UsagePlanKey -> ShowS
[UsagePlanKey] -> ShowS
UsagePlanKey -> String
(Int -> UsagePlanKey -> ShowS)
-> (UsagePlanKey -> String)
-> ([UsagePlanKey] -> ShowS)
-> Show UsagePlanKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsagePlanKey] -> ShowS
$cshowList :: [UsagePlanKey] -> ShowS
show :: UsagePlanKey -> String
$cshow :: UsagePlanKey -> String
showsPrec :: Int -> UsagePlanKey -> ShowS
$cshowsPrec :: Int -> UsagePlanKey -> ShowS
Prelude.Show, (forall x. UsagePlanKey -> Rep UsagePlanKey x)
-> (forall x. Rep UsagePlanKey x -> UsagePlanKey)
-> Generic UsagePlanKey
forall x. Rep UsagePlanKey x -> UsagePlanKey
forall x. UsagePlanKey -> Rep UsagePlanKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsagePlanKey x -> UsagePlanKey
$cfrom :: forall x. UsagePlanKey -> Rep UsagePlanKey x
Prelude.Generic)
newUsagePlanKey ::
UsagePlanKey
newUsagePlanKey :: UsagePlanKey
newUsagePlanKey =
UsagePlanKey' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> UsagePlanKey
UsagePlanKey'
{ $sel:value:UsagePlanKey' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UsagePlanKey' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:UsagePlanKey' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':UsagePlanKey' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
usagePlanKey_value :: Lens.Lens' UsagePlanKey (Prelude.Maybe Prelude.Text)
usagePlanKey_value :: (Maybe Text -> f (Maybe Text)) -> UsagePlanKey -> f UsagePlanKey
usagePlanKey_value = (UsagePlanKey -> Maybe Text)
-> (UsagePlanKey -> Maybe Text -> UsagePlanKey)
-> Lens UsagePlanKey UsagePlanKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsagePlanKey' {Maybe Text
value :: Maybe Text
$sel:value:UsagePlanKey' :: UsagePlanKey -> Maybe Text
value} -> Maybe Text
value) (\s :: UsagePlanKey
s@UsagePlanKey' {} Maybe Text
a -> UsagePlanKey
s {$sel:value:UsagePlanKey' :: Maybe Text
value = Maybe Text
a} :: UsagePlanKey)
usagePlanKey_name :: Lens.Lens' UsagePlanKey (Prelude.Maybe Prelude.Text)
usagePlanKey_name :: (Maybe Text -> f (Maybe Text)) -> UsagePlanKey -> f UsagePlanKey
usagePlanKey_name = (UsagePlanKey -> Maybe Text)
-> (UsagePlanKey -> Maybe Text -> UsagePlanKey)
-> Lens UsagePlanKey UsagePlanKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsagePlanKey' {Maybe Text
name :: Maybe Text
$sel:name:UsagePlanKey' :: UsagePlanKey -> Maybe Text
name} -> Maybe Text
name) (\s :: UsagePlanKey
s@UsagePlanKey' {} Maybe Text
a -> UsagePlanKey
s {$sel:name:UsagePlanKey' :: Maybe Text
name = Maybe Text
a} :: UsagePlanKey)
usagePlanKey_id :: Lens.Lens' UsagePlanKey (Prelude.Maybe Prelude.Text)
usagePlanKey_id :: (Maybe Text -> f (Maybe Text)) -> UsagePlanKey -> f UsagePlanKey
usagePlanKey_id = (UsagePlanKey -> Maybe Text)
-> (UsagePlanKey -> Maybe Text -> UsagePlanKey)
-> Lens UsagePlanKey UsagePlanKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsagePlanKey' {Maybe Text
id :: Maybe Text
$sel:id:UsagePlanKey' :: UsagePlanKey -> Maybe Text
id} -> Maybe Text
id) (\s :: UsagePlanKey
s@UsagePlanKey' {} Maybe Text
a -> UsagePlanKey
s {$sel:id:UsagePlanKey' :: Maybe Text
id = Maybe Text
a} :: UsagePlanKey)
usagePlanKey_type :: Lens.Lens' UsagePlanKey (Prelude.Maybe Prelude.Text)
usagePlanKey_type :: (Maybe Text -> f (Maybe Text)) -> UsagePlanKey -> f UsagePlanKey
usagePlanKey_type = (UsagePlanKey -> Maybe Text)
-> (UsagePlanKey -> Maybe Text -> UsagePlanKey)
-> Lens UsagePlanKey UsagePlanKey (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsagePlanKey' {Maybe Text
type' :: Maybe Text
$sel:type':UsagePlanKey' :: UsagePlanKey -> Maybe Text
type'} -> Maybe Text
type') (\s :: UsagePlanKey
s@UsagePlanKey' {} Maybe Text
a -> UsagePlanKey
s {$sel:type':UsagePlanKey' :: Maybe Text
type' = Maybe Text
a} :: UsagePlanKey)
instance Core.FromJSON UsagePlanKey where
parseJSON :: Value -> Parser UsagePlanKey
parseJSON =
String
-> (Object -> Parser UsagePlanKey) -> Value -> Parser UsagePlanKey
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UsagePlanKey"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> UsagePlanKey
UsagePlanKey'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> UsagePlanKey)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> UsagePlanKey)
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
"value")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> UsagePlanKey)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UsagePlanKey)
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
"name")
Parser (Maybe Text -> Maybe Text -> UsagePlanKey)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UsagePlanKey)
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
"id")
Parser (Maybe Text -> UsagePlanKey)
-> Parser (Maybe Text) -> Parser UsagePlanKey
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
"type")
)
instance Prelude.Hashable UsagePlanKey
instance Prelude.NFData UsagePlanKey