{-# 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.SSMContacts.DeleteContactChannel
(
DeleteContactChannel (..),
newDeleteContactChannel,
deleteContactChannel_contactChannelId,
DeleteContactChannelResponse (..),
newDeleteContactChannelResponse,
deleteContactChannelResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSMContacts.Types
data DeleteContactChannel = DeleteContactChannel'
{
DeleteContactChannel -> Text
contactChannelId :: Prelude.Text
}
deriving (DeleteContactChannel -> DeleteContactChannel -> Bool
(DeleteContactChannel -> DeleteContactChannel -> Bool)
-> (DeleteContactChannel -> DeleteContactChannel -> Bool)
-> Eq DeleteContactChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContactChannel -> DeleteContactChannel -> Bool
$c/= :: DeleteContactChannel -> DeleteContactChannel -> Bool
== :: DeleteContactChannel -> DeleteContactChannel -> Bool
$c== :: DeleteContactChannel -> DeleteContactChannel -> Bool
Prelude.Eq, ReadPrec [DeleteContactChannel]
ReadPrec DeleteContactChannel
Int -> ReadS DeleteContactChannel
ReadS [DeleteContactChannel]
(Int -> ReadS DeleteContactChannel)
-> ReadS [DeleteContactChannel]
-> ReadPrec DeleteContactChannel
-> ReadPrec [DeleteContactChannel]
-> Read DeleteContactChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContactChannel]
$creadListPrec :: ReadPrec [DeleteContactChannel]
readPrec :: ReadPrec DeleteContactChannel
$creadPrec :: ReadPrec DeleteContactChannel
readList :: ReadS [DeleteContactChannel]
$creadList :: ReadS [DeleteContactChannel]
readsPrec :: Int -> ReadS DeleteContactChannel
$creadsPrec :: Int -> ReadS DeleteContactChannel
Prelude.Read, Int -> DeleteContactChannel -> ShowS
[DeleteContactChannel] -> ShowS
DeleteContactChannel -> String
(Int -> DeleteContactChannel -> ShowS)
-> (DeleteContactChannel -> String)
-> ([DeleteContactChannel] -> ShowS)
-> Show DeleteContactChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContactChannel] -> ShowS
$cshowList :: [DeleteContactChannel] -> ShowS
show :: DeleteContactChannel -> String
$cshow :: DeleteContactChannel -> String
showsPrec :: Int -> DeleteContactChannel -> ShowS
$cshowsPrec :: Int -> DeleteContactChannel -> ShowS
Prelude.Show, (forall x. DeleteContactChannel -> Rep DeleteContactChannel x)
-> (forall x. Rep DeleteContactChannel x -> DeleteContactChannel)
-> Generic DeleteContactChannel
forall x. Rep DeleteContactChannel x -> DeleteContactChannel
forall x. DeleteContactChannel -> Rep DeleteContactChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContactChannel x -> DeleteContactChannel
$cfrom :: forall x. DeleteContactChannel -> Rep DeleteContactChannel x
Prelude.Generic)
newDeleteContactChannel ::
Prelude.Text ->
DeleteContactChannel
newDeleteContactChannel :: Text -> DeleteContactChannel
newDeleteContactChannel Text
pContactChannelId_ =
DeleteContactChannel' :: Text -> DeleteContactChannel
DeleteContactChannel'
{ $sel:contactChannelId:DeleteContactChannel' :: Text
contactChannelId =
Text
pContactChannelId_
}
deleteContactChannel_contactChannelId :: Lens.Lens' DeleteContactChannel Prelude.Text
deleteContactChannel_contactChannelId :: (Text -> f Text) -> DeleteContactChannel -> f DeleteContactChannel
deleteContactChannel_contactChannelId = (DeleteContactChannel -> Text)
-> (DeleteContactChannel -> Text -> DeleteContactChannel)
-> Lens DeleteContactChannel DeleteContactChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactChannel' {Text
contactChannelId :: Text
$sel:contactChannelId:DeleteContactChannel' :: DeleteContactChannel -> Text
contactChannelId} -> Text
contactChannelId) (\s :: DeleteContactChannel
s@DeleteContactChannel' {} Text
a -> DeleteContactChannel
s {$sel:contactChannelId:DeleteContactChannel' :: Text
contactChannelId = Text
a} :: DeleteContactChannel)
instance Core.AWSRequest DeleteContactChannel where
type
AWSResponse DeleteContactChannel =
DeleteContactChannelResponse
request :: DeleteContactChannel -> Request DeleteContactChannel
request = Service -> DeleteContactChannel -> Request DeleteContactChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteContactChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteContactChannel)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteContactChannel))
-> Logger
-> Service
-> Proxy DeleteContactChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteContactChannel)))
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 -> DeleteContactChannelResponse
DeleteContactChannelResponse'
(Int -> DeleteContactChannelResponse)
-> Either String Int -> Either String DeleteContactChannelResponse
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 DeleteContactChannel
instance Prelude.NFData DeleteContactChannel
instance Core.ToHeaders DeleteContactChannel where
toHeaders :: DeleteContactChannel -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteContactChannel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SSMContacts.DeleteContactChannel" ::
Prelude.ByteString
),
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 DeleteContactChannel where
toJSON :: DeleteContactChannel -> Value
toJSON DeleteContactChannel' {Text
contactChannelId :: Text
$sel:contactChannelId:DeleteContactChannel' :: DeleteContactChannel -> Text
..} =
[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
"ContactChannelId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactChannelId)
]
)
instance Core.ToPath DeleteContactChannel where
toPath :: DeleteContactChannel -> ByteString
toPath = ByteString -> DeleteContactChannel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteContactChannel where
toQuery :: DeleteContactChannel -> QueryString
toQuery = QueryString -> DeleteContactChannel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteContactChannelResponse = DeleteContactChannelResponse'
{
DeleteContactChannelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool
(DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool)
-> (DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool)
-> Eq DeleteContactChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool
$c/= :: DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool
== :: DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool
$c== :: DeleteContactChannelResponse
-> DeleteContactChannelResponse -> Bool
Prelude.Eq, ReadPrec [DeleteContactChannelResponse]
ReadPrec DeleteContactChannelResponse
Int -> ReadS DeleteContactChannelResponse
ReadS [DeleteContactChannelResponse]
(Int -> ReadS DeleteContactChannelResponse)
-> ReadS [DeleteContactChannelResponse]
-> ReadPrec DeleteContactChannelResponse
-> ReadPrec [DeleteContactChannelResponse]
-> Read DeleteContactChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContactChannelResponse]
$creadListPrec :: ReadPrec [DeleteContactChannelResponse]
readPrec :: ReadPrec DeleteContactChannelResponse
$creadPrec :: ReadPrec DeleteContactChannelResponse
readList :: ReadS [DeleteContactChannelResponse]
$creadList :: ReadS [DeleteContactChannelResponse]
readsPrec :: Int -> ReadS DeleteContactChannelResponse
$creadsPrec :: Int -> ReadS DeleteContactChannelResponse
Prelude.Read, Int -> DeleteContactChannelResponse -> ShowS
[DeleteContactChannelResponse] -> ShowS
DeleteContactChannelResponse -> String
(Int -> DeleteContactChannelResponse -> ShowS)
-> (DeleteContactChannelResponse -> String)
-> ([DeleteContactChannelResponse] -> ShowS)
-> Show DeleteContactChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContactChannelResponse] -> ShowS
$cshowList :: [DeleteContactChannelResponse] -> ShowS
show :: DeleteContactChannelResponse -> String
$cshow :: DeleteContactChannelResponse -> String
showsPrec :: Int -> DeleteContactChannelResponse -> ShowS
$cshowsPrec :: Int -> DeleteContactChannelResponse -> ShowS
Prelude.Show, (forall x.
DeleteContactChannelResponse -> Rep DeleteContactChannelResponse x)
-> (forall x.
Rep DeleteContactChannelResponse x -> DeleteContactChannelResponse)
-> Generic DeleteContactChannelResponse
forall x.
Rep DeleteContactChannelResponse x -> DeleteContactChannelResponse
forall x.
DeleteContactChannelResponse -> Rep DeleteContactChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteContactChannelResponse x -> DeleteContactChannelResponse
$cfrom :: forall x.
DeleteContactChannelResponse -> Rep DeleteContactChannelResponse x
Prelude.Generic)
newDeleteContactChannelResponse ::
Prelude.Int ->
DeleteContactChannelResponse
newDeleteContactChannelResponse :: Int -> DeleteContactChannelResponse
newDeleteContactChannelResponse Int
pHttpStatus_ =
DeleteContactChannelResponse' :: Int -> DeleteContactChannelResponse
DeleteContactChannelResponse'
{ $sel:httpStatus:DeleteContactChannelResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteContactChannelResponse_httpStatus :: Lens.Lens' DeleteContactChannelResponse Prelude.Int
deleteContactChannelResponse_httpStatus :: (Int -> f Int)
-> DeleteContactChannelResponse -> f DeleteContactChannelResponse
deleteContactChannelResponse_httpStatus = (DeleteContactChannelResponse -> Int)
-> (DeleteContactChannelResponse
-> Int -> DeleteContactChannelResponse)
-> Lens
DeleteContactChannelResponse DeleteContactChannelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteContactChannelResponse' :: DeleteContactChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteContactChannelResponse
s@DeleteContactChannelResponse' {} Int
a -> DeleteContactChannelResponse
s {$sel:httpStatus:DeleteContactChannelResponse' :: Int
httpStatus = Int
a} :: DeleteContactChannelResponse)
instance Prelude.NFData DeleteContactChannelResponse