{-# 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.Chime.DisassociatePhoneNumberFromUser
(
DisassociatePhoneNumberFromUser (..),
newDisassociatePhoneNumberFromUser,
disassociatePhoneNumberFromUser_accountId,
disassociatePhoneNumberFromUser_userId,
DisassociatePhoneNumberFromUserResponse (..),
newDisassociatePhoneNumberFromUserResponse,
disassociatePhoneNumberFromUserResponse_httpStatus,
)
where
import Amazonka.Chime.Types
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
data DisassociatePhoneNumberFromUser = DisassociatePhoneNumberFromUser'
{
DisassociatePhoneNumberFromUser -> Text
accountId :: Prelude.Text,
DisassociatePhoneNumberFromUser -> Text
userId :: Prelude.Text
}
deriving (DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool
(DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool)
-> (DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool)
-> Eq DisassociatePhoneNumberFromUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool
$c/= :: DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool
== :: DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool
$c== :: DisassociatePhoneNumberFromUser
-> DisassociatePhoneNumberFromUser -> Bool
Prelude.Eq, ReadPrec [DisassociatePhoneNumberFromUser]
ReadPrec DisassociatePhoneNumberFromUser
Int -> ReadS DisassociatePhoneNumberFromUser
ReadS [DisassociatePhoneNumberFromUser]
(Int -> ReadS DisassociatePhoneNumberFromUser)
-> ReadS [DisassociatePhoneNumberFromUser]
-> ReadPrec DisassociatePhoneNumberFromUser
-> ReadPrec [DisassociatePhoneNumberFromUser]
-> Read DisassociatePhoneNumberFromUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociatePhoneNumberFromUser]
$creadListPrec :: ReadPrec [DisassociatePhoneNumberFromUser]
readPrec :: ReadPrec DisassociatePhoneNumberFromUser
$creadPrec :: ReadPrec DisassociatePhoneNumberFromUser
readList :: ReadS [DisassociatePhoneNumberFromUser]
$creadList :: ReadS [DisassociatePhoneNumberFromUser]
readsPrec :: Int -> ReadS DisassociatePhoneNumberFromUser
$creadsPrec :: Int -> ReadS DisassociatePhoneNumberFromUser
Prelude.Read, Int -> DisassociatePhoneNumberFromUser -> ShowS
[DisassociatePhoneNumberFromUser] -> ShowS
DisassociatePhoneNumberFromUser -> String
(Int -> DisassociatePhoneNumberFromUser -> ShowS)
-> (DisassociatePhoneNumberFromUser -> String)
-> ([DisassociatePhoneNumberFromUser] -> ShowS)
-> Show DisassociatePhoneNumberFromUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociatePhoneNumberFromUser] -> ShowS
$cshowList :: [DisassociatePhoneNumberFromUser] -> ShowS
show :: DisassociatePhoneNumberFromUser -> String
$cshow :: DisassociatePhoneNumberFromUser -> String
showsPrec :: Int -> DisassociatePhoneNumberFromUser -> ShowS
$cshowsPrec :: Int -> DisassociatePhoneNumberFromUser -> ShowS
Prelude.Show, (forall x.
DisassociatePhoneNumberFromUser
-> Rep DisassociatePhoneNumberFromUser x)
-> (forall x.
Rep DisassociatePhoneNumberFromUser x
-> DisassociatePhoneNumberFromUser)
-> Generic DisassociatePhoneNumberFromUser
forall x.
Rep DisassociatePhoneNumberFromUser x
-> DisassociatePhoneNumberFromUser
forall x.
DisassociatePhoneNumberFromUser
-> Rep DisassociatePhoneNumberFromUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociatePhoneNumberFromUser x
-> DisassociatePhoneNumberFromUser
$cfrom :: forall x.
DisassociatePhoneNumberFromUser
-> Rep DisassociatePhoneNumberFromUser x
Prelude.Generic)
newDisassociatePhoneNumberFromUser ::
Prelude.Text ->
Prelude.Text ->
DisassociatePhoneNumberFromUser
newDisassociatePhoneNumberFromUser :: Text -> Text -> DisassociatePhoneNumberFromUser
newDisassociatePhoneNumberFromUser
Text
pAccountId_
Text
pUserId_ =
DisassociatePhoneNumberFromUser' :: Text -> Text -> DisassociatePhoneNumberFromUser
DisassociatePhoneNumberFromUser'
{ $sel:accountId:DisassociatePhoneNumberFromUser' :: Text
accountId =
Text
pAccountId_,
$sel:userId:DisassociatePhoneNumberFromUser' :: Text
userId = Text
pUserId_
}
disassociatePhoneNumberFromUser_accountId :: Lens.Lens' DisassociatePhoneNumberFromUser Prelude.Text
disassociatePhoneNumberFromUser_accountId :: (Text -> f Text)
-> DisassociatePhoneNumberFromUser
-> f DisassociatePhoneNumberFromUser
disassociatePhoneNumberFromUser_accountId = (DisassociatePhoneNumberFromUser -> Text)
-> (DisassociatePhoneNumberFromUser
-> Text -> DisassociatePhoneNumberFromUser)
-> Lens
DisassociatePhoneNumberFromUser
DisassociatePhoneNumberFromUser
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociatePhoneNumberFromUser' {Text
accountId :: Text
$sel:accountId:DisassociatePhoneNumberFromUser' :: DisassociatePhoneNumberFromUser -> Text
accountId} -> Text
accountId) (\s :: DisassociatePhoneNumberFromUser
s@DisassociatePhoneNumberFromUser' {} Text
a -> DisassociatePhoneNumberFromUser
s {$sel:accountId:DisassociatePhoneNumberFromUser' :: Text
accountId = Text
a} :: DisassociatePhoneNumberFromUser)
disassociatePhoneNumberFromUser_userId :: Lens.Lens' DisassociatePhoneNumberFromUser Prelude.Text
disassociatePhoneNumberFromUser_userId :: (Text -> f Text)
-> DisassociatePhoneNumberFromUser
-> f DisassociatePhoneNumberFromUser
disassociatePhoneNumberFromUser_userId = (DisassociatePhoneNumberFromUser -> Text)
-> (DisassociatePhoneNumberFromUser
-> Text -> DisassociatePhoneNumberFromUser)
-> Lens
DisassociatePhoneNumberFromUser
DisassociatePhoneNumberFromUser
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociatePhoneNumberFromUser' {Text
userId :: Text
$sel:userId:DisassociatePhoneNumberFromUser' :: DisassociatePhoneNumberFromUser -> Text
userId} -> Text
userId) (\s :: DisassociatePhoneNumberFromUser
s@DisassociatePhoneNumberFromUser' {} Text
a -> DisassociatePhoneNumberFromUser
s {$sel:userId:DisassociatePhoneNumberFromUser' :: Text
userId = Text
a} :: DisassociatePhoneNumberFromUser)
instance
Core.AWSRequest
DisassociatePhoneNumberFromUser
where
type
AWSResponse DisassociatePhoneNumberFromUser =
DisassociatePhoneNumberFromUserResponse
request :: DisassociatePhoneNumberFromUser
-> Request DisassociatePhoneNumberFromUser
request = Service
-> DisassociatePhoneNumberFromUser
-> Request DisassociatePhoneNumberFromUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociatePhoneNumberFromUser
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociatePhoneNumberFromUser)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisassociatePhoneNumberFromUser))
-> Logger
-> Service
-> Proxy DisassociatePhoneNumberFromUser
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociatePhoneNumberFromUser)))
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 -> DisassociatePhoneNumberFromUserResponse
DisassociatePhoneNumberFromUserResponse'
(Int -> DisassociatePhoneNumberFromUserResponse)
-> Either String Int
-> Either String DisassociatePhoneNumberFromUserResponse
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
DisassociatePhoneNumberFromUser
instance
Prelude.NFData
DisassociatePhoneNumberFromUser
instance
Core.ToHeaders
DisassociatePhoneNumberFromUser
where
toHeaders :: DisassociatePhoneNumberFromUser -> ResponseHeaders
toHeaders = ResponseHeaders
-> DisassociatePhoneNumberFromUser -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON DisassociatePhoneNumberFromUser where
toJSON :: DisassociatePhoneNumberFromUser -> Value
toJSON = Value -> DisassociatePhoneNumberFromUser -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DisassociatePhoneNumberFromUser where
toPath :: DisassociatePhoneNumberFromUser -> ByteString
toPath DisassociatePhoneNumberFromUser' {Text
userId :: Text
accountId :: Text
$sel:userId:DisassociatePhoneNumberFromUser' :: DisassociatePhoneNumberFromUser -> Text
$sel:accountId:DisassociatePhoneNumberFromUser' :: DisassociatePhoneNumberFromUser -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
ByteString
"/users/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userId
]
instance Core.ToQuery DisassociatePhoneNumberFromUser where
toQuery :: DisassociatePhoneNumberFromUser -> QueryString
toQuery =
QueryString -> DisassociatePhoneNumberFromUser -> QueryString
forall a b. a -> b -> a
Prelude.const
( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[QueryString
"operation=disassociate-phone-number"]
)
data DisassociatePhoneNumberFromUserResponse = DisassociatePhoneNumberFromUserResponse'
{
DisassociatePhoneNumberFromUserResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool
(DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool)
-> (DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool)
-> Eq DisassociatePhoneNumberFromUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool
$c/= :: DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool
== :: DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool
$c== :: DisassociatePhoneNumberFromUserResponse
-> DisassociatePhoneNumberFromUserResponse -> Bool
Prelude.Eq, ReadPrec [DisassociatePhoneNumberFromUserResponse]
ReadPrec DisassociatePhoneNumberFromUserResponse
Int -> ReadS DisassociatePhoneNumberFromUserResponse
ReadS [DisassociatePhoneNumberFromUserResponse]
(Int -> ReadS DisassociatePhoneNumberFromUserResponse)
-> ReadS [DisassociatePhoneNumberFromUserResponse]
-> ReadPrec DisassociatePhoneNumberFromUserResponse
-> ReadPrec [DisassociatePhoneNumberFromUserResponse]
-> Read DisassociatePhoneNumberFromUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociatePhoneNumberFromUserResponse]
$creadListPrec :: ReadPrec [DisassociatePhoneNumberFromUserResponse]
readPrec :: ReadPrec DisassociatePhoneNumberFromUserResponse
$creadPrec :: ReadPrec DisassociatePhoneNumberFromUserResponse
readList :: ReadS [DisassociatePhoneNumberFromUserResponse]
$creadList :: ReadS [DisassociatePhoneNumberFromUserResponse]
readsPrec :: Int -> ReadS DisassociatePhoneNumberFromUserResponse
$creadsPrec :: Int -> ReadS DisassociatePhoneNumberFromUserResponse
Prelude.Read, Int -> DisassociatePhoneNumberFromUserResponse -> ShowS
[DisassociatePhoneNumberFromUserResponse] -> ShowS
DisassociatePhoneNumberFromUserResponse -> String
(Int -> DisassociatePhoneNumberFromUserResponse -> ShowS)
-> (DisassociatePhoneNumberFromUserResponse -> String)
-> ([DisassociatePhoneNumberFromUserResponse] -> ShowS)
-> Show DisassociatePhoneNumberFromUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociatePhoneNumberFromUserResponse] -> ShowS
$cshowList :: [DisassociatePhoneNumberFromUserResponse] -> ShowS
show :: DisassociatePhoneNumberFromUserResponse -> String
$cshow :: DisassociatePhoneNumberFromUserResponse -> String
showsPrec :: Int -> DisassociatePhoneNumberFromUserResponse -> ShowS
$cshowsPrec :: Int -> DisassociatePhoneNumberFromUserResponse -> ShowS
Prelude.Show, (forall x.
DisassociatePhoneNumberFromUserResponse
-> Rep DisassociatePhoneNumberFromUserResponse x)
-> (forall x.
Rep DisassociatePhoneNumberFromUserResponse x
-> DisassociatePhoneNumberFromUserResponse)
-> Generic DisassociatePhoneNumberFromUserResponse
forall x.
Rep DisassociatePhoneNumberFromUserResponse x
-> DisassociatePhoneNumberFromUserResponse
forall x.
DisassociatePhoneNumberFromUserResponse
-> Rep DisassociatePhoneNumberFromUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociatePhoneNumberFromUserResponse x
-> DisassociatePhoneNumberFromUserResponse
$cfrom :: forall x.
DisassociatePhoneNumberFromUserResponse
-> Rep DisassociatePhoneNumberFromUserResponse x
Prelude.Generic)
newDisassociatePhoneNumberFromUserResponse ::
Prelude.Int ->
DisassociatePhoneNumberFromUserResponse
newDisassociatePhoneNumberFromUserResponse :: Int -> DisassociatePhoneNumberFromUserResponse
newDisassociatePhoneNumberFromUserResponse
Int
pHttpStatus_ =
DisassociatePhoneNumberFromUserResponse' :: Int -> DisassociatePhoneNumberFromUserResponse
DisassociatePhoneNumberFromUserResponse'
{ $sel:httpStatus:DisassociatePhoneNumberFromUserResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociatePhoneNumberFromUserResponse_httpStatus :: Lens.Lens' DisassociatePhoneNumberFromUserResponse Prelude.Int
disassociatePhoneNumberFromUserResponse_httpStatus :: (Int -> f Int)
-> DisassociatePhoneNumberFromUserResponse
-> f DisassociatePhoneNumberFromUserResponse
disassociatePhoneNumberFromUserResponse_httpStatus = (DisassociatePhoneNumberFromUserResponse -> Int)
-> (DisassociatePhoneNumberFromUserResponse
-> Int -> DisassociatePhoneNumberFromUserResponse)
-> Lens
DisassociatePhoneNumberFromUserResponse
DisassociatePhoneNumberFromUserResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociatePhoneNumberFromUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociatePhoneNumberFromUserResponse' :: DisassociatePhoneNumberFromUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociatePhoneNumberFromUserResponse
s@DisassociatePhoneNumberFromUserResponse' {} Int
a -> DisassociatePhoneNumberFromUserResponse
s {$sel:httpStatus:DisassociatePhoneNumberFromUserResponse' :: Int
httpStatus = Int
a} :: DisassociatePhoneNumberFromUserResponse)
instance
Prelude.NFData
DisassociatePhoneNumberFromUserResponse