{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data MethodSnapshot = MethodSnapshot'
{
MethodSnapshot -> Maybe Bool
apiKeyRequired :: Prelude.Maybe Prelude.Bool,
MethodSnapshot -> Maybe Text
authorizationType :: Prelude.Maybe Prelude.Text
}
deriving (MethodSnapshot -> MethodSnapshot -> Bool
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]
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
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. 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'
{ $sel:apiKeyRequired:MethodSnapshot' :: Maybe Bool
apiKeyRequired = forall a. Maybe a
Prelude.Nothing,
$sel:authorizationType:MethodSnapshot' :: Maybe Text
authorizationType = forall a. Maybe a
Prelude.Nothing
}
methodSnapshot_apiKeyRequired :: Lens.Lens' MethodSnapshot (Prelude.Maybe Prelude.Bool)
methodSnapshot_apiKeyRequired :: Lens' MethodSnapshot (Maybe Bool)
methodSnapshot_apiKeyRequired = 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)
methodSnapshot_authorizationType :: Lens.Lens' MethodSnapshot (Prelude.Maybe Prelude.Text)
methodSnapshot_authorizationType :: Lens' MethodSnapshot (Maybe Text)
methodSnapshot_authorizationType = 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)
instance Data.FromJSON MethodSnapshot where
parseJSON :: Value -> Parser MethodSnapshot
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MethodSnapshot"
( \Object
x ->
Maybe Bool -> Maybe Text -> MethodSnapshot
MethodSnapshot'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"apiKeyRequired")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"authorizationType")
)
instance Prelude.Hashable MethodSnapshot where
hashWithSalt :: Int -> MethodSnapshot -> Int
hashWithSalt Int
_salt MethodSnapshot' {Maybe Bool
Maybe Text
authorizationType :: Maybe Text
apiKeyRequired :: Maybe Bool
$sel:authorizationType:MethodSnapshot' :: MethodSnapshot -> Maybe Text
$sel:apiKeyRequired:MethodSnapshot' :: MethodSnapshot -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
apiKeyRequired
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authorizationType
instance Prelude.NFData MethodSnapshot where
rnf :: MethodSnapshot -> ()
rnf MethodSnapshot' {Maybe Bool
Maybe Text
authorizationType :: Maybe Text
apiKeyRequired :: Maybe Bool
$sel:authorizationType:MethodSnapshot' :: MethodSnapshot -> Maybe Text
$sel:apiKeyRequired:MethodSnapshot' :: MethodSnapshot -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
apiKeyRequired
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authorizationType