{-# 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.UpdateThingRuntimeConfiguration
(
UpdateThingRuntimeConfiguration (..),
newUpdateThingRuntimeConfiguration,
updateThingRuntimeConfiguration_telemetryConfiguration,
updateThingRuntimeConfiguration_thingName,
UpdateThingRuntimeConfigurationResponse (..),
newUpdateThingRuntimeConfigurationResponse,
updateThingRuntimeConfigurationResponse_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 UpdateThingRuntimeConfiguration = UpdateThingRuntimeConfiguration'
{
UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate
telemetryConfiguration :: Prelude.Maybe TelemetryConfigurationUpdate,
UpdateThingRuntimeConfiguration -> Text
thingName :: Prelude.Text
}
deriving (UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool
(UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool)
-> (UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool)
-> Eq UpdateThingRuntimeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool
$c/= :: UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool
== :: UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool
$c== :: UpdateThingRuntimeConfiguration
-> UpdateThingRuntimeConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateThingRuntimeConfiguration]
ReadPrec UpdateThingRuntimeConfiguration
Int -> ReadS UpdateThingRuntimeConfiguration
ReadS [UpdateThingRuntimeConfiguration]
(Int -> ReadS UpdateThingRuntimeConfiguration)
-> ReadS [UpdateThingRuntimeConfiguration]
-> ReadPrec UpdateThingRuntimeConfiguration
-> ReadPrec [UpdateThingRuntimeConfiguration]
-> Read UpdateThingRuntimeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThingRuntimeConfiguration]
$creadListPrec :: ReadPrec [UpdateThingRuntimeConfiguration]
readPrec :: ReadPrec UpdateThingRuntimeConfiguration
$creadPrec :: ReadPrec UpdateThingRuntimeConfiguration
readList :: ReadS [UpdateThingRuntimeConfiguration]
$creadList :: ReadS [UpdateThingRuntimeConfiguration]
readsPrec :: Int -> ReadS UpdateThingRuntimeConfiguration
$creadsPrec :: Int -> ReadS UpdateThingRuntimeConfiguration
Prelude.Read, Int -> UpdateThingRuntimeConfiguration -> ShowS
[UpdateThingRuntimeConfiguration] -> ShowS
UpdateThingRuntimeConfiguration -> String
(Int -> UpdateThingRuntimeConfiguration -> ShowS)
-> (UpdateThingRuntimeConfiguration -> String)
-> ([UpdateThingRuntimeConfiguration] -> ShowS)
-> Show UpdateThingRuntimeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThingRuntimeConfiguration] -> ShowS
$cshowList :: [UpdateThingRuntimeConfiguration] -> ShowS
show :: UpdateThingRuntimeConfiguration -> String
$cshow :: UpdateThingRuntimeConfiguration -> String
showsPrec :: Int -> UpdateThingRuntimeConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateThingRuntimeConfiguration -> ShowS
Prelude.Show, (forall x.
UpdateThingRuntimeConfiguration
-> Rep UpdateThingRuntimeConfiguration x)
-> (forall x.
Rep UpdateThingRuntimeConfiguration x
-> UpdateThingRuntimeConfiguration)
-> Generic UpdateThingRuntimeConfiguration
forall x.
Rep UpdateThingRuntimeConfiguration x
-> UpdateThingRuntimeConfiguration
forall x.
UpdateThingRuntimeConfiguration
-> Rep UpdateThingRuntimeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateThingRuntimeConfiguration x
-> UpdateThingRuntimeConfiguration
$cfrom :: forall x.
UpdateThingRuntimeConfiguration
-> Rep UpdateThingRuntimeConfiguration x
Prelude.Generic)
newUpdateThingRuntimeConfiguration ::
Prelude.Text ->
UpdateThingRuntimeConfiguration
newUpdateThingRuntimeConfiguration :: Text -> UpdateThingRuntimeConfiguration
newUpdateThingRuntimeConfiguration Text
pThingName_ =
UpdateThingRuntimeConfiguration' :: Maybe TelemetryConfigurationUpdate
-> Text -> UpdateThingRuntimeConfiguration
UpdateThingRuntimeConfiguration'
{ $sel:telemetryConfiguration:UpdateThingRuntimeConfiguration' :: Maybe TelemetryConfigurationUpdate
telemetryConfiguration =
Maybe TelemetryConfigurationUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:thingName:UpdateThingRuntimeConfiguration' :: Text
thingName = Text
pThingName_
}
updateThingRuntimeConfiguration_telemetryConfiguration :: Lens.Lens' UpdateThingRuntimeConfiguration (Prelude.Maybe TelemetryConfigurationUpdate)
updateThingRuntimeConfiguration_telemetryConfiguration :: (Maybe TelemetryConfigurationUpdate
-> f (Maybe TelemetryConfigurationUpdate))
-> UpdateThingRuntimeConfiguration
-> f UpdateThingRuntimeConfiguration
updateThingRuntimeConfiguration_telemetryConfiguration = (UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate)
-> (UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate
-> UpdateThingRuntimeConfiguration)
-> Lens
UpdateThingRuntimeConfiguration
UpdateThingRuntimeConfiguration
(Maybe TelemetryConfigurationUpdate)
(Maybe TelemetryConfigurationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingRuntimeConfiguration' {Maybe TelemetryConfigurationUpdate
telemetryConfiguration :: Maybe TelemetryConfigurationUpdate
$sel:telemetryConfiguration:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate
telemetryConfiguration} -> Maybe TelemetryConfigurationUpdate
telemetryConfiguration) (\s :: UpdateThingRuntimeConfiguration
s@UpdateThingRuntimeConfiguration' {} Maybe TelemetryConfigurationUpdate
a -> UpdateThingRuntimeConfiguration
s {$sel:telemetryConfiguration:UpdateThingRuntimeConfiguration' :: Maybe TelemetryConfigurationUpdate
telemetryConfiguration = Maybe TelemetryConfigurationUpdate
a} :: UpdateThingRuntimeConfiguration)
updateThingRuntimeConfiguration_thingName :: Lens.Lens' UpdateThingRuntimeConfiguration Prelude.Text
updateThingRuntimeConfiguration_thingName :: (Text -> f Text)
-> UpdateThingRuntimeConfiguration
-> f UpdateThingRuntimeConfiguration
updateThingRuntimeConfiguration_thingName = (UpdateThingRuntimeConfiguration -> Text)
-> (UpdateThingRuntimeConfiguration
-> Text -> UpdateThingRuntimeConfiguration)
-> Lens
UpdateThingRuntimeConfiguration
UpdateThingRuntimeConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingRuntimeConfiguration' {Text
thingName :: Text
$sel:thingName:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration -> Text
thingName} -> Text
thingName) (\s :: UpdateThingRuntimeConfiguration
s@UpdateThingRuntimeConfiguration' {} Text
a -> UpdateThingRuntimeConfiguration
s {$sel:thingName:UpdateThingRuntimeConfiguration' :: Text
thingName = Text
a} :: UpdateThingRuntimeConfiguration)
instance
Core.AWSRequest
UpdateThingRuntimeConfiguration
where
type
AWSResponse UpdateThingRuntimeConfiguration =
UpdateThingRuntimeConfigurationResponse
request :: UpdateThingRuntimeConfiguration
-> Request UpdateThingRuntimeConfiguration
request = Service
-> UpdateThingRuntimeConfiguration
-> Request UpdateThingRuntimeConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateThingRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateThingRuntimeConfiguration)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateThingRuntimeConfiguration))
-> Logger
-> Service
-> Proxy UpdateThingRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateThingRuntimeConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateThingRuntimeConfigurationResponse
UpdateThingRuntimeConfigurationResponse'
(Int -> UpdateThingRuntimeConfigurationResponse)
-> Either String Int
-> Either String UpdateThingRuntimeConfigurationResponse
forall (f :: * -> *) a b. Functor 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
UpdateThingRuntimeConfiguration
instance
Prelude.NFData
UpdateThingRuntimeConfiguration
instance
Core.ToHeaders
UpdateThingRuntimeConfiguration
where
toHeaders :: UpdateThingRuntimeConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateThingRuntimeConfiguration -> 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.ToJSON UpdateThingRuntimeConfiguration where
toJSON :: UpdateThingRuntimeConfiguration -> Value
toJSON UpdateThingRuntimeConfiguration' {Maybe TelemetryConfigurationUpdate
Text
thingName :: Text
telemetryConfiguration :: Maybe TelemetryConfigurationUpdate
$sel:thingName:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration -> Text
$sel:telemetryConfiguration:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TelemetryConfiguration" Text -> TelemetryConfigurationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TelemetryConfigurationUpdate -> Pair)
-> Maybe TelemetryConfigurationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TelemetryConfigurationUpdate
telemetryConfiguration
]
)
instance Core.ToPath UpdateThingRuntimeConfiguration where
toPath :: UpdateThingRuntimeConfiguration -> ByteString
toPath UpdateThingRuntimeConfiguration' {Maybe TelemetryConfigurationUpdate
Text
thingName :: Text
telemetryConfiguration :: Maybe TelemetryConfigurationUpdate
$sel:thingName:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration -> Text
$sel:telemetryConfiguration:UpdateThingRuntimeConfiguration' :: UpdateThingRuntimeConfiguration
-> Maybe TelemetryConfigurationUpdate
..} =
[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 UpdateThingRuntimeConfiguration where
toQuery :: UpdateThingRuntimeConfiguration -> QueryString
toQuery = QueryString -> UpdateThingRuntimeConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateThingRuntimeConfigurationResponse = UpdateThingRuntimeConfigurationResponse'
{
UpdateThingRuntimeConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool
(UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool)
-> (UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool)
-> Eq UpdateThingRuntimeConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool
$c/= :: UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool
== :: UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool
$c== :: UpdateThingRuntimeConfigurationResponse
-> UpdateThingRuntimeConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateThingRuntimeConfigurationResponse]
ReadPrec UpdateThingRuntimeConfigurationResponse
Int -> ReadS UpdateThingRuntimeConfigurationResponse
ReadS [UpdateThingRuntimeConfigurationResponse]
(Int -> ReadS UpdateThingRuntimeConfigurationResponse)
-> ReadS [UpdateThingRuntimeConfigurationResponse]
-> ReadPrec UpdateThingRuntimeConfigurationResponse
-> ReadPrec [UpdateThingRuntimeConfigurationResponse]
-> Read UpdateThingRuntimeConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThingRuntimeConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateThingRuntimeConfigurationResponse]
readPrec :: ReadPrec UpdateThingRuntimeConfigurationResponse
$creadPrec :: ReadPrec UpdateThingRuntimeConfigurationResponse
readList :: ReadS [UpdateThingRuntimeConfigurationResponse]
$creadList :: ReadS [UpdateThingRuntimeConfigurationResponse]
readsPrec :: Int -> ReadS UpdateThingRuntimeConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateThingRuntimeConfigurationResponse
Prelude.Read, Int -> UpdateThingRuntimeConfigurationResponse -> ShowS
[UpdateThingRuntimeConfigurationResponse] -> ShowS
UpdateThingRuntimeConfigurationResponse -> String
(Int -> UpdateThingRuntimeConfigurationResponse -> ShowS)
-> (UpdateThingRuntimeConfigurationResponse -> String)
-> ([UpdateThingRuntimeConfigurationResponse] -> ShowS)
-> Show UpdateThingRuntimeConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThingRuntimeConfigurationResponse] -> ShowS
$cshowList :: [UpdateThingRuntimeConfigurationResponse] -> ShowS
show :: UpdateThingRuntimeConfigurationResponse -> String
$cshow :: UpdateThingRuntimeConfigurationResponse -> String
showsPrec :: Int -> UpdateThingRuntimeConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateThingRuntimeConfigurationResponse -> ShowS
Prelude.Show, (forall x.
UpdateThingRuntimeConfigurationResponse
-> Rep UpdateThingRuntimeConfigurationResponse x)
-> (forall x.
Rep UpdateThingRuntimeConfigurationResponse x
-> UpdateThingRuntimeConfigurationResponse)
-> Generic UpdateThingRuntimeConfigurationResponse
forall x.
Rep UpdateThingRuntimeConfigurationResponse x
-> UpdateThingRuntimeConfigurationResponse
forall x.
UpdateThingRuntimeConfigurationResponse
-> Rep UpdateThingRuntimeConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateThingRuntimeConfigurationResponse x
-> UpdateThingRuntimeConfigurationResponse
$cfrom :: forall x.
UpdateThingRuntimeConfigurationResponse
-> Rep UpdateThingRuntimeConfigurationResponse x
Prelude.Generic)
newUpdateThingRuntimeConfigurationResponse ::
Prelude.Int ->
UpdateThingRuntimeConfigurationResponse
newUpdateThingRuntimeConfigurationResponse :: Int -> UpdateThingRuntimeConfigurationResponse
newUpdateThingRuntimeConfigurationResponse
Int
pHttpStatus_ =
UpdateThingRuntimeConfigurationResponse' :: Int -> UpdateThingRuntimeConfigurationResponse
UpdateThingRuntimeConfigurationResponse'
{ $sel:httpStatus:UpdateThingRuntimeConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateThingRuntimeConfigurationResponse_httpStatus :: Lens.Lens' UpdateThingRuntimeConfigurationResponse Prelude.Int
updateThingRuntimeConfigurationResponse_httpStatus :: (Int -> f Int)
-> UpdateThingRuntimeConfigurationResponse
-> f UpdateThingRuntimeConfigurationResponse
updateThingRuntimeConfigurationResponse_httpStatus = (UpdateThingRuntimeConfigurationResponse -> Int)
-> (UpdateThingRuntimeConfigurationResponse
-> Int -> UpdateThingRuntimeConfigurationResponse)
-> Lens
UpdateThingRuntimeConfigurationResponse
UpdateThingRuntimeConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingRuntimeConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateThingRuntimeConfigurationResponse' :: UpdateThingRuntimeConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateThingRuntimeConfigurationResponse
s@UpdateThingRuntimeConfigurationResponse' {} Int
a -> UpdateThingRuntimeConfigurationResponse
s {$sel:httpStatus:UpdateThingRuntimeConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateThingRuntimeConfigurationResponse)
instance
Prelude.NFData
UpdateThingRuntimeConfigurationResponse