{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Greengrass.GetThingRuntimeConfiguration
(
GetThingRuntimeConfiguration (..),
newGetThingRuntimeConfiguration,
getThingRuntimeConfiguration_thingName,
GetThingRuntimeConfigurationResponse (..),
newGetThingRuntimeConfigurationResponse,
getThingRuntimeConfigurationResponse_runtimeConfiguration,
getThingRuntimeConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Greengrass.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetThingRuntimeConfiguration = GetThingRuntimeConfiguration'
{
GetThingRuntimeConfiguration -> Text
thingName :: Prelude.Text
}
deriving (GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool
$c/= :: GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool
== :: GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool
$c== :: GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool
Prelude.Eq, ReadPrec [GetThingRuntimeConfiguration]
ReadPrec GetThingRuntimeConfiguration
Int -> ReadS GetThingRuntimeConfiguration
ReadS [GetThingRuntimeConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetThingRuntimeConfiguration]
$creadListPrec :: ReadPrec [GetThingRuntimeConfiguration]
readPrec :: ReadPrec GetThingRuntimeConfiguration
$creadPrec :: ReadPrec GetThingRuntimeConfiguration
readList :: ReadS [GetThingRuntimeConfiguration]
$creadList :: ReadS [GetThingRuntimeConfiguration]
readsPrec :: Int -> ReadS GetThingRuntimeConfiguration
$creadsPrec :: Int -> ReadS GetThingRuntimeConfiguration
Prelude.Read, Int -> GetThingRuntimeConfiguration -> ShowS
[GetThingRuntimeConfiguration] -> ShowS
GetThingRuntimeConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetThingRuntimeConfiguration] -> ShowS
$cshowList :: [GetThingRuntimeConfiguration] -> ShowS
show :: GetThingRuntimeConfiguration -> String
$cshow :: GetThingRuntimeConfiguration -> String
showsPrec :: Int -> GetThingRuntimeConfiguration -> ShowS
$cshowsPrec :: Int -> GetThingRuntimeConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetThingRuntimeConfiguration x -> GetThingRuntimeConfiguration
forall x.
GetThingRuntimeConfiguration -> Rep GetThingRuntimeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetThingRuntimeConfiguration x -> GetThingRuntimeConfiguration
$cfrom :: forall x.
GetThingRuntimeConfiguration -> Rep GetThingRuntimeConfiguration x
Prelude.Generic)
newGetThingRuntimeConfiguration ::
Prelude.Text ->
GetThingRuntimeConfiguration
newGetThingRuntimeConfiguration :: Text -> GetThingRuntimeConfiguration
newGetThingRuntimeConfiguration Text
pThingName_ =
GetThingRuntimeConfiguration'
{ $sel:thingName:GetThingRuntimeConfiguration' :: Text
thingName =
Text
pThingName_
}
getThingRuntimeConfiguration_thingName :: Lens.Lens' GetThingRuntimeConfiguration Prelude.Text
getThingRuntimeConfiguration_thingName :: Lens' GetThingRuntimeConfiguration Text
getThingRuntimeConfiguration_thingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:GetThingRuntimeConfiguration' :: GetThingRuntimeConfiguration -> Text
thingName} -> Text
thingName) (\s :: GetThingRuntimeConfiguration
s@GetThingRuntimeConfiguration' {} Text
a -> GetThingRuntimeConfiguration
s {$sel:thingName:GetThingRuntimeConfiguration' :: Text
thingName = Text
a} :: GetThingRuntimeConfiguration)
instance Core.AWSRequest GetThingRuntimeConfiguration where
type
AWSResponse GetThingRuntimeConfiguration =
GetThingRuntimeConfigurationResponse
request :: (Service -> Service)
-> GetThingRuntimeConfiguration
-> Request GetThingRuntimeConfiguration
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetThingRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThingRuntimeConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RuntimeConfiguration
-> Int -> GetThingRuntimeConfigurationResponse
GetThingRuntimeConfigurationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RuntimeConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetThingRuntimeConfiguration
where
hashWithSalt :: Int -> GetThingRuntimeConfiguration -> Int
hashWithSalt Int
_salt GetThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:GetThingRuntimeConfiguration' :: GetThingRuntimeConfiguration -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
thingName
instance Prelude.NFData GetThingRuntimeConfiguration where
rnf :: GetThingRuntimeConfiguration -> ()
rnf GetThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:GetThingRuntimeConfiguration' :: GetThingRuntimeConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
thingName
instance Data.ToHeaders GetThingRuntimeConfiguration where
toHeaders :: GetThingRuntimeConfiguration -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetThingRuntimeConfiguration where
toPath :: GetThingRuntimeConfiguration -> ByteString
toPath GetThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:GetThingRuntimeConfiguration' :: GetThingRuntimeConfiguration -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/things/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
thingName,
ByteString
"/runtimeconfig"
]
instance Data.ToQuery GetThingRuntimeConfiguration where
toQuery :: GetThingRuntimeConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetThingRuntimeConfigurationResponse = GetThingRuntimeConfigurationResponse'
{
GetThingRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration :: Prelude.Maybe RuntimeConfiguration,
GetThingRuntimeConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool
$c/= :: GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool
== :: GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool
$c== :: GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetThingRuntimeConfigurationResponse]
ReadPrec GetThingRuntimeConfigurationResponse
Int -> ReadS GetThingRuntimeConfigurationResponse
ReadS [GetThingRuntimeConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetThingRuntimeConfigurationResponse]
$creadListPrec :: ReadPrec [GetThingRuntimeConfigurationResponse]
readPrec :: ReadPrec GetThingRuntimeConfigurationResponse
$creadPrec :: ReadPrec GetThingRuntimeConfigurationResponse
readList :: ReadS [GetThingRuntimeConfigurationResponse]
$creadList :: ReadS [GetThingRuntimeConfigurationResponse]
readsPrec :: Int -> ReadS GetThingRuntimeConfigurationResponse
$creadsPrec :: Int -> ReadS GetThingRuntimeConfigurationResponse
Prelude.Read, Int -> GetThingRuntimeConfigurationResponse -> ShowS
[GetThingRuntimeConfigurationResponse] -> ShowS
GetThingRuntimeConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetThingRuntimeConfigurationResponse] -> ShowS
$cshowList :: [GetThingRuntimeConfigurationResponse] -> ShowS
show :: GetThingRuntimeConfigurationResponse -> String
$cshow :: GetThingRuntimeConfigurationResponse -> String
showsPrec :: Int -> GetThingRuntimeConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetThingRuntimeConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetThingRuntimeConfigurationResponse x
-> GetThingRuntimeConfigurationResponse
forall x.
GetThingRuntimeConfigurationResponse
-> Rep GetThingRuntimeConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetThingRuntimeConfigurationResponse x
-> GetThingRuntimeConfigurationResponse
$cfrom :: forall x.
GetThingRuntimeConfigurationResponse
-> Rep GetThingRuntimeConfigurationResponse x
Prelude.Generic)
newGetThingRuntimeConfigurationResponse ::
Prelude.Int ->
GetThingRuntimeConfigurationResponse
newGetThingRuntimeConfigurationResponse :: Int -> GetThingRuntimeConfigurationResponse
newGetThingRuntimeConfigurationResponse Int
pHttpStatus_ =
GetThingRuntimeConfigurationResponse'
{ $sel:runtimeConfiguration:GetThingRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetThingRuntimeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getThingRuntimeConfigurationResponse_runtimeConfiguration :: Lens.Lens' GetThingRuntimeConfigurationResponse (Prelude.Maybe RuntimeConfiguration)
getThingRuntimeConfigurationResponse_runtimeConfiguration :: Lens'
GetThingRuntimeConfigurationResponse (Maybe RuntimeConfiguration)
getThingRuntimeConfigurationResponse_runtimeConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThingRuntimeConfigurationResponse' {Maybe RuntimeConfiguration
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:runtimeConfiguration:GetThingRuntimeConfigurationResponse' :: GetThingRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration} -> Maybe RuntimeConfiguration
runtimeConfiguration) (\s :: GetThingRuntimeConfigurationResponse
s@GetThingRuntimeConfigurationResponse' {} Maybe RuntimeConfiguration
a -> GetThingRuntimeConfigurationResponse
s {$sel:runtimeConfiguration:GetThingRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration = Maybe RuntimeConfiguration
a} :: GetThingRuntimeConfigurationResponse)
getThingRuntimeConfigurationResponse_httpStatus :: Lens.Lens' GetThingRuntimeConfigurationResponse Prelude.Int
getThingRuntimeConfigurationResponse_httpStatus :: Lens' GetThingRuntimeConfigurationResponse Int
getThingRuntimeConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThingRuntimeConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetThingRuntimeConfigurationResponse' :: GetThingRuntimeConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetThingRuntimeConfigurationResponse
s@GetThingRuntimeConfigurationResponse' {} Int
a -> GetThingRuntimeConfigurationResponse
s {$sel:httpStatus:GetThingRuntimeConfigurationResponse' :: Int
httpStatus = Int
a} :: GetThingRuntimeConfigurationResponse)
instance
Prelude.NFData
GetThingRuntimeConfigurationResponse
where
rnf :: GetThingRuntimeConfigurationResponse -> ()
rnf GetThingRuntimeConfigurationResponse' {Int
Maybe RuntimeConfiguration
httpStatus :: Int
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:httpStatus:GetThingRuntimeConfigurationResponse' :: GetThingRuntimeConfigurationResponse -> Int
$sel:runtimeConfiguration:GetThingRuntimeConfigurationResponse' :: GetThingRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RuntimeConfiguration
runtimeConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus