{-# 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 Amazonka.Greengrass.Types
import qualified Amazonka.Lens as Lens
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
(GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool)
-> (GetThingRuntimeConfiguration
-> GetThingRuntimeConfiguration -> Bool)
-> Eq GetThingRuntimeConfiguration
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]
(Int -> ReadS GetThingRuntimeConfiguration)
-> ReadS [GetThingRuntimeConfiguration]
-> ReadPrec GetThingRuntimeConfiguration
-> ReadPrec [GetThingRuntimeConfiguration]
-> Read 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
(Int -> GetThingRuntimeConfiguration -> ShowS)
-> (GetThingRuntimeConfiguration -> String)
-> ([GetThingRuntimeConfiguration] -> ShowS)
-> Show GetThingRuntimeConfiguration
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.
GetThingRuntimeConfiguration -> Rep GetThingRuntimeConfiguration x)
-> (forall x.
Rep GetThingRuntimeConfiguration x -> GetThingRuntimeConfiguration)
-> Generic GetThingRuntimeConfiguration
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' :: Text -> GetThingRuntimeConfiguration
GetThingRuntimeConfiguration'
{ $sel:thingName:GetThingRuntimeConfiguration' :: Text
thingName =
Text
pThingName_
}
getThingRuntimeConfiguration_thingName :: Lens.Lens' GetThingRuntimeConfiguration Prelude.Text
getThingRuntimeConfiguration_thingName :: (Text -> f Text)
-> GetThingRuntimeConfiguration -> f GetThingRuntimeConfiguration
getThingRuntimeConfiguration_thingName = (GetThingRuntimeConfiguration -> Text)
-> (GetThingRuntimeConfiguration
-> Text -> GetThingRuntimeConfiguration)
-> Lens
GetThingRuntimeConfiguration GetThingRuntimeConfiguration Text Text
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 :: GetThingRuntimeConfiguration
-> Request GetThingRuntimeConfiguration
request = Service
-> GetThingRuntimeConfiguration
-> Request GetThingRuntimeConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetThingRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThingRuntimeConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetThingRuntimeConfiguration))
-> Logger
-> Service
-> Proxy GetThingRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThingRuntimeConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RuntimeConfiguration
-> Int -> GetThingRuntimeConfigurationResponse
GetThingRuntimeConfigurationResponse'
(Maybe RuntimeConfiguration
-> Int -> GetThingRuntimeConfigurationResponse)
-> Either String (Maybe RuntimeConfiguration)
-> Either String (Int -> GetThingRuntimeConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RuntimeConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RuntimeConfiguration")
Either String (Int -> GetThingRuntimeConfigurationResponse)
-> Either String Int
-> Either String GetThingRuntimeConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetThingRuntimeConfiguration
instance Prelude.NFData GetThingRuntimeConfiguration
instance Core.ToHeaders GetThingRuntimeConfiguration where
toHeaders :: GetThingRuntimeConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetThingRuntimeConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath GetThingRuntimeConfiguration where
toPath :: GetThingRuntimeConfiguration -> ByteString
toPath GetThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:GetThingRuntimeConfiguration' :: GetThingRuntimeConfiguration -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/things/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
thingName,
ByteString
"/runtimeconfig"
]
instance Core.ToQuery GetThingRuntimeConfiguration where
toQuery :: GetThingRuntimeConfiguration -> QueryString
toQuery = QueryString -> GetThingRuntimeConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool)
-> (GetThingRuntimeConfigurationResponse
-> GetThingRuntimeConfigurationResponse -> Bool)
-> Eq GetThingRuntimeConfigurationResponse
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]
(Int -> ReadS GetThingRuntimeConfigurationResponse)
-> ReadS [GetThingRuntimeConfigurationResponse]
-> ReadPrec GetThingRuntimeConfigurationResponse
-> ReadPrec [GetThingRuntimeConfigurationResponse]
-> Read 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
(Int -> GetThingRuntimeConfigurationResponse -> ShowS)
-> (GetThingRuntimeConfigurationResponse -> String)
-> ([GetThingRuntimeConfigurationResponse] -> ShowS)
-> Show GetThingRuntimeConfigurationResponse
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.
GetThingRuntimeConfigurationResponse
-> Rep GetThingRuntimeConfigurationResponse x)
-> (forall x.
Rep GetThingRuntimeConfigurationResponse x
-> GetThingRuntimeConfigurationResponse)
-> Generic GetThingRuntimeConfigurationResponse
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' :: Maybe RuntimeConfiguration
-> Int -> GetThingRuntimeConfigurationResponse
GetThingRuntimeConfigurationResponse'
{ $sel:runtimeConfiguration:GetThingRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration =
Maybe RuntimeConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetThingRuntimeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getThingRuntimeConfigurationResponse_runtimeConfiguration :: Lens.Lens' GetThingRuntimeConfigurationResponse (Prelude.Maybe RuntimeConfiguration)
getThingRuntimeConfigurationResponse_runtimeConfiguration :: (Maybe RuntimeConfiguration -> f (Maybe RuntimeConfiguration))
-> GetThingRuntimeConfigurationResponse
-> f GetThingRuntimeConfigurationResponse
getThingRuntimeConfigurationResponse_runtimeConfiguration = (GetThingRuntimeConfigurationResponse
-> Maybe RuntimeConfiguration)
-> (GetThingRuntimeConfigurationResponse
-> Maybe RuntimeConfiguration
-> GetThingRuntimeConfigurationResponse)
-> Lens
GetThingRuntimeConfigurationResponse
GetThingRuntimeConfigurationResponse
(Maybe RuntimeConfiguration)
(Maybe 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 :: (Int -> f Int)
-> GetThingRuntimeConfigurationResponse
-> f GetThingRuntimeConfigurationResponse
getThingRuntimeConfigurationResponse_httpStatus = (GetThingRuntimeConfigurationResponse -> Int)
-> (GetThingRuntimeConfigurationResponse
-> Int -> GetThingRuntimeConfigurationResponse)
-> Lens
GetThingRuntimeConfigurationResponse
GetThingRuntimeConfigurationResponse
Int
Int
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