{-# 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.UpdateSubscriptionDefinition
(
UpdateSubscriptionDefinition (..),
newUpdateSubscriptionDefinition,
updateSubscriptionDefinition_name,
updateSubscriptionDefinition_subscriptionDefinitionId,
UpdateSubscriptionDefinitionResponse (..),
newUpdateSubscriptionDefinitionResponse,
updateSubscriptionDefinitionResponse_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 UpdateSubscriptionDefinition = UpdateSubscriptionDefinition'
{
UpdateSubscriptionDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateSubscriptionDefinition -> Text
subscriptionDefinitionId :: Prelude.Text
}
deriving (UpdateSubscriptionDefinition
-> UpdateSubscriptionDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSubscriptionDefinition
-> UpdateSubscriptionDefinition -> Bool
$c/= :: UpdateSubscriptionDefinition
-> UpdateSubscriptionDefinition -> Bool
== :: UpdateSubscriptionDefinition
-> UpdateSubscriptionDefinition -> Bool
$c== :: UpdateSubscriptionDefinition
-> UpdateSubscriptionDefinition -> Bool
Prelude.Eq, ReadPrec [UpdateSubscriptionDefinition]
ReadPrec UpdateSubscriptionDefinition
Int -> ReadS UpdateSubscriptionDefinition
ReadS [UpdateSubscriptionDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSubscriptionDefinition]
$creadListPrec :: ReadPrec [UpdateSubscriptionDefinition]
readPrec :: ReadPrec UpdateSubscriptionDefinition
$creadPrec :: ReadPrec UpdateSubscriptionDefinition
readList :: ReadS [UpdateSubscriptionDefinition]
$creadList :: ReadS [UpdateSubscriptionDefinition]
readsPrec :: Int -> ReadS UpdateSubscriptionDefinition
$creadsPrec :: Int -> ReadS UpdateSubscriptionDefinition
Prelude.Read, Int -> UpdateSubscriptionDefinition -> ShowS
[UpdateSubscriptionDefinition] -> ShowS
UpdateSubscriptionDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSubscriptionDefinition] -> ShowS
$cshowList :: [UpdateSubscriptionDefinition] -> ShowS
show :: UpdateSubscriptionDefinition -> String
$cshow :: UpdateSubscriptionDefinition -> String
showsPrec :: Int -> UpdateSubscriptionDefinition -> ShowS
$cshowsPrec :: Int -> UpdateSubscriptionDefinition -> ShowS
Prelude.Show, forall x.
Rep UpdateSubscriptionDefinition x -> UpdateSubscriptionDefinition
forall x.
UpdateSubscriptionDefinition -> Rep UpdateSubscriptionDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSubscriptionDefinition x -> UpdateSubscriptionDefinition
$cfrom :: forall x.
UpdateSubscriptionDefinition -> Rep UpdateSubscriptionDefinition x
Prelude.Generic)
newUpdateSubscriptionDefinition ::
Prelude.Text ->
UpdateSubscriptionDefinition
newUpdateSubscriptionDefinition :: Text -> UpdateSubscriptionDefinition
newUpdateSubscriptionDefinition
Text
pSubscriptionDefinitionId_ =
UpdateSubscriptionDefinition'
{ $sel:name:UpdateSubscriptionDefinition' :: Maybe Text
name =
forall a. Maybe a
Prelude.Nothing,
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: Text
subscriptionDefinitionId =
Text
pSubscriptionDefinitionId_
}
updateSubscriptionDefinition_name :: Lens.Lens' UpdateSubscriptionDefinition (Prelude.Maybe Prelude.Text)
updateSubscriptionDefinition_name :: Lens' UpdateSubscriptionDefinition (Maybe Text)
updateSubscriptionDefinition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSubscriptionDefinition' {Maybe Text
name :: Maybe Text
$sel:name:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateSubscriptionDefinition
s@UpdateSubscriptionDefinition' {} Maybe Text
a -> UpdateSubscriptionDefinition
s {$sel:name:UpdateSubscriptionDefinition' :: Maybe Text
name = Maybe Text
a} :: UpdateSubscriptionDefinition)
updateSubscriptionDefinition_subscriptionDefinitionId :: Lens.Lens' UpdateSubscriptionDefinition Prelude.Text
updateSubscriptionDefinition_subscriptionDefinitionId :: Lens' UpdateSubscriptionDefinition Text
updateSubscriptionDefinition_subscriptionDefinitionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Text
subscriptionDefinitionId} -> Text
subscriptionDefinitionId) (\s :: UpdateSubscriptionDefinition
s@UpdateSubscriptionDefinition' {} Text
a -> UpdateSubscriptionDefinition
s {$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: Text
subscriptionDefinitionId = Text
a} :: UpdateSubscriptionDefinition)
instance Core.AWSRequest UpdateSubscriptionDefinition where
type
AWSResponse UpdateSubscriptionDefinition =
UpdateSubscriptionDefinitionResponse
request :: (Service -> Service)
-> UpdateSubscriptionDefinition
-> Request UpdateSubscriptionDefinition
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 UpdateSubscriptionDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSubscriptionDefinition)))
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 -> UpdateSubscriptionDefinitionResponse
UpdateSubscriptionDefinitionResponse'
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
UpdateSubscriptionDefinition
where
hashWithSalt :: Int -> UpdateSubscriptionDefinition -> Int
hashWithSalt Int
_salt UpdateSubscriptionDefinition' {Maybe Text
Text
subscriptionDefinitionId :: Text
name :: Maybe Text
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Text
$sel:name:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> 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
subscriptionDefinitionId
instance Prelude.NFData UpdateSubscriptionDefinition where
rnf :: UpdateSubscriptionDefinition -> ()
rnf UpdateSubscriptionDefinition' {Maybe Text
Text
subscriptionDefinitionId :: Text
name :: Maybe Text
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Text
$sel:name:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> 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
subscriptionDefinitionId
instance Data.ToHeaders UpdateSubscriptionDefinition where
toHeaders :: UpdateSubscriptionDefinition -> 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 UpdateSubscriptionDefinition where
toJSON :: UpdateSubscriptionDefinition -> Value
toJSON UpdateSubscriptionDefinition' {Maybe Text
Text
subscriptionDefinitionId :: Text
name :: Maybe Text
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Text
$sel:name:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> 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 UpdateSubscriptionDefinition where
toPath :: UpdateSubscriptionDefinition -> ByteString
toPath UpdateSubscriptionDefinition' {Maybe Text
Text
subscriptionDefinitionId :: Text
name :: Maybe Text
$sel:subscriptionDefinitionId:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Text
$sel:name:UpdateSubscriptionDefinition' :: UpdateSubscriptionDefinition -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/definition/subscriptions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
subscriptionDefinitionId
]
instance Data.ToQuery UpdateSubscriptionDefinition where
toQuery :: UpdateSubscriptionDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateSubscriptionDefinitionResponse = UpdateSubscriptionDefinitionResponse'
{
UpdateSubscriptionDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSubscriptionDefinitionResponse
-> UpdateSubscriptionDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSubscriptionDefinitionResponse
-> UpdateSubscriptionDefinitionResponse -> Bool
$c/= :: UpdateSubscriptionDefinitionResponse
-> UpdateSubscriptionDefinitionResponse -> Bool
== :: UpdateSubscriptionDefinitionResponse
-> UpdateSubscriptionDefinitionResponse -> Bool
$c== :: UpdateSubscriptionDefinitionResponse
-> UpdateSubscriptionDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSubscriptionDefinitionResponse]
ReadPrec UpdateSubscriptionDefinitionResponse
Int -> ReadS UpdateSubscriptionDefinitionResponse
ReadS [UpdateSubscriptionDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSubscriptionDefinitionResponse]
$creadListPrec :: ReadPrec [UpdateSubscriptionDefinitionResponse]
readPrec :: ReadPrec UpdateSubscriptionDefinitionResponse
$creadPrec :: ReadPrec UpdateSubscriptionDefinitionResponse
readList :: ReadS [UpdateSubscriptionDefinitionResponse]
$creadList :: ReadS [UpdateSubscriptionDefinitionResponse]
readsPrec :: Int -> ReadS UpdateSubscriptionDefinitionResponse
$creadsPrec :: Int -> ReadS UpdateSubscriptionDefinitionResponse
Prelude.Read, Int -> UpdateSubscriptionDefinitionResponse -> ShowS
[UpdateSubscriptionDefinitionResponse] -> ShowS
UpdateSubscriptionDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSubscriptionDefinitionResponse] -> ShowS
$cshowList :: [UpdateSubscriptionDefinitionResponse] -> ShowS
show :: UpdateSubscriptionDefinitionResponse -> String
$cshow :: UpdateSubscriptionDefinitionResponse -> String
showsPrec :: Int -> UpdateSubscriptionDefinitionResponse -> ShowS
$cshowsPrec :: Int -> UpdateSubscriptionDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateSubscriptionDefinitionResponse x
-> UpdateSubscriptionDefinitionResponse
forall x.
UpdateSubscriptionDefinitionResponse
-> Rep UpdateSubscriptionDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSubscriptionDefinitionResponse x
-> UpdateSubscriptionDefinitionResponse
$cfrom :: forall x.
UpdateSubscriptionDefinitionResponse
-> Rep UpdateSubscriptionDefinitionResponse x
Prelude.Generic)
newUpdateSubscriptionDefinitionResponse ::
Prelude.Int ->
UpdateSubscriptionDefinitionResponse
newUpdateSubscriptionDefinitionResponse :: Int -> UpdateSubscriptionDefinitionResponse
newUpdateSubscriptionDefinitionResponse Int
pHttpStatus_ =
UpdateSubscriptionDefinitionResponse'
{ $sel:httpStatus:UpdateSubscriptionDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateSubscriptionDefinitionResponse_httpStatus :: Lens.Lens' UpdateSubscriptionDefinitionResponse Prelude.Int
updateSubscriptionDefinitionResponse_httpStatus :: Lens' UpdateSubscriptionDefinitionResponse Int
updateSubscriptionDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSubscriptionDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSubscriptionDefinitionResponse' :: UpdateSubscriptionDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSubscriptionDefinitionResponse
s@UpdateSubscriptionDefinitionResponse' {} Int
a -> UpdateSubscriptionDefinitionResponse
s {$sel:httpStatus:UpdateSubscriptionDefinitionResponse' :: Int
httpStatus = Int
a} :: UpdateSubscriptionDefinitionResponse)
instance
Prelude.NFData
UpdateSubscriptionDefinitionResponse
where
rnf :: UpdateSubscriptionDefinitionResponse -> ()
rnf UpdateSubscriptionDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSubscriptionDefinitionResponse' :: UpdateSubscriptionDefinitionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus