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