{-# 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.Account.DeleteAlternateContact
(
DeleteAlternateContact (..),
newDeleteAlternateContact,
deleteAlternateContact_accountId,
deleteAlternateContact_alternateContactType,
DeleteAlternateContactResponse (..),
newDeleteAlternateContactResponse,
)
where
import Amazonka.Account.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 DeleteAlternateContact = DeleteAlternateContact'
{
DeleteAlternateContact -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
DeleteAlternateContact -> AlternateContactType
alternateContactType :: AlternateContactType
}
deriving (DeleteAlternateContact -> DeleteAlternateContact -> Bool
(DeleteAlternateContact -> DeleteAlternateContact -> Bool)
-> (DeleteAlternateContact -> DeleteAlternateContact -> Bool)
-> Eq DeleteAlternateContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlternateContact -> DeleteAlternateContact -> Bool
$c/= :: DeleteAlternateContact -> DeleteAlternateContact -> Bool
== :: DeleteAlternateContact -> DeleteAlternateContact -> Bool
$c== :: DeleteAlternateContact -> DeleteAlternateContact -> Bool
Prelude.Eq, ReadPrec [DeleteAlternateContact]
ReadPrec DeleteAlternateContact
Int -> ReadS DeleteAlternateContact
ReadS [DeleteAlternateContact]
(Int -> ReadS DeleteAlternateContact)
-> ReadS [DeleteAlternateContact]
-> ReadPrec DeleteAlternateContact
-> ReadPrec [DeleteAlternateContact]
-> Read DeleteAlternateContact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlternateContact]
$creadListPrec :: ReadPrec [DeleteAlternateContact]
readPrec :: ReadPrec DeleteAlternateContact
$creadPrec :: ReadPrec DeleteAlternateContact
readList :: ReadS [DeleteAlternateContact]
$creadList :: ReadS [DeleteAlternateContact]
readsPrec :: Int -> ReadS DeleteAlternateContact
$creadsPrec :: Int -> ReadS DeleteAlternateContact
Prelude.Read, Int -> DeleteAlternateContact -> ShowS
[DeleteAlternateContact] -> ShowS
DeleteAlternateContact -> String
(Int -> DeleteAlternateContact -> ShowS)
-> (DeleteAlternateContact -> String)
-> ([DeleteAlternateContact] -> ShowS)
-> Show DeleteAlternateContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlternateContact] -> ShowS
$cshowList :: [DeleteAlternateContact] -> ShowS
show :: DeleteAlternateContact -> String
$cshow :: DeleteAlternateContact -> String
showsPrec :: Int -> DeleteAlternateContact -> ShowS
$cshowsPrec :: Int -> DeleteAlternateContact -> ShowS
Prelude.Show, (forall x. DeleteAlternateContact -> Rep DeleteAlternateContact x)
-> (forall x.
Rep DeleteAlternateContact x -> DeleteAlternateContact)
-> Generic DeleteAlternateContact
forall x. Rep DeleteAlternateContact x -> DeleteAlternateContact
forall x. DeleteAlternateContact -> Rep DeleteAlternateContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAlternateContact x -> DeleteAlternateContact
$cfrom :: forall x. DeleteAlternateContact -> Rep DeleteAlternateContact x
Prelude.Generic)
newDeleteAlternateContact ::
AlternateContactType ->
DeleteAlternateContact
newDeleteAlternateContact :: AlternateContactType -> DeleteAlternateContact
newDeleteAlternateContact AlternateContactType
pAlternateContactType_ =
DeleteAlternateContact' :: Maybe Text -> AlternateContactType -> DeleteAlternateContact
DeleteAlternateContact'
{ $sel:accountId:DeleteAlternateContact' :: Maybe Text
accountId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alternateContactType:DeleteAlternateContact' :: AlternateContactType
alternateContactType = AlternateContactType
pAlternateContactType_
}
deleteAlternateContact_accountId :: Lens.Lens' DeleteAlternateContact (Prelude.Maybe Prelude.Text)
deleteAlternateContact_accountId :: (Maybe Text -> f (Maybe Text))
-> DeleteAlternateContact -> f DeleteAlternateContact
deleteAlternateContact_accountId = (DeleteAlternateContact -> Maybe Text)
-> (DeleteAlternateContact -> Maybe Text -> DeleteAlternateContact)
-> Lens
DeleteAlternateContact
DeleteAlternateContact
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlternateContact' {Maybe Text
accountId :: Maybe Text
$sel:accountId:DeleteAlternateContact' :: DeleteAlternateContact -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: DeleteAlternateContact
s@DeleteAlternateContact' {} Maybe Text
a -> DeleteAlternateContact
s {$sel:accountId:DeleteAlternateContact' :: Maybe Text
accountId = Maybe Text
a} :: DeleteAlternateContact)
deleteAlternateContact_alternateContactType :: Lens.Lens' DeleteAlternateContact AlternateContactType
deleteAlternateContact_alternateContactType :: (AlternateContactType -> f AlternateContactType)
-> DeleteAlternateContact -> f DeleteAlternateContact
deleteAlternateContact_alternateContactType = (DeleteAlternateContact -> AlternateContactType)
-> (DeleteAlternateContact
-> AlternateContactType -> DeleteAlternateContact)
-> Lens
DeleteAlternateContact
DeleteAlternateContact
AlternateContactType
AlternateContactType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlternateContact' {AlternateContactType
alternateContactType :: AlternateContactType
$sel:alternateContactType:DeleteAlternateContact' :: DeleteAlternateContact -> AlternateContactType
alternateContactType} -> AlternateContactType
alternateContactType) (\s :: DeleteAlternateContact
s@DeleteAlternateContact' {} AlternateContactType
a -> DeleteAlternateContact
s {$sel:alternateContactType:DeleteAlternateContact' :: AlternateContactType
alternateContactType = AlternateContactType
a} :: DeleteAlternateContact)
instance Core.AWSRequest DeleteAlternateContact where
type
AWSResponse DeleteAlternateContact =
DeleteAlternateContactResponse
request :: DeleteAlternateContact -> Request DeleteAlternateContact
request = Service -> DeleteAlternateContact -> Request DeleteAlternateContact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAlternateContact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAlternateContact)))
response =
AWSResponse DeleteAlternateContact
-> Logger
-> Service
-> Proxy DeleteAlternateContact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAlternateContact)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse DeleteAlternateContact
DeleteAlternateContactResponse
DeleteAlternateContactResponse'
instance Prelude.Hashable DeleteAlternateContact
instance Prelude.NFData DeleteAlternateContact
instance Core.ToHeaders DeleteAlternateContact where
toHeaders :: DeleteAlternateContact -> [Header]
toHeaders =
[Header] -> DeleteAlternateContact -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteAlternateContact where
toJSON :: DeleteAlternateContact -> Value
toJSON DeleteAlternateContact' {Maybe Text
AlternateContactType
alternateContactType :: AlternateContactType
accountId :: Maybe Text
$sel:alternateContactType:DeleteAlternateContact' :: DeleteAlternateContact -> AlternateContactType
$sel:accountId:DeleteAlternateContact' :: DeleteAlternateContact -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accountId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AlternateContactType"
Text -> AlternateContactType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AlternateContactType
alternateContactType
)
]
)
instance Core.ToPath DeleteAlternateContact where
toPath :: DeleteAlternateContact -> ByteString
toPath = ByteString -> DeleteAlternateContact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deleteAlternateContact"
instance Core.ToQuery DeleteAlternateContact where
toQuery :: DeleteAlternateContact -> QueryString
toQuery = QueryString -> DeleteAlternateContact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAlternateContactResponse = DeleteAlternateContactResponse'
{
}
deriving (DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool
(DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool)
-> (DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool)
-> Eq DeleteAlternateContactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool
$c/= :: DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool
== :: DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool
$c== :: DeleteAlternateContactResponse
-> DeleteAlternateContactResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAlternateContactResponse]
ReadPrec DeleteAlternateContactResponse
Int -> ReadS DeleteAlternateContactResponse
ReadS [DeleteAlternateContactResponse]
(Int -> ReadS DeleteAlternateContactResponse)
-> ReadS [DeleteAlternateContactResponse]
-> ReadPrec DeleteAlternateContactResponse
-> ReadPrec [DeleteAlternateContactResponse]
-> Read DeleteAlternateContactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlternateContactResponse]
$creadListPrec :: ReadPrec [DeleteAlternateContactResponse]
readPrec :: ReadPrec DeleteAlternateContactResponse
$creadPrec :: ReadPrec DeleteAlternateContactResponse
readList :: ReadS [DeleteAlternateContactResponse]
$creadList :: ReadS [DeleteAlternateContactResponse]
readsPrec :: Int -> ReadS DeleteAlternateContactResponse
$creadsPrec :: Int -> ReadS DeleteAlternateContactResponse
Prelude.Read, Int -> DeleteAlternateContactResponse -> ShowS
[DeleteAlternateContactResponse] -> ShowS
DeleteAlternateContactResponse -> String
(Int -> DeleteAlternateContactResponse -> ShowS)
-> (DeleteAlternateContactResponse -> String)
-> ([DeleteAlternateContactResponse] -> ShowS)
-> Show DeleteAlternateContactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlternateContactResponse] -> ShowS
$cshowList :: [DeleteAlternateContactResponse] -> ShowS
show :: DeleteAlternateContactResponse -> String
$cshow :: DeleteAlternateContactResponse -> String
showsPrec :: Int -> DeleteAlternateContactResponse -> ShowS
$cshowsPrec :: Int -> DeleteAlternateContactResponse -> ShowS
Prelude.Show, (forall x.
DeleteAlternateContactResponse
-> Rep DeleteAlternateContactResponse x)
-> (forall x.
Rep DeleteAlternateContactResponse x
-> DeleteAlternateContactResponse)
-> Generic DeleteAlternateContactResponse
forall x.
Rep DeleteAlternateContactResponse x
-> DeleteAlternateContactResponse
forall x.
DeleteAlternateContactResponse
-> Rep DeleteAlternateContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAlternateContactResponse x
-> DeleteAlternateContactResponse
$cfrom :: forall x.
DeleteAlternateContactResponse
-> Rep DeleteAlternateContactResponse x
Prelude.Generic)
newDeleteAlternateContactResponse ::
DeleteAlternateContactResponse
newDeleteAlternateContactResponse :: DeleteAlternateContactResponse
newDeleteAlternateContactResponse =
DeleteAlternateContactResponse
DeleteAlternateContactResponse'
instance
Prelude.NFData
DeleteAlternateContactResponse