{-# 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.DevOpsGuru.UpdateEventSourcesConfig
(
UpdateEventSourcesConfig (..),
newUpdateEventSourcesConfig,
updateEventSourcesConfig_eventSources,
UpdateEventSourcesConfigResponse (..),
newUpdateEventSourcesConfigResponse,
updateEventSourcesConfigResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateEventSourcesConfig = UpdateEventSourcesConfig'
{
UpdateEventSourcesConfig -> Maybe EventSourcesConfig
eventSources :: Prelude.Maybe EventSourcesConfig
}
deriving (UpdateEventSourcesConfig -> UpdateEventSourcesConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventSourcesConfig -> UpdateEventSourcesConfig -> Bool
$c/= :: UpdateEventSourcesConfig -> UpdateEventSourcesConfig -> Bool
== :: UpdateEventSourcesConfig -> UpdateEventSourcesConfig -> Bool
$c== :: UpdateEventSourcesConfig -> UpdateEventSourcesConfig -> Bool
Prelude.Eq, ReadPrec [UpdateEventSourcesConfig]
ReadPrec UpdateEventSourcesConfig
Int -> ReadS UpdateEventSourcesConfig
ReadS [UpdateEventSourcesConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventSourcesConfig]
$creadListPrec :: ReadPrec [UpdateEventSourcesConfig]
readPrec :: ReadPrec UpdateEventSourcesConfig
$creadPrec :: ReadPrec UpdateEventSourcesConfig
readList :: ReadS [UpdateEventSourcesConfig]
$creadList :: ReadS [UpdateEventSourcesConfig]
readsPrec :: Int -> ReadS UpdateEventSourcesConfig
$creadsPrec :: Int -> ReadS UpdateEventSourcesConfig
Prelude.Read, Int -> UpdateEventSourcesConfig -> ShowS
[UpdateEventSourcesConfig] -> ShowS
UpdateEventSourcesConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventSourcesConfig] -> ShowS
$cshowList :: [UpdateEventSourcesConfig] -> ShowS
show :: UpdateEventSourcesConfig -> String
$cshow :: UpdateEventSourcesConfig -> String
showsPrec :: Int -> UpdateEventSourcesConfig -> ShowS
$cshowsPrec :: Int -> UpdateEventSourcesConfig -> ShowS
Prelude.Show, forall x.
Rep UpdateEventSourcesConfig x -> UpdateEventSourcesConfig
forall x.
UpdateEventSourcesConfig -> Rep UpdateEventSourcesConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEventSourcesConfig x -> UpdateEventSourcesConfig
$cfrom :: forall x.
UpdateEventSourcesConfig -> Rep UpdateEventSourcesConfig x
Prelude.Generic)
newUpdateEventSourcesConfig ::
UpdateEventSourcesConfig
newUpdateEventSourcesConfig :: UpdateEventSourcesConfig
newUpdateEventSourcesConfig =
UpdateEventSourcesConfig'
{ $sel:eventSources:UpdateEventSourcesConfig' :: Maybe EventSourcesConfig
eventSources =
forall a. Maybe a
Prelude.Nothing
}
updateEventSourcesConfig_eventSources :: Lens.Lens' UpdateEventSourcesConfig (Prelude.Maybe EventSourcesConfig)
updateEventSourcesConfig_eventSources :: Lens' UpdateEventSourcesConfig (Maybe EventSourcesConfig)
updateEventSourcesConfig_eventSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourcesConfig' {Maybe EventSourcesConfig
eventSources :: Maybe EventSourcesConfig
$sel:eventSources:UpdateEventSourcesConfig' :: UpdateEventSourcesConfig -> Maybe EventSourcesConfig
eventSources} -> Maybe EventSourcesConfig
eventSources) (\s :: UpdateEventSourcesConfig
s@UpdateEventSourcesConfig' {} Maybe EventSourcesConfig
a -> UpdateEventSourcesConfig
s {$sel:eventSources:UpdateEventSourcesConfig' :: Maybe EventSourcesConfig
eventSources = Maybe EventSourcesConfig
a} :: UpdateEventSourcesConfig)
instance Core.AWSRequest UpdateEventSourcesConfig where
type
AWSResponse UpdateEventSourcesConfig =
UpdateEventSourcesConfigResponse
request :: (Service -> Service)
-> UpdateEventSourcesConfig -> Request UpdateEventSourcesConfig
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 UpdateEventSourcesConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEventSourcesConfig)))
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 -> UpdateEventSourcesConfigResponse
UpdateEventSourcesConfigResponse'
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 UpdateEventSourcesConfig where
hashWithSalt :: Int -> UpdateEventSourcesConfig -> Int
hashWithSalt Int
_salt UpdateEventSourcesConfig' {Maybe EventSourcesConfig
eventSources :: Maybe EventSourcesConfig
$sel:eventSources:UpdateEventSourcesConfig' :: UpdateEventSourcesConfig -> Maybe EventSourcesConfig
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventSourcesConfig
eventSources
instance Prelude.NFData UpdateEventSourcesConfig where
rnf :: UpdateEventSourcesConfig -> ()
rnf UpdateEventSourcesConfig' {Maybe EventSourcesConfig
eventSources :: Maybe EventSourcesConfig
$sel:eventSources:UpdateEventSourcesConfig' :: UpdateEventSourcesConfig -> Maybe EventSourcesConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EventSourcesConfig
eventSources
instance Data.ToHeaders UpdateEventSourcesConfig where
toHeaders :: UpdateEventSourcesConfig -> 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 UpdateEventSourcesConfig where
toJSON :: UpdateEventSourcesConfig -> Value
toJSON UpdateEventSourcesConfig' {Maybe EventSourcesConfig
eventSources :: Maybe EventSourcesConfig
$sel:eventSources:UpdateEventSourcesConfig' :: UpdateEventSourcesConfig -> Maybe EventSourcesConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"EventSources" 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 EventSourcesConfig
eventSources]
)
instance Data.ToPath UpdateEventSourcesConfig where
toPath :: UpdateEventSourcesConfig -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/event-sources"
instance Data.ToQuery UpdateEventSourcesConfig where
toQuery :: UpdateEventSourcesConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateEventSourcesConfigResponse = UpdateEventSourcesConfigResponse'
{
UpdateEventSourcesConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEventSourcesConfigResponse
-> UpdateEventSourcesConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventSourcesConfigResponse
-> UpdateEventSourcesConfigResponse -> Bool
$c/= :: UpdateEventSourcesConfigResponse
-> UpdateEventSourcesConfigResponse -> Bool
== :: UpdateEventSourcesConfigResponse
-> UpdateEventSourcesConfigResponse -> Bool
$c== :: UpdateEventSourcesConfigResponse
-> UpdateEventSourcesConfigResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEventSourcesConfigResponse]
ReadPrec UpdateEventSourcesConfigResponse
Int -> ReadS UpdateEventSourcesConfigResponse
ReadS [UpdateEventSourcesConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventSourcesConfigResponse]
$creadListPrec :: ReadPrec [UpdateEventSourcesConfigResponse]
readPrec :: ReadPrec UpdateEventSourcesConfigResponse
$creadPrec :: ReadPrec UpdateEventSourcesConfigResponse
readList :: ReadS [UpdateEventSourcesConfigResponse]
$creadList :: ReadS [UpdateEventSourcesConfigResponse]
readsPrec :: Int -> ReadS UpdateEventSourcesConfigResponse
$creadsPrec :: Int -> ReadS UpdateEventSourcesConfigResponse
Prelude.Read, Int -> UpdateEventSourcesConfigResponse -> ShowS
[UpdateEventSourcesConfigResponse] -> ShowS
UpdateEventSourcesConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventSourcesConfigResponse] -> ShowS
$cshowList :: [UpdateEventSourcesConfigResponse] -> ShowS
show :: UpdateEventSourcesConfigResponse -> String
$cshow :: UpdateEventSourcesConfigResponse -> String
showsPrec :: Int -> UpdateEventSourcesConfigResponse -> ShowS
$cshowsPrec :: Int -> UpdateEventSourcesConfigResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateEventSourcesConfigResponse x
-> UpdateEventSourcesConfigResponse
forall x.
UpdateEventSourcesConfigResponse
-> Rep UpdateEventSourcesConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEventSourcesConfigResponse x
-> UpdateEventSourcesConfigResponse
$cfrom :: forall x.
UpdateEventSourcesConfigResponse
-> Rep UpdateEventSourcesConfigResponse x
Prelude.Generic)
newUpdateEventSourcesConfigResponse ::
Prelude.Int ->
UpdateEventSourcesConfigResponse
newUpdateEventSourcesConfigResponse :: Int -> UpdateEventSourcesConfigResponse
newUpdateEventSourcesConfigResponse Int
pHttpStatus_ =
UpdateEventSourcesConfigResponse'
{ $sel:httpStatus:UpdateEventSourcesConfigResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateEventSourcesConfigResponse_httpStatus :: Lens.Lens' UpdateEventSourcesConfigResponse Prelude.Int
updateEventSourcesConfigResponse_httpStatus :: Lens' UpdateEventSourcesConfigResponse Int
updateEventSourcesConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventSourcesConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEventSourcesConfigResponse' :: UpdateEventSourcesConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEventSourcesConfigResponse
s@UpdateEventSourcesConfigResponse' {} Int
a -> UpdateEventSourcesConfigResponse
s {$sel:httpStatus:UpdateEventSourcesConfigResponse' :: Int
httpStatus = Int
a} :: UpdateEventSourcesConfigResponse)
instance
Prelude.NFData
UpdateEventSourcesConfigResponse
where
rnf :: UpdateEventSourcesConfigResponse -> ()
rnf UpdateEventSourcesConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEventSourcesConfigResponse' :: UpdateEventSourcesConfigResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus