{-# 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.UpdateServiceIntegration
(
UpdateServiceIntegration (..),
newUpdateServiceIntegration,
updateServiceIntegration_serviceIntegration,
UpdateServiceIntegrationResponse (..),
newUpdateServiceIntegrationResponse,
updateServiceIntegrationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.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 UpdateServiceIntegration = UpdateServiceIntegration'
{
UpdateServiceIntegration -> UpdateServiceIntegrationConfig
serviceIntegration :: UpdateServiceIntegrationConfig
}
deriving (UpdateServiceIntegration -> UpdateServiceIntegration -> Bool
(UpdateServiceIntegration -> UpdateServiceIntegration -> Bool)
-> (UpdateServiceIntegration -> UpdateServiceIntegration -> Bool)
-> Eq UpdateServiceIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceIntegration -> UpdateServiceIntegration -> Bool
$c/= :: UpdateServiceIntegration -> UpdateServiceIntegration -> Bool
== :: UpdateServiceIntegration -> UpdateServiceIntegration -> Bool
$c== :: UpdateServiceIntegration -> UpdateServiceIntegration -> Bool
Prelude.Eq, ReadPrec [UpdateServiceIntegration]
ReadPrec UpdateServiceIntegration
Int -> ReadS UpdateServiceIntegration
ReadS [UpdateServiceIntegration]
(Int -> ReadS UpdateServiceIntegration)
-> ReadS [UpdateServiceIntegration]
-> ReadPrec UpdateServiceIntegration
-> ReadPrec [UpdateServiceIntegration]
-> Read UpdateServiceIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceIntegration]
$creadListPrec :: ReadPrec [UpdateServiceIntegration]
readPrec :: ReadPrec UpdateServiceIntegration
$creadPrec :: ReadPrec UpdateServiceIntegration
readList :: ReadS [UpdateServiceIntegration]
$creadList :: ReadS [UpdateServiceIntegration]
readsPrec :: Int -> ReadS UpdateServiceIntegration
$creadsPrec :: Int -> ReadS UpdateServiceIntegration
Prelude.Read, Int -> UpdateServiceIntegration -> ShowS
[UpdateServiceIntegration] -> ShowS
UpdateServiceIntegration -> String
(Int -> UpdateServiceIntegration -> ShowS)
-> (UpdateServiceIntegration -> String)
-> ([UpdateServiceIntegration] -> ShowS)
-> Show UpdateServiceIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceIntegration] -> ShowS
$cshowList :: [UpdateServiceIntegration] -> ShowS
show :: UpdateServiceIntegration -> String
$cshow :: UpdateServiceIntegration -> String
showsPrec :: Int -> UpdateServiceIntegration -> ShowS
$cshowsPrec :: Int -> UpdateServiceIntegration -> ShowS
Prelude.Show, (forall x.
UpdateServiceIntegration -> Rep UpdateServiceIntegration x)
-> (forall x.
Rep UpdateServiceIntegration x -> UpdateServiceIntegration)
-> Generic UpdateServiceIntegration
forall x.
Rep UpdateServiceIntegration x -> UpdateServiceIntegration
forall x.
UpdateServiceIntegration -> Rep UpdateServiceIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceIntegration x -> UpdateServiceIntegration
$cfrom :: forall x.
UpdateServiceIntegration -> Rep UpdateServiceIntegration x
Prelude.Generic)
newUpdateServiceIntegration ::
UpdateServiceIntegrationConfig ->
UpdateServiceIntegration
newUpdateServiceIntegration :: UpdateServiceIntegrationConfig -> UpdateServiceIntegration
newUpdateServiceIntegration UpdateServiceIntegrationConfig
pServiceIntegration_ =
UpdateServiceIntegration' :: UpdateServiceIntegrationConfig -> UpdateServiceIntegration
UpdateServiceIntegration'
{ $sel:serviceIntegration:UpdateServiceIntegration' :: UpdateServiceIntegrationConfig
serviceIntegration =
UpdateServiceIntegrationConfig
pServiceIntegration_
}
updateServiceIntegration_serviceIntegration :: Lens.Lens' UpdateServiceIntegration UpdateServiceIntegrationConfig
updateServiceIntegration_serviceIntegration :: (UpdateServiceIntegrationConfig
-> f UpdateServiceIntegrationConfig)
-> UpdateServiceIntegration -> f UpdateServiceIntegration
updateServiceIntegration_serviceIntegration = (UpdateServiceIntegration -> UpdateServiceIntegrationConfig)
-> (UpdateServiceIntegration
-> UpdateServiceIntegrationConfig -> UpdateServiceIntegration)
-> Lens
UpdateServiceIntegration
UpdateServiceIntegration
UpdateServiceIntegrationConfig
UpdateServiceIntegrationConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceIntegration' {UpdateServiceIntegrationConfig
serviceIntegration :: UpdateServiceIntegrationConfig
$sel:serviceIntegration:UpdateServiceIntegration' :: UpdateServiceIntegration -> UpdateServiceIntegrationConfig
serviceIntegration} -> UpdateServiceIntegrationConfig
serviceIntegration) (\s :: UpdateServiceIntegration
s@UpdateServiceIntegration' {} UpdateServiceIntegrationConfig
a -> UpdateServiceIntegration
s {$sel:serviceIntegration:UpdateServiceIntegration' :: UpdateServiceIntegrationConfig
serviceIntegration = UpdateServiceIntegrationConfig
a} :: UpdateServiceIntegration)
instance Core.AWSRequest UpdateServiceIntegration where
type
AWSResponse UpdateServiceIntegration =
UpdateServiceIntegrationResponse
request :: UpdateServiceIntegration -> Request UpdateServiceIntegration
request = Service
-> UpdateServiceIntegration -> Request UpdateServiceIntegration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServiceIntegration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceIntegration)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateServiceIntegration))
-> Logger
-> Service
-> Proxy UpdateServiceIntegration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceIntegration)))
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 -> UpdateServiceIntegrationResponse
UpdateServiceIntegrationResponse'
(Int -> UpdateServiceIntegrationResponse)
-> Either String Int
-> Either String UpdateServiceIntegrationResponse
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 UpdateServiceIntegration
instance Prelude.NFData UpdateServiceIntegration
instance Core.ToHeaders UpdateServiceIntegration where
toHeaders :: UpdateServiceIntegration -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateServiceIntegration -> 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 UpdateServiceIntegration where
toJSON :: UpdateServiceIntegration -> Value
toJSON UpdateServiceIntegration' {UpdateServiceIntegrationConfig
serviceIntegration :: UpdateServiceIntegrationConfig
$sel:serviceIntegration:UpdateServiceIntegration' :: UpdateServiceIntegration -> UpdateServiceIntegrationConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ServiceIntegration" Text -> UpdateServiceIntegrationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UpdateServiceIntegrationConfig
serviceIntegration)
]
)
instance Core.ToPath UpdateServiceIntegration where
toPath :: UpdateServiceIntegration -> ByteString
toPath = ByteString -> UpdateServiceIntegration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/service-integrations"
instance Core.ToQuery UpdateServiceIntegration where
toQuery :: UpdateServiceIntegration -> QueryString
toQuery = QueryString -> UpdateServiceIntegration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateServiceIntegrationResponse = UpdateServiceIntegrationResponse'
{
UpdateServiceIntegrationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool
(UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool)
-> (UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool)
-> Eq UpdateServiceIntegrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool
$c/= :: UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool
== :: UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool
$c== :: UpdateServiceIntegrationResponse
-> UpdateServiceIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceIntegrationResponse]
ReadPrec UpdateServiceIntegrationResponse
Int -> ReadS UpdateServiceIntegrationResponse
ReadS [UpdateServiceIntegrationResponse]
(Int -> ReadS UpdateServiceIntegrationResponse)
-> ReadS [UpdateServiceIntegrationResponse]
-> ReadPrec UpdateServiceIntegrationResponse
-> ReadPrec [UpdateServiceIntegrationResponse]
-> Read UpdateServiceIntegrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceIntegrationResponse]
$creadListPrec :: ReadPrec [UpdateServiceIntegrationResponse]
readPrec :: ReadPrec UpdateServiceIntegrationResponse
$creadPrec :: ReadPrec UpdateServiceIntegrationResponse
readList :: ReadS [UpdateServiceIntegrationResponse]
$creadList :: ReadS [UpdateServiceIntegrationResponse]
readsPrec :: Int -> ReadS UpdateServiceIntegrationResponse
$creadsPrec :: Int -> ReadS UpdateServiceIntegrationResponse
Prelude.Read, Int -> UpdateServiceIntegrationResponse -> ShowS
[UpdateServiceIntegrationResponse] -> ShowS
UpdateServiceIntegrationResponse -> String
(Int -> UpdateServiceIntegrationResponse -> ShowS)
-> (UpdateServiceIntegrationResponse -> String)
-> ([UpdateServiceIntegrationResponse] -> ShowS)
-> Show UpdateServiceIntegrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceIntegrationResponse] -> ShowS
$cshowList :: [UpdateServiceIntegrationResponse] -> ShowS
show :: UpdateServiceIntegrationResponse -> String
$cshow :: UpdateServiceIntegrationResponse -> String
showsPrec :: Int -> UpdateServiceIntegrationResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceIntegrationResponse -> ShowS
Prelude.Show, (forall x.
UpdateServiceIntegrationResponse
-> Rep UpdateServiceIntegrationResponse x)
-> (forall x.
Rep UpdateServiceIntegrationResponse x
-> UpdateServiceIntegrationResponse)
-> Generic UpdateServiceIntegrationResponse
forall x.
Rep UpdateServiceIntegrationResponse x
-> UpdateServiceIntegrationResponse
forall x.
UpdateServiceIntegrationResponse
-> Rep UpdateServiceIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceIntegrationResponse x
-> UpdateServiceIntegrationResponse
$cfrom :: forall x.
UpdateServiceIntegrationResponse
-> Rep UpdateServiceIntegrationResponse x
Prelude.Generic)
newUpdateServiceIntegrationResponse ::
Prelude.Int ->
UpdateServiceIntegrationResponse
newUpdateServiceIntegrationResponse :: Int -> UpdateServiceIntegrationResponse
newUpdateServiceIntegrationResponse Int
pHttpStatus_ =
UpdateServiceIntegrationResponse' :: Int -> UpdateServiceIntegrationResponse
UpdateServiceIntegrationResponse'
{ $sel:httpStatus:UpdateServiceIntegrationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateServiceIntegrationResponse_httpStatus :: Lens.Lens' UpdateServiceIntegrationResponse Prelude.Int
updateServiceIntegrationResponse_httpStatus :: (Int -> f Int)
-> UpdateServiceIntegrationResponse
-> f UpdateServiceIntegrationResponse
updateServiceIntegrationResponse_httpStatus = (UpdateServiceIntegrationResponse -> Int)
-> (UpdateServiceIntegrationResponse
-> Int -> UpdateServiceIntegrationResponse)
-> Lens
UpdateServiceIntegrationResponse
UpdateServiceIntegrationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceIntegrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceIntegrationResponse' :: UpdateServiceIntegrationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceIntegrationResponse
s@UpdateServiceIntegrationResponse' {} Int
a -> UpdateServiceIntegrationResponse
s {$sel:httpStatus:UpdateServiceIntegrationResponse' :: Int
httpStatus = Int
a} :: UpdateServiceIntegrationResponse)
instance
Prelude.NFData
UpdateServiceIntegrationResponse