{-# 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.UpdateLoggerDefinition
(
UpdateLoggerDefinition (..),
newUpdateLoggerDefinition,
updateLoggerDefinition_name,
updateLoggerDefinition_loggerDefinitionId,
UpdateLoggerDefinitionResponse (..),
newUpdateLoggerDefinitionResponse,
updateLoggerDefinitionResponse_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 UpdateLoggerDefinition = UpdateLoggerDefinition'
{
UpdateLoggerDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateLoggerDefinition -> Text
loggerDefinitionId :: Prelude.Text
}
deriving (UpdateLoggerDefinition -> UpdateLoggerDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLoggerDefinition -> UpdateLoggerDefinition -> Bool
$c/= :: UpdateLoggerDefinition -> UpdateLoggerDefinition -> Bool
== :: UpdateLoggerDefinition -> UpdateLoggerDefinition -> Bool
$c== :: UpdateLoggerDefinition -> UpdateLoggerDefinition -> Bool
Prelude.Eq, ReadPrec [UpdateLoggerDefinition]
ReadPrec UpdateLoggerDefinition
Int -> ReadS UpdateLoggerDefinition
ReadS [UpdateLoggerDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLoggerDefinition]
$creadListPrec :: ReadPrec [UpdateLoggerDefinition]
readPrec :: ReadPrec UpdateLoggerDefinition
$creadPrec :: ReadPrec UpdateLoggerDefinition
readList :: ReadS [UpdateLoggerDefinition]
$creadList :: ReadS [UpdateLoggerDefinition]
readsPrec :: Int -> ReadS UpdateLoggerDefinition
$creadsPrec :: Int -> ReadS UpdateLoggerDefinition
Prelude.Read, Int -> UpdateLoggerDefinition -> ShowS
[UpdateLoggerDefinition] -> ShowS
UpdateLoggerDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLoggerDefinition] -> ShowS
$cshowList :: [UpdateLoggerDefinition] -> ShowS
show :: UpdateLoggerDefinition -> String
$cshow :: UpdateLoggerDefinition -> String
showsPrec :: Int -> UpdateLoggerDefinition -> ShowS
$cshowsPrec :: Int -> UpdateLoggerDefinition -> ShowS
Prelude.Show, forall x. Rep UpdateLoggerDefinition x -> UpdateLoggerDefinition
forall x. UpdateLoggerDefinition -> Rep UpdateLoggerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLoggerDefinition x -> UpdateLoggerDefinition
$cfrom :: forall x. UpdateLoggerDefinition -> Rep UpdateLoggerDefinition x
Prelude.Generic)
newUpdateLoggerDefinition ::
Prelude.Text ->
UpdateLoggerDefinition
newUpdateLoggerDefinition :: Text -> UpdateLoggerDefinition
newUpdateLoggerDefinition Text
pLoggerDefinitionId_ =
UpdateLoggerDefinition'
{ $sel:name:UpdateLoggerDefinition' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: Text
loggerDefinitionId = Text
pLoggerDefinitionId_
}
updateLoggerDefinition_name :: Lens.Lens' UpdateLoggerDefinition (Prelude.Maybe Prelude.Text)
updateLoggerDefinition_name :: Lens' UpdateLoggerDefinition (Maybe Text)
updateLoggerDefinition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLoggerDefinition' {Maybe Text
name :: Maybe Text
$sel:name:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateLoggerDefinition
s@UpdateLoggerDefinition' {} Maybe Text
a -> UpdateLoggerDefinition
s {$sel:name:UpdateLoggerDefinition' :: Maybe Text
name = Maybe Text
a} :: UpdateLoggerDefinition)
updateLoggerDefinition_loggerDefinitionId :: Lens.Lens' UpdateLoggerDefinition Prelude.Text
updateLoggerDefinition_loggerDefinitionId :: Lens' UpdateLoggerDefinition Text
updateLoggerDefinition_loggerDefinitionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLoggerDefinition' {Text
loggerDefinitionId :: Text
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Text
loggerDefinitionId} -> Text
loggerDefinitionId) (\s :: UpdateLoggerDefinition
s@UpdateLoggerDefinition' {} Text
a -> UpdateLoggerDefinition
s {$sel:loggerDefinitionId:UpdateLoggerDefinition' :: Text
loggerDefinitionId = Text
a} :: UpdateLoggerDefinition)
instance Core.AWSRequest UpdateLoggerDefinition where
type
AWSResponse UpdateLoggerDefinition =
UpdateLoggerDefinitionResponse
request :: (Service -> Service)
-> UpdateLoggerDefinition -> Request UpdateLoggerDefinition
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateLoggerDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateLoggerDefinition)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateLoggerDefinitionResponse
UpdateLoggerDefinitionResponse'
forall (f :: * -> *) a b. Functor 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 UpdateLoggerDefinition where
hashWithSalt :: Int -> UpdateLoggerDefinition -> Int
hashWithSalt Int
_salt UpdateLoggerDefinition' {Maybe Text
Text
loggerDefinitionId :: Text
name :: Maybe Text
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Text
$sel:name:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loggerDefinitionId
instance Prelude.NFData UpdateLoggerDefinition where
rnf :: UpdateLoggerDefinition -> ()
rnf UpdateLoggerDefinition' {Maybe Text
Text
loggerDefinitionId :: Text
name :: Maybe Text
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Text
$sel:name:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
loggerDefinitionId
instance Data.ToHeaders UpdateLoggerDefinition where
toHeaders :: UpdateLoggerDefinition -> 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.ToJSON UpdateLoggerDefinition where
toJSON :: UpdateLoggerDefinition -> Value
toJSON UpdateLoggerDefinition' {Maybe Text
Text
loggerDefinitionId :: Text
name :: Maybe Text
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Text
$sel:name:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name]
)
instance Data.ToPath UpdateLoggerDefinition where
toPath :: UpdateLoggerDefinition -> ByteString
toPath UpdateLoggerDefinition' {Maybe Text
Text
loggerDefinitionId :: Text
name :: Maybe Text
$sel:loggerDefinitionId:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Text
$sel:name:UpdateLoggerDefinition' :: UpdateLoggerDefinition -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/definition/loggers/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
loggerDefinitionId
]
instance Data.ToQuery UpdateLoggerDefinition where
toQuery :: UpdateLoggerDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateLoggerDefinitionResponse = UpdateLoggerDefinitionResponse'
{
UpdateLoggerDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateLoggerDefinitionResponse
-> UpdateLoggerDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLoggerDefinitionResponse
-> UpdateLoggerDefinitionResponse -> Bool
$c/= :: UpdateLoggerDefinitionResponse
-> UpdateLoggerDefinitionResponse -> Bool
== :: UpdateLoggerDefinitionResponse
-> UpdateLoggerDefinitionResponse -> Bool
$c== :: UpdateLoggerDefinitionResponse
-> UpdateLoggerDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLoggerDefinitionResponse]
ReadPrec UpdateLoggerDefinitionResponse
Int -> ReadS UpdateLoggerDefinitionResponse
ReadS [UpdateLoggerDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLoggerDefinitionResponse]
$creadListPrec :: ReadPrec [UpdateLoggerDefinitionResponse]
readPrec :: ReadPrec UpdateLoggerDefinitionResponse
$creadPrec :: ReadPrec UpdateLoggerDefinitionResponse
readList :: ReadS [UpdateLoggerDefinitionResponse]
$creadList :: ReadS [UpdateLoggerDefinitionResponse]
readsPrec :: Int -> ReadS UpdateLoggerDefinitionResponse
$creadsPrec :: Int -> ReadS UpdateLoggerDefinitionResponse
Prelude.Read, Int -> UpdateLoggerDefinitionResponse -> ShowS
[UpdateLoggerDefinitionResponse] -> ShowS
UpdateLoggerDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLoggerDefinitionResponse] -> ShowS
$cshowList :: [UpdateLoggerDefinitionResponse] -> ShowS
show :: UpdateLoggerDefinitionResponse -> String
$cshow :: UpdateLoggerDefinitionResponse -> String
showsPrec :: Int -> UpdateLoggerDefinitionResponse -> ShowS
$cshowsPrec :: Int -> UpdateLoggerDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateLoggerDefinitionResponse x
-> UpdateLoggerDefinitionResponse
forall x.
UpdateLoggerDefinitionResponse
-> Rep UpdateLoggerDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLoggerDefinitionResponse x
-> UpdateLoggerDefinitionResponse
$cfrom :: forall x.
UpdateLoggerDefinitionResponse
-> Rep UpdateLoggerDefinitionResponse x
Prelude.Generic)
newUpdateLoggerDefinitionResponse ::
Prelude.Int ->
UpdateLoggerDefinitionResponse
newUpdateLoggerDefinitionResponse :: Int -> UpdateLoggerDefinitionResponse
newUpdateLoggerDefinitionResponse Int
pHttpStatus_ =
UpdateLoggerDefinitionResponse'
{ $sel:httpStatus:UpdateLoggerDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateLoggerDefinitionResponse_httpStatus :: Lens.Lens' UpdateLoggerDefinitionResponse Prelude.Int
updateLoggerDefinitionResponse_httpStatus :: Lens' UpdateLoggerDefinitionResponse Int
updateLoggerDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLoggerDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLoggerDefinitionResponse' :: UpdateLoggerDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateLoggerDefinitionResponse
s@UpdateLoggerDefinitionResponse' {} Int
a -> UpdateLoggerDefinitionResponse
s {$sel:httpStatus:UpdateLoggerDefinitionResponse' :: Int
httpStatus = Int
a} :: UpdateLoggerDefinitionResponse)
instance
Prelude.NFData
UpdateLoggerDefinitionResponse
where
rnf :: UpdateLoggerDefinitionResponse -> ()
rnf UpdateLoggerDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLoggerDefinitionResponse' :: UpdateLoggerDefinitionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus