{-# 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.ImageBuilder.Types.InstanceMetadataOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceMetadataOptions = InstanceMetadataOptions'
{
InstanceMetadataOptions -> Maybe Natural
httpPutResponseHopLimit :: Prelude.Maybe Prelude.Natural,
InstanceMetadataOptions -> Maybe Text
httpTokens :: Prelude.Maybe Prelude.Text
}
deriving (InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
(InstanceMetadataOptions -> InstanceMetadataOptions -> Bool)
-> (InstanceMetadataOptions -> InstanceMetadataOptions -> Bool)
-> Eq InstanceMetadataOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
$c/= :: InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
== :: InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
$c== :: InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
Prelude.Eq, ReadPrec [InstanceMetadataOptions]
ReadPrec InstanceMetadataOptions
Int -> ReadS InstanceMetadataOptions
ReadS [InstanceMetadataOptions]
(Int -> ReadS InstanceMetadataOptions)
-> ReadS [InstanceMetadataOptions]
-> ReadPrec InstanceMetadataOptions
-> ReadPrec [InstanceMetadataOptions]
-> Read InstanceMetadataOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceMetadataOptions]
$creadListPrec :: ReadPrec [InstanceMetadataOptions]
readPrec :: ReadPrec InstanceMetadataOptions
$creadPrec :: ReadPrec InstanceMetadataOptions
readList :: ReadS [InstanceMetadataOptions]
$creadList :: ReadS [InstanceMetadataOptions]
readsPrec :: Int -> ReadS InstanceMetadataOptions
$creadsPrec :: Int -> ReadS InstanceMetadataOptions
Prelude.Read, Int -> InstanceMetadataOptions -> ShowS
[InstanceMetadataOptions] -> ShowS
InstanceMetadataOptions -> String
(Int -> InstanceMetadataOptions -> ShowS)
-> (InstanceMetadataOptions -> String)
-> ([InstanceMetadataOptions] -> ShowS)
-> Show InstanceMetadataOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceMetadataOptions] -> ShowS
$cshowList :: [InstanceMetadataOptions] -> ShowS
show :: InstanceMetadataOptions -> String
$cshow :: InstanceMetadataOptions -> String
showsPrec :: Int -> InstanceMetadataOptions -> ShowS
$cshowsPrec :: Int -> InstanceMetadataOptions -> ShowS
Prelude.Show, (forall x.
InstanceMetadataOptions -> Rep InstanceMetadataOptions x)
-> (forall x.
Rep InstanceMetadataOptions x -> InstanceMetadataOptions)
-> Generic InstanceMetadataOptions
forall x. Rep InstanceMetadataOptions x -> InstanceMetadataOptions
forall x. InstanceMetadataOptions -> Rep InstanceMetadataOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceMetadataOptions x -> InstanceMetadataOptions
$cfrom :: forall x. InstanceMetadataOptions -> Rep InstanceMetadataOptions x
Prelude.Generic)
newInstanceMetadataOptions ::
InstanceMetadataOptions
newInstanceMetadataOptions :: InstanceMetadataOptions
newInstanceMetadataOptions =
InstanceMetadataOptions' :: Maybe Natural -> Maybe Text -> InstanceMetadataOptions
InstanceMetadataOptions'
{ $sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: Maybe Natural
httpPutResponseHopLimit =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:httpTokens:InstanceMetadataOptions' :: Maybe Text
httpTokens = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceMetadataOptions_httpPutResponseHopLimit :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe Prelude.Natural)
instanceMetadataOptions_httpPutResponseHopLimit :: (Maybe Natural -> f (Maybe Natural))
-> InstanceMetadataOptions -> f InstanceMetadataOptions
instanceMetadataOptions_httpPutResponseHopLimit = (InstanceMetadataOptions -> Maybe Natural)
-> (InstanceMetadataOptions
-> Maybe Natural -> InstanceMetadataOptions)
-> Lens
InstanceMetadataOptions
InstanceMetadataOptions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe Natural
httpPutResponseHopLimit :: Maybe Natural
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Natural
httpPutResponseHopLimit} -> Maybe Natural
httpPutResponseHopLimit) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe Natural
a -> InstanceMetadataOptions
s {$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: Maybe Natural
httpPutResponseHopLimit = Maybe Natural
a} :: InstanceMetadataOptions)
instanceMetadataOptions_httpTokens :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe Prelude.Text)
instanceMetadataOptions_httpTokens :: (Maybe Text -> f (Maybe Text))
-> InstanceMetadataOptions -> f InstanceMetadataOptions
instanceMetadataOptions_httpTokens = (InstanceMetadataOptions -> Maybe Text)
-> (InstanceMetadataOptions
-> Maybe Text -> InstanceMetadataOptions)
-> Lens
InstanceMetadataOptions
InstanceMetadataOptions
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe Text
httpTokens :: Maybe Text
$sel:httpTokens:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Text
httpTokens} -> Maybe Text
httpTokens) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe Text
a -> InstanceMetadataOptions
s {$sel:httpTokens:InstanceMetadataOptions' :: Maybe Text
httpTokens = Maybe Text
a} :: InstanceMetadataOptions)
instance Core.FromJSON InstanceMetadataOptions where
parseJSON :: Value -> Parser InstanceMetadataOptions
parseJSON =
String
-> (Object -> Parser InstanceMetadataOptions)
-> Value
-> Parser InstanceMetadataOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceMetadataOptions"
( \Object
x ->
Maybe Natural -> Maybe Text -> InstanceMetadataOptions
InstanceMetadataOptions'
(Maybe Natural -> Maybe Text -> InstanceMetadataOptions)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> InstanceMetadataOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"httpPutResponseHopLimit")
Parser (Maybe Text -> InstanceMetadataOptions)
-> Parser (Maybe Text) -> Parser InstanceMetadataOptions
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
"httpTokens")
)
instance Prelude.Hashable InstanceMetadataOptions
instance Prelude.NFData InstanceMetadataOptions
instance Core.ToJSON InstanceMetadataOptions where
toJSON :: InstanceMetadataOptions -> Value
toJSON InstanceMetadataOptions' {Maybe Natural
Maybe Text
httpTokens :: Maybe Text
httpPutResponseHopLimit :: Maybe Natural
$sel:httpTokens:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Text
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"httpPutResponseHopLimit" 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
httpPutResponseHopLimit,
(Text
"httpTokens" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
httpTokens
]
)