{-# 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.Connect.StopContact
(
StopContact (..),
newStopContact,
stopContact_contactId,
stopContact_instanceId,
StopContactResponse (..),
newStopContactResponse,
stopContactResponse_httpStatus,
)
where
import Amazonka.Connect.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 StopContact = StopContact'
{
StopContact -> Text
contactId :: Prelude.Text,
StopContact -> Text
instanceId :: Prelude.Text
}
deriving (StopContact -> StopContact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopContact -> StopContact -> Bool
$c/= :: StopContact -> StopContact -> Bool
== :: StopContact -> StopContact -> Bool
$c== :: StopContact -> StopContact -> Bool
Prelude.Eq, ReadPrec [StopContact]
ReadPrec StopContact
Int -> ReadS StopContact
ReadS [StopContact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopContact]
$creadListPrec :: ReadPrec [StopContact]
readPrec :: ReadPrec StopContact
$creadPrec :: ReadPrec StopContact
readList :: ReadS [StopContact]
$creadList :: ReadS [StopContact]
readsPrec :: Int -> ReadS StopContact
$creadsPrec :: Int -> ReadS StopContact
Prelude.Read, Int -> StopContact -> ShowS
[StopContact] -> ShowS
StopContact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopContact] -> ShowS
$cshowList :: [StopContact] -> ShowS
show :: StopContact -> String
$cshow :: StopContact -> String
showsPrec :: Int -> StopContact -> ShowS
$cshowsPrec :: Int -> StopContact -> ShowS
Prelude.Show, forall x. Rep StopContact x -> StopContact
forall x. StopContact -> Rep StopContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopContact x -> StopContact
$cfrom :: forall x. StopContact -> Rep StopContact x
Prelude.Generic)
newStopContact ::
Prelude.Text ->
Prelude.Text ->
StopContact
newStopContact :: Text -> Text -> StopContact
newStopContact Text
pContactId_ Text
pInstanceId_ =
StopContact'
{ $sel:contactId:StopContact' :: Text
contactId = Text
pContactId_,
$sel:instanceId:StopContact' :: Text
instanceId = Text
pInstanceId_
}
stopContact_contactId :: Lens.Lens' StopContact Prelude.Text
stopContact_contactId :: Lens' StopContact Text
stopContact_contactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContact' {Text
contactId :: Text
$sel:contactId:StopContact' :: StopContact -> Text
contactId} -> Text
contactId) (\s :: StopContact
s@StopContact' {} Text
a -> StopContact
s {$sel:contactId:StopContact' :: Text
contactId = Text
a} :: StopContact)
stopContact_instanceId :: Lens.Lens' StopContact Prelude.Text
stopContact_instanceId :: Lens' StopContact Text
stopContact_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContact' {Text
instanceId :: Text
$sel:instanceId:StopContact' :: StopContact -> Text
instanceId} -> Text
instanceId) (\s :: StopContact
s@StopContact' {} Text
a -> StopContact
s {$sel:instanceId:StopContact' :: Text
instanceId = Text
a} :: StopContact)
instance Core.AWSRequest StopContact where
type AWSResponse StopContact = StopContactResponse
request :: (Service -> Service) -> StopContact -> Request StopContact
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopContact)))
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 -> StopContactResponse
StopContactResponse'
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 StopContact where
hashWithSalt :: Int -> StopContact -> Int
hashWithSalt Int
_salt StopContact' {Text
instanceId :: Text
contactId :: Text
$sel:instanceId:StopContact' :: StopContact -> Text
$sel:contactId:StopContact' :: StopContact -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
instance Prelude.NFData StopContact where
rnf :: StopContact -> ()
rnf StopContact' {Text
instanceId :: Text
contactId :: Text
$sel:instanceId:StopContact' :: StopContact -> Text
$sel:contactId:StopContact' :: StopContact -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
contactId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
instance Data.ToHeaders StopContact where
toHeaders :: StopContact -> 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 StopContact where
toJSON :: StopContact -> Value
toJSON StopContact' {Text
instanceId :: Text
contactId :: Text
$sel:instanceId:StopContact' :: StopContact -> Text
$sel:contactId:StopContact' :: StopContact -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ContactId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactId),
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceId)
]
)
instance Data.ToPath StopContact where
toPath :: StopContact -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/contact/stop"
instance Data.ToQuery StopContact where
toQuery :: StopContact -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopContactResponse = StopContactResponse'
{
StopContactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopContactResponse -> StopContactResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopContactResponse -> StopContactResponse -> Bool
$c/= :: StopContactResponse -> StopContactResponse -> Bool
== :: StopContactResponse -> StopContactResponse -> Bool
$c== :: StopContactResponse -> StopContactResponse -> Bool
Prelude.Eq, ReadPrec [StopContactResponse]
ReadPrec StopContactResponse
Int -> ReadS StopContactResponse
ReadS [StopContactResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopContactResponse]
$creadListPrec :: ReadPrec [StopContactResponse]
readPrec :: ReadPrec StopContactResponse
$creadPrec :: ReadPrec StopContactResponse
readList :: ReadS [StopContactResponse]
$creadList :: ReadS [StopContactResponse]
readsPrec :: Int -> ReadS StopContactResponse
$creadsPrec :: Int -> ReadS StopContactResponse
Prelude.Read, Int -> StopContactResponse -> ShowS
[StopContactResponse] -> ShowS
StopContactResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopContactResponse] -> ShowS
$cshowList :: [StopContactResponse] -> ShowS
show :: StopContactResponse -> String
$cshow :: StopContactResponse -> String
showsPrec :: Int -> StopContactResponse -> ShowS
$cshowsPrec :: Int -> StopContactResponse -> ShowS
Prelude.Show, forall x. Rep StopContactResponse x -> StopContactResponse
forall x. StopContactResponse -> Rep StopContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopContactResponse x -> StopContactResponse
$cfrom :: forall x. StopContactResponse -> Rep StopContactResponse x
Prelude.Generic)
newStopContactResponse ::
Prelude.Int ->
StopContactResponse
newStopContactResponse :: Int -> StopContactResponse
newStopContactResponse Int
pHttpStatus_ =
StopContactResponse' {$sel:httpStatus:StopContactResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopContactResponse_httpStatus :: Lens.Lens' StopContactResponse Prelude.Int
stopContactResponse_httpStatus :: Lens' StopContactResponse Int
stopContactResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopContactResponse' :: StopContactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopContactResponse
s@StopContactResponse' {} Int
a -> StopContactResponse
s {$sel:httpStatus:StopContactResponse' :: Int
httpStatus = Int
a} :: StopContactResponse)
instance Prelude.NFData StopContactResponse where
rnf :: StopContactResponse -> ()
rnf StopContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopContactResponse' :: StopContactResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus