{-# 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.AppIntegrationS.UpdateEventIntegration
(
UpdateEventIntegration (..),
newUpdateEventIntegration,
updateEventIntegration_description,
updateEventIntegration_name,
UpdateEventIntegrationResponse (..),
newUpdateEventIntegrationResponse,
updateEventIntegrationResponse_httpStatus,
)
where
import Amazonka.AppIntegrationS.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateEventIntegration = UpdateEventIntegration'
{
UpdateEventIntegration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateEventIntegration -> Text
name :: Prelude.Text
}
deriving (UpdateEventIntegration -> UpdateEventIntegration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventIntegration -> UpdateEventIntegration -> Bool
$c/= :: UpdateEventIntegration -> UpdateEventIntegration -> Bool
== :: UpdateEventIntegration -> UpdateEventIntegration -> Bool
$c== :: UpdateEventIntegration -> UpdateEventIntegration -> Bool
Prelude.Eq, ReadPrec [UpdateEventIntegration]
ReadPrec UpdateEventIntegration
Int -> ReadS UpdateEventIntegration
ReadS [UpdateEventIntegration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventIntegration]
$creadListPrec :: ReadPrec [UpdateEventIntegration]
readPrec :: ReadPrec UpdateEventIntegration
$creadPrec :: ReadPrec UpdateEventIntegration
readList :: ReadS [UpdateEventIntegration]
$creadList :: ReadS [UpdateEventIntegration]
readsPrec :: Int -> ReadS UpdateEventIntegration
$creadsPrec :: Int -> ReadS UpdateEventIntegration
Prelude.Read, Int -> UpdateEventIntegration -> ShowS
[UpdateEventIntegration] -> ShowS
UpdateEventIntegration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventIntegration] -> ShowS
$cshowList :: [UpdateEventIntegration] -> ShowS
show :: UpdateEventIntegration -> String
$cshow :: UpdateEventIntegration -> String
showsPrec :: Int -> UpdateEventIntegration -> ShowS
$cshowsPrec :: Int -> UpdateEventIntegration -> ShowS
Prelude.Show, forall x. Rep UpdateEventIntegration x -> UpdateEventIntegration
forall x. UpdateEventIntegration -> Rep UpdateEventIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEventIntegration x -> UpdateEventIntegration
$cfrom :: forall x. UpdateEventIntegration -> Rep UpdateEventIntegration x
Prelude.Generic)
newUpdateEventIntegration ::
Prelude.Text ->
UpdateEventIntegration
newUpdateEventIntegration :: Text -> UpdateEventIntegration
newUpdateEventIntegration Text
pName_ =
UpdateEventIntegration'
{ $sel:description:UpdateEventIntegration' :: Maybe Text
description =
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateEventIntegration' :: Text
name = Text
pName_
}
updateEventIntegration_description :: Lens.Lens' UpdateEventIntegration (Prelude.Maybe Prelude.Text)
updateEventIntegration_description :: Lens' UpdateEventIntegration (Maybe Text)
updateEventIntegration_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventIntegration' {Maybe Text
description :: Maybe Text
$sel:description:UpdateEventIntegration' :: UpdateEventIntegration -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateEventIntegration
s@UpdateEventIntegration' {} Maybe Text
a -> UpdateEventIntegration
s {$sel:description:UpdateEventIntegration' :: Maybe Text
description = Maybe Text
a} :: UpdateEventIntegration)
updateEventIntegration_name :: Lens.Lens' UpdateEventIntegration Prelude.Text
updateEventIntegration_name :: Lens' UpdateEventIntegration Text
updateEventIntegration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventIntegration' {Text
name :: Text
$sel:name:UpdateEventIntegration' :: UpdateEventIntegration -> Text
name} -> Text
name) (\s :: UpdateEventIntegration
s@UpdateEventIntegration' {} Text
a -> UpdateEventIntegration
s {$sel:name:UpdateEventIntegration' :: Text
name = Text
a} :: UpdateEventIntegration)
instance Core.AWSRequest UpdateEventIntegration where
type
AWSResponse UpdateEventIntegration =
UpdateEventIntegrationResponse
request :: (Service -> Service)
-> UpdateEventIntegration -> Request UpdateEventIntegration
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateEventIntegration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEventIntegration)))
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 -> UpdateEventIntegrationResponse
UpdateEventIntegrationResponse'
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 UpdateEventIntegration where
hashWithSalt :: Int -> UpdateEventIntegration -> Int
hashWithSalt Int
_salt UpdateEventIntegration' {Maybe Text
Text
name :: Text
description :: Maybe Text
$sel:name:UpdateEventIntegration' :: UpdateEventIntegration -> Text
$sel:description:UpdateEventIntegration' :: UpdateEventIntegration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData UpdateEventIntegration where
rnf :: UpdateEventIntegration -> ()
rnf UpdateEventIntegration' {Maybe Text
Text
name :: Text
description :: Maybe Text
$sel:name:UpdateEventIntegration' :: UpdateEventIntegration -> Text
$sel:description:UpdateEventIntegration' :: UpdateEventIntegration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders UpdateEventIntegration where
toHeaders :: UpdateEventIntegration -> 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 UpdateEventIntegration where
toJSON :: UpdateEventIntegration -> Value
toJSON UpdateEventIntegration' {Maybe Text
Text
name :: Text
description :: Maybe Text
$sel:name:UpdateEventIntegration' :: UpdateEventIntegration -> Text
$sel:description:UpdateEventIntegration' :: UpdateEventIntegration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Description" 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
description]
)
instance Data.ToPath UpdateEventIntegration where
toPath :: UpdateEventIntegration -> ByteString
toPath UpdateEventIntegration' {Maybe Text
Text
name :: Text
description :: Maybe Text
$sel:name:UpdateEventIntegration' :: UpdateEventIntegration -> Text
$sel:description:UpdateEventIntegration' :: UpdateEventIntegration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/eventIntegrations/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]
instance Data.ToQuery UpdateEventIntegration where
toQuery :: UpdateEventIntegration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateEventIntegrationResponse = UpdateEventIntegrationResponse'
{
UpdateEventIntegrationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEventIntegrationResponse
-> UpdateEventIntegrationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventIntegrationResponse
-> UpdateEventIntegrationResponse -> Bool
$c/= :: UpdateEventIntegrationResponse
-> UpdateEventIntegrationResponse -> Bool
== :: UpdateEventIntegrationResponse
-> UpdateEventIntegrationResponse -> Bool
$c== :: UpdateEventIntegrationResponse
-> UpdateEventIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEventIntegrationResponse]
ReadPrec UpdateEventIntegrationResponse
Int -> ReadS UpdateEventIntegrationResponse
ReadS [UpdateEventIntegrationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventIntegrationResponse]
$creadListPrec :: ReadPrec [UpdateEventIntegrationResponse]
readPrec :: ReadPrec UpdateEventIntegrationResponse
$creadPrec :: ReadPrec UpdateEventIntegrationResponse
readList :: ReadS [UpdateEventIntegrationResponse]
$creadList :: ReadS [UpdateEventIntegrationResponse]
readsPrec :: Int -> ReadS UpdateEventIntegrationResponse
$creadsPrec :: Int -> ReadS UpdateEventIntegrationResponse
Prelude.Read, Int -> UpdateEventIntegrationResponse -> ShowS
[UpdateEventIntegrationResponse] -> ShowS
UpdateEventIntegrationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventIntegrationResponse] -> ShowS
$cshowList :: [UpdateEventIntegrationResponse] -> ShowS
show :: UpdateEventIntegrationResponse -> String
$cshow :: UpdateEventIntegrationResponse -> String
showsPrec :: Int -> UpdateEventIntegrationResponse -> ShowS
$cshowsPrec :: Int -> UpdateEventIntegrationResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateEventIntegrationResponse x
-> UpdateEventIntegrationResponse
forall x.
UpdateEventIntegrationResponse
-> Rep UpdateEventIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEventIntegrationResponse x
-> UpdateEventIntegrationResponse
$cfrom :: forall x.
UpdateEventIntegrationResponse
-> Rep UpdateEventIntegrationResponse x
Prelude.Generic)
newUpdateEventIntegrationResponse ::
Prelude.Int ->
UpdateEventIntegrationResponse
newUpdateEventIntegrationResponse :: Int -> UpdateEventIntegrationResponse
newUpdateEventIntegrationResponse Int
pHttpStatus_ =
UpdateEventIntegrationResponse'
{ $sel:httpStatus:UpdateEventIntegrationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateEventIntegrationResponse_httpStatus :: Lens.Lens' UpdateEventIntegrationResponse Prelude.Int
updateEventIntegrationResponse_httpStatus :: Lens' UpdateEventIntegrationResponse Int
updateEventIntegrationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventIntegrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEventIntegrationResponse' :: UpdateEventIntegrationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEventIntegrationResponse
s@UpdateEventIntegrationResponse' {} Int
a -> UpdateEventIntegrationResponse
s {$sel:httpStatus:UpdateEventIntegrationResponse' :: Int
httpStatus = Int
a} :: UpdateEventIntegrationResponse)
instance
Prelude.NFData
UpdateEventIntegrationResponse
where
rnf :: UpdateEventIntegrationResponse -> ()
rnf UpdateEventIntegrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEventIntegrationResponse' :: UpdateEventIntegrationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus