{-# 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.DeleteAccount
(
DeleteAccount (..),
newDeleteAccount,
deleteAccount_accountId,
DeleteAccountResponse (..),
newDeleteAccountResponse,
deleteAccountResponse_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 DeleteAccount = DeleteAccount'
{
DeleteAccount -> Text
accountId :: Prelude.Text
}
deriving (DeleteAccount -> DeleteAccount -> Bool
(DeleteAccount -> DeleteAccount -> Bool)
-> (DeleteAccount -> DeleteAccount -> Bool) -> Eq DeleteAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccount -> DeleteAccount -> Bool
$c/= :: DeleteAccount -> DeleteAccount -> Bool
== :: DeleteAccount -> DeleteAccount -> Bool
$c== :: DeleteAccount -> DeleteAccount -> Bool
Prelude.Eq, ReadPrec [DeleteAccount]
ReadPrec DeleteAccount
Int -> ReadS DeleteAccount
ReadS [DeleteAccount]
(Int -> ReadS DeleteAccount)
-> ReadS [DeleteAccount]
-> ReadPrec DeleteAccount
-> ReadPrec [DeleteAccount]
-> Read DeleteAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccount]
$creadListPrec :: ReadPrec [DeleteAccount]
readPrec :: ReadPrec DeleteAccount
$creadPrec :: ReadPrec DeleteAccount
readList :: ReadS [DeleteAccount]
$creadList :: ReadS [DeleteAccount]
readsPrec :: Int -> ReadS DeleteAccount
$creadsPrec :: Int -> ReadS DeleteAccount
Prelude.Read, Int -> DeleteAccount -> ShowS
[DeleteAccount] -> ShowS
DeleteAccount -> String
(Int -> DeleteAccount -> ShowS)
-> (DeleteAccount -> String)
-> ([DeleteAccount] -> ShowS)
-> Show DeleteAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccount] -> ShowS
$cshowList :: [DeleteAccount] -> ShowS
show :: DeleteAccount -> String
$cshow :: DeleteAccount -> String
showsPrec :: Int -> DeleteAccount -> ShowS
$cshowsPrec :: Int -> DeleteAccount -> ShowS
Prelude.Show, (forall x. DeleteAccount -> Rep DeleteAccount x)
-> (forall x. Rep DeleteAccount x -> DeleteAccount)
-> Generic DeleteAccount
forall x. Rep DeleteAccount x -> DeleteAccount
forall x. DeleteAccount -> Rep DeleteAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccount x -> DeleteAccount
$cfrom :: forall x. DeleteAccount -> Rep DeleteAccount x
Prelude.Generic)
newDeleteAccount ::
Prelude.Text ->
DeleteAccount
newDeleteAccount :: Text -> DeleteAccount
newDeleteAccount Text
pAccountId_ =
DeleteAccount' :: Text -> DeleteAccount
DeleteAccount' {$sel:accountId:DeleteAccount' :: Text
accountId = Text
pAccountId_}
deleteAccount_accountId :: Lens.Lens' DeleteAccount Prelude.Text
deleteAccount_accountId :: (Text -> f Text) -> DeleteAccount -> f DeleteAccount
deleteAccount_accountId = (DeleteAccount -> Text)
-> (DeleteAccount -> Text -> DeleteAccount)
-> Lens DeleteAccount DeleteAccount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccount' {Text
accountId :: Text
$sel:accountId:DeleteAccount' :: DeleteAccount -> Text
accountId} -> Text
accountId) (\s :: DeleteAccount
s@DeleteAccount' {} Text
a -> DeleteAccount
s {$sel:accountId:DeleteAccount' :: Text
accountId = Text
a} :: DeleteAccount)
instance Core.AWSRequest DeleteAccount where
type
AWSResponse DeleteAccount =
DeleteAccountResponse
request :: DeleteAccount -> Request DeleteAccount
request = Service -> DeleteAccount -> Request DeleteAccount
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccount)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteAccount))
-> Logger
-> Service
-> Proxy DeleteAccount
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccount)))
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 -> DeleteAccountResponse
DeleteAccountResponse'
(Int -> DeleteAccountResponse)
-> Either String Int -> Either String DeleteAccountResponse
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 DeleteAccount
instance Prelude.NFData DeleteAccount
instance Core.ToHeaders DeleteAccount where
toHeaders :: DeleteAccount -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteAccount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteAccount where
toPath :: DeleteAccount -> ByteString
toPath DeleteAccount' {Text
accountId :: Text
$sel:accountId:DeleteAccount' :: DeleteAccount -> 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]
instance Core.ToQuery DeleteAccount where
toQuery :: DeleteAccount -> QueryString
toQuery = QueryString -> DeleteAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAccountResponse = DeleteAccountResponse'
{
DeleteAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAccountResponse -> DeleteAccountResponse -> Bool
(DeleteAccountResponse -> DeleteAccountResponse -> Bool)
-> (DeleteAccountResponse -> DeleteAccountResponse -> Bool)
-> Eq DeleteAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccountResponse -> DeleteAccountResponse -> Bool
$c/= :: DeleteAccountResponse -> DeleteAccountResponse -> Bool
== :: DeleteAccountResponse -> DeleteAccountResponse -> Bool
$c== :: DeleteAccountResponse -> DeleteAccountResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccountResponse]
ReadPrec DeleteAccountResponse
Int -> ReadS DeleteAccountResponse
ReadS [DeleteAccountResponse]
(Int -> ReadS DeleteAccountResponse)
-> ReadS [DeleteAccountResponse]
-> ReadPrec DeleteAccountResponse
-> ReadPrec [DeleteAccountResponse]
-> Read DeleteAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccountResponse]
$creadListPrec :: ReadPrec [DeleteAccountResponse]
readPrec :: ReadPrec DeleteAccountResponse
$creadPrec :: ReadPrec DeleteAccountResponse
readList :: ReadS [DeleteAccountResponse]
$creadList :: ReadS [DeleteAccountResponse]
readsPrec :: Int -> ReadS DeleteAccountResponse
$creadsPrec :: Int -> ReadS DeleteAccountResponse
Prelude.Read, Int -> DeleteAccountResponse -> ShowS
[DeleteAccountResponse] -> ShowS
DeleteAccountResponse -> String
(Int -> DeleteAccountResponse -> ShowS)
-> (DeleteAccountResponse -> String)
-> ([DeleteAccountResponse] -> ShowS)
-> Show DeleteAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccountResponse] -> ShowS
$cshowList :: [DeleteAccountResponse] -> ShowS
show :: DeleteAccountResponse -> String
$cshow :: DeleteAccountResponse -> String
showsPrec :: Int -> DeleteAccountResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccountResponse -> ShowS
Prelude.Show, (forall x. DeleteAccountResponse -> Rep DeleteAccountResponse x)
-> (forall x. Rep DeleteAccountResponse x -> DeleteAccountResponse)
-> Generic DeleteAccountResponse
forall x. Rep DeleteAccountResponse x -> DeleteAccountResponse
forall x. DeleteAccountResponse -> Rep DeleteAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccountResponse x -> DeleteAccountResponse
$cfrom :: forall x. DeleteAccountResponse -> Rep DeleteAccountResponse x
Prelude.Generic)
newDeleteAccountResponse ::
Prelude.Int ->
DeleteAccountResponse
newDeleteAccountResponse :: Int -> DeleteAccountResponse
newDeleteAccountResponse Int
pHttpStatus_ =
DeleteAccountResponse' :: Int -> DeleteAccountResponse
DeleteAccountResponse' {$sel:httpStatus:DeleteAccountResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteAccountResponse_httpStatus :: Lens.Lens' DeleteAccountResponse Prelude.Int
deleteAccountResponse_httpStatus :: (Int -> f Int) -> DeleteAccountResponse -> f DeleteAccountResponse
deleteAccountResponse_httpStatus = (DeleteAccountResponse -> Int)
-> (DeleteAccountResponse -> Int -> DeleteAccountResponse)
-> Lens DeleteAccountResponse DeleteAccountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAccountResponse' :: DeleteAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAccountResponse
s@DeleteAccountResponse' {} Int
a -> DeleteAccountResponse
s {$sel:httpStatus:DeleteAccountResponse' :: Int
httpStatus = Int
a} :: DeleteAccountResponse)
instance Prelude.NFData DeleteAccountResponse