{-# 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.Lightsail.Types.InstanceMetadataOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.HttpEndpoint
import Amazonka.Lightsail.Types.HttpProtocolIpv6
import Amazonka.Lightsail.Types.HttpTokens
import Amazonka.Lightsail.Types.InstanceMetadataState
import qualified Amazonka.Prelude as Prelude
data InstanceMetadataOptions = InstanceMetadataOptions'
{
InstanceMetadataOptions -> Maybe HttpEndpoint
httpEndpoint :: Prelude.Maybe HttpEndpoint,
InstanceMetadataOptions -> Maybe HttpProtocolIpv6
httpProtocolIpv6 :: Prelude.Maybe HttpProtocolIpv6,
InstanceMetadataOptions -> Maybe Int
httpPutResponseHopLimit :: Prelude.Maybe Prelude.Int,
InstanceMetadataOptions -> Maybe HttpTokens
httpTokens :: Prelude.Maybe HttpTokens,
InstanceMetadataOptions -> Maybe InstanceMetadataState
state :: Prelude.Maybe InstanceMetadataState
}
deriving (InstanceMetadataOptions -> InstanceMetadataOptions -> Bool
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]
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
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. 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'
{ $sel:httpEndpoint:InstanceMetadataOptions' :: Maybe HttpEndpoint
httpEndpoint =
forall a. Maybe a
Prelude.Nothing,
$sel:httpProtocolIpv6:InstanceMetadataOptions' :: Maybe HttpProtocolIpv6
httpProtocolIpv6 = forall a. Maybe a
Prelude.Nothing,
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: Maybe Int
httpPutResponseHopLimit = forall a. Maybe a
Prelude.Nothing,
$sel:httpTokens:InstanceMetadataOptions' :: Maybe HttpTokens
httpTokens = forall a. Maybe a
Prelude.Nothing,
$sel:state:InstanceMetadataOptions' :: Maybe InstanceMetadataState
state = forall a. Maybe a
Prelude.Nothing
}
instanceMetadataOptions_httpEndpoint :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe HttpEndpoint)
instanceMetadataOptions_httpEndpoint :: Lens' InstanceMetadataOptions (Maybe HttpEndpoint)
instanceMetadataOptions_httpEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe HttpEndpoint
httpEndpoint :: Maybe HttpEndpoint
$sel:httpEndpoint:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpEndpoint
httpEndpoint} -> Maybe HttpEndpoint
httpEndpoint) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe HttpEndpoint
a -> InstanceMetadataOptions
s {$sel:httpEndpoint:InstanceMetadataOptions' :: Maybe HttpEndpoint
httpEndpoint = Maybe HttpEndpoint
a} :: InstanceMetadataOptions)
instanceMetadataOptions_httpProtocolIpv6 :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe HttpProtocolIpv6)
instanceMetadataOptions_httpProtocolIpv6 :: Lens' InstanceMetadataOptions (Maybe HttpProtocolIpv6)
instanceMetadataOptions_httpProtocolIpv6 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe HttpProtocolIpv6
httpProtocolIpv6 :: Maybe HttpProtocolIpv6
$sel:httpProtocolIpv6:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpProtocolIpv6
httpProtocolIpv6} -> Maybe HttpProtocolIpv6
httpProtocolIpv6) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe HttpProtocolIpv6
a -> InstanceMetadataOptions
s {$sel:httpProtocolIpv6:InstanceMetadataOptions' :: Maybe HttpProtocolIpv6
httpProtocolIpv6 = Maybe HttpProtocolIpv6
a} :: InstanceMetadataOptions)
instanceMetadataOptions_httpPutResponseHopLimit :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe Prelude.Int)
instanceMetadataOptions_httpPutResponseHopLimit :: Lens' InstanceMetadataOptions (Maybe Int)
instanceMetadataOptions_httpPutResponseHopLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe Int
httpPutResponseHopLimit :: Maybe Int
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Int
httpPutResponseHopLimit} -> Maybe Int
httpPutResponseHopLimit) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe Int
a -> InstanceMetadataOptions
s {$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: Maybe Int
httpPutResponseHopLimit = Maybe Int
a} :: InstanceMetadataOptions)
instanceMetadataOptions_httpTokens :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe HttpTokens)
instanceMetadataOptions_httpTokens :: Lens' InstanceMetadataOptions (Maybe HttpTokens)
instanceMetadataOptions_httpTokens = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe HttpTokens
httpTokens :: Maybe HttpTokens
$sel:httpTokens:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpTokens
httpTokens} -> Maybe HttpTokens
httpTokens) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe HttpTokens
a -> InstanceMetadataOptions
s {$sel:httpTokens:InstanceMetadataOptions' :: Maybe HttpTokens
httpTokens = Maybe HttpTokens
a} :: InstanceMetadataOptions)
instanceMetadataOptions_state :: Lens.Lens' InstanceMetadataOptions (Prelude.Maybe InstanceMetadataState)
instanceMetadataOptions_state :: Lens' InstanceMetadataOptions (Maybe InstanceMetadataState)
instanceMetadataOptions_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadataOptions' {Maybe InstanceMetadataState
state :: Maybe InstanceMetadataState
$sel:state:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe InstanceMetadataState
state} -> Maybe InstanceMetadataState
state) (\s :: InstanceMetadataOptions
s@InstanceMetadataOptions' {} Maybe InstanceMetadataState
a -> InstanceMetadataOptions
s {$sel:state:InstanceMetadataOptions' :: Maybe InstanceMetadataState
state = Maybe InstanceMetadataState
a} :: InstanceMetadataOptions)
instance Data.FromJSON InstanceMetadataOptions where
parseJSON :: Value -> Parser InstanceMetadataOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InstanceMetadataOptions"
( \Object
x ->
Maybe HttpEndpoint
-> Maybe HttpProtocolIpv6
-> Maybe Int
-> Maybe HttpTokens
-> Maybe InstanceMetadataState
-> InstanceMetadataOptions
InstanceMetadataOptions'
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
"httpEndpoint")
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
"httpProtocolIpv6")
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
"httpPutResponseHopLimit")
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
"httpTokens")
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
"state")
)
instance Prelude.Hashable InstanceMetadataOptions where
hashWithSalt :: Int -> InstanceMetadataOptions -> Int
hashWithSalt Int
_salt InstanceMetadataOptions' {Maybe Int
Maybe HttpEndpoint
Maybe HttpProtocolIpv6
Maybe HttpTokens
Maybe InstanceMetadataState
state :: Maybe InstanceMetadataState
httpTokens :: Maybe HttpTokens
httpPutResponseHopLimit :: Maybe Int
httpProtocolIpv6 :: Maybe HttpProtocolIpv6
httpEndpoint :: Maybe HttpEndpoint
$sel:state:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe InstanceMetadataState
$sel:httpTokens:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpTokens
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Int
$sel:httpProtocolIpv6:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpProtocolIpv6
$sel:httpEndpoint:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpEndpoint
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HttpEndpoint
httpEndpoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HttpProtocolIpv6
httpProtocolIpv6
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
httpPutResponseHopLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HttpTokens
httpTokens
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceMetadataState
state
instance Prelude.NFData InstanceMetadataOptions where
rnf :: InstanceMetadataOptions -> ()
rnf InstanceMetadataOptions' {Maybe Int
Maybe HttpEndpoint
Maybe HttpProtocolIpv6
Maybe HttpTokens
Maybe InstanceMetadataState
state :: Maybe InstanceMetadataState
httpTokens :: Maybe HttpTokens
httpPutResponseHopLimit :: Maybe Int
httpProtocolIpv6 :: Maybe HttpProtocolIpv6
httpEndpoint :: Maybe HttpEndpoint
$sel:state:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe InstanceMetadataState
$sel:httpTokens:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpTokens
$sel:httpPutResponseHopLimit:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe Int
$sel:httpProtocolIpv6:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpProtocolIpv6
$sel:httpEndpoint:InstanceMetadataOptions' :: InstanceMetadataOptions -> Maybe HttpEndpoint
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe HttpEndpoint
httpEndpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HttpProtocolIpv6
httpProtocolIpv6
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
httpPutResponseHopLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HttpTokens
httpTokens
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceMetadataState
state