{-# 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.DeleteContact
(
DeleteContact (..),
newDeleteContact,
deleteContact_contactId,
DeleteContactResponse (..),
newDeleteContactResponse,
deleteContactResponse_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 DeleteContact = DeleteContact'
{
DeleteContact -> Text
contactId :: Prelude.Text
}
deriving (DeleteContact -> DeleteContact -> Bool
(DeleteContact -> DeleteContact -> Bool)
-> (DeleteContact -> DeleteContact -> Bool) -> Eq DeleteContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContact -> DeleteContact -> Bool
$c/= :: DeleteContact -> DeleteContact -> Bool
== :: DeleteContact -> DeleteContact -> Bool
$c== :: DeleteContact -> DeleteContact -> Bool
Prelude.Eq, ReadPrec [DeleteContact]
ReadPrec DeleteContact
Int -> ReadS DeleteContact
ReadS [DeleteContact]
(Int -> ReadS DeleteContact)
-> ReadS [DeleteContact]
-> ReadPrec DeleteContact
-> ReadPrec [DeleteContact]
-> Read DeleteContact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContact]
$creadListPrec :: ReadPrec [DeleteContact]
readPrec :: ReadPrec DeleteContact
$creadPrec :: ReadPrec DeleteContact
readList :: ReadS [DeleteContact]
$creadList :: ReadS [DeleteContact]
readsPrec :: Int -> ReadS DeleteContact
$creadsPrec :: Int -> ReadS DeleteContact
Prelude.Read, Int -> DeleteContact -> ShowS
[DeleteContact] -> ShowS
DeleteContact -> String
(Int -> DeleteContact -> ShowS)
-> (DeleteContact -> String)
-> ([DeleteContact] -> ShowS)
-> Show DeleteContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContact] -> ShowS
$cshowList :: [DeleteContact] -> ShowS
show :: DeleteContact -> String
$cshow :: DeleteContact -> String
showsPrec :: Int -> DeleteContact -> ShowS
$cshowsPrec :: Int -> DeleteContact -> ShowS
Prelude.Show, (forall x. DeleteContact -> Rep DeleteContact x)
-> (forall x. Rep DeleteContact x -> DeleteContact)
-> Generic DeleteContact
forall x. Rep DeleteContact x -> DeleteContact
forall x. DeleteContact -> Rep DeleteContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContact x -> DeleteContact
$cfrom :: forall x. DeleteContact -> Rep DeleteContact x
Prelude.Generic)
newDeleteContact ::
Prelude.Text ->
DeleteContact
newDeleteContact :: Text -> DeleteContact
newDeleteContact Text
pContactId_ =
DeleteContact' :: Text -> DeleteContact
DeleteContact' {$sel:contactId:DeleteContact' :: Text
contactId = Text
pContactId_}
deleteContact_contactId :: Lens.Lens' DeleteContact Prelude.Text
deleteContact_contactId :: (Text -> f Text) -> DeleteContact -> f DeleteContact
deleteContact_contactId = (DeleteContact -> Text)
-> (DeleteContact -> Text -> DeleteContact)
-> Lens DeleteContact DeleteContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContact' {Text
contactId :: Text
$sel:contactId:DeleteContact' :: DeleteContact -> Text
contactId} -> Text
contactId) (\s :: DeleteContact
s@DeleteContact' {} Text
a -> DeleteContact
s {$sel:contactId:DeleteContact' :: Text
contactId = Text
a} :: DeleteContact)
instance Core.AWSRequest DeleteContact where
type
AWSResponse DeleteContact =
DeleteContactResponse
request :: DeleteContact -> Request DeleteContact
request = Service -> DeleteContact -> Request DeleteContact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteContact)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteContact))
-> Logger
-> Service
-> Proxy DeleteContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteContact)))
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 -> DeleteContactResponse
DeleteContactResponse'
(Int -> DeleteContactResponse)
-> Either String Int -> Either String DeleteContactResponse
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 DeleteContact
instance Prelude.NFData DeleteContact
instance Core.ToHeaders DeleteContact where
toHeaders :: DeleteContact -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteContact -> 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.DeleteContact" :: 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 DeleteContact where
toJSON :: DeleteContact -> Value
toJSON DeleteContact' {Text
contactId :: Text
$sel:contactId:DeleteContact' :: DeleteContact -> 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
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId)]
)
instance Core.ToPath DeleteContact where
toPath :: DeleteContact -> ByteString
toPath = ByteString -> DeleteContact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteContact where
toQuery :: DeleteContact -> QueryString
toQuery = QueryString -> DeleteContact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteContactResponse = DeleteContactResponse'
{
DeleteContactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteContactResponse -> DeleteContactResponse -> Bool
(DeleteContactResponse -> DeleteContactResponse -> Bool)
-> (DeleteContactResponse -> DeleteContactResponse -> Bool)
-> Eq DeleteContactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContactResponse -> DeleteContactResponse -> Bool
$c/= :: DeleteContactResponse -> DeleteContactResponse -> Bool
== :: DeleteContactResponse -> DeleteContactResponse -> Bool
$c== :: DeleteContactResponse -> DeleteContactResponse -> Bool
Prelude.Eq, ReadPrec [DeleteContactResponse]
ReadPrec DeleteContactResponse
Int -> ReadS DeleteContactResponse
ReadS [DeleteContactResponse]
(Int -> ReadS DeleteContactResponse)
-> ReadS [DeleteContactResponse]
-> ReadPrec DeleteContactResponse
-> ReadPrec [DeleteContactResponse]
-> Read DeleteContactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContactResponse]
$creadListPrec :: ReadPrec [DeleteContactResponse]
readPrec :: ReadPrec DeleteContactResponse
$creadPrec :: ReadPrec DeleteContactResponse
readList :: ReadS [DeleteContactResponse]
$creadList :: ReadS [DeleteContactResponse]
readsPrec :: Int -> ReadS DeleteContactResponse
$creadsPrec :: Int -> ReadS DeleteContactResponse
Prelude.Read, Int -> DeleteContactResponse -> ShowS
[DeleteContactResponse] -> ShowS
DeleteContactResponse -> String
(Int -> DeleteContactResponse -> ShowS)
-> (DeleteContactResponse -> String)
-> ([DeleteContactResponse] -> ShowS)
-> Show DeleteContactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContactResponse] -> ShowS
$cshowList :: [DeleteContactResponse] -> ShowS
show :: DeleteContactResponse -> String
$cshow :: DeleteContactResponse -> String
showsPrec :: Int -> DeleteContactResponse -> ShowS
$cshowsPrec :: Int -> DeleteContactResponse -> ShowS
Prelude.Show, (forall x. DeleteContactResponse -> Rep DeleteContactResponse x)
-> (forall x. Rep DeleteContactResponse x -> DeleteContactResponse)
-> Generic DeleteContactResponse
forall x. Rep DeleteContactResponse x -> DeleteContactResponse
forall x. DeleteContactResponse -> Rep DeleteContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContactResponse x -> DeleteContactResponse
$cfrom :: forall x. DeleteContactResponse -> Rep DeleteContactResponse x
Prelude.Generic)
newDeleteContactResponse ::
Prelude.Int ->
DeleteContactResponse
newDeleteContactResponse :: Int -> DeleteContactResponse
newDeleteContactResponse Int
pHttpStatus_ =
DeleteContactResponse' :: Int -> DeleteContactResponse
DeleteContactResponse' {$sel:httpStatus:DeleteContactResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteContactResponse_httpStatus :: Lens.Lens' DeleteContactResponse Prelude.Int
deleteContactResponse_httpStatus :: (Int -> f Int) -> DeleteContactResponse -> f DeleteContactResponse
deleteContactResponse_httpStatus = (DeleteContactResponse -> Int)
-> (DeleteContactResponse -> Int -> DeleteContactResponse)
-> Lens DeleteContactResponse DeleteContactResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteContactResponse' :: DeleteContactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteContactResponse
s@DeleteContactResponse' {} Int
a -> DeleteContactResponse
s {$sel:httpStatus:DeleteContactResponse' :: Int
httpStatus = Int
a} :: DeleteContactResponse)
instance Prelude.NFData DeleteContactResponse