{-# 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.CustomerProfiles.DeleteProfileObject
(
DeleteProfileObject (..),
newDeleteProfileObject,
deleteProfileObject_profileId,
deleteProfileObject_profileObjectUniqueKey,
deleteProfileObject_objectTypeName,
deleteProfileObject_domainName,
DeleteProfileObjectResponse (..),
newDeleteProfileObjectResponse,
deleteProfileObjectResponse_message,
deleteProfileObjectResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types
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 DeleteProfileObject = DeleteProfileObject'
{
DeleteProfileObject -> Text
profileId :: Prelude.Text,
DeleteProfileObject -> Text
profileObjectUniqueKey :: Prelude.Text,
DeleteProfileObject -> Text
objectTypeName :: Prelude.Text,
DeleteProfileObject -> Text
domainName :: Prelude.Text
}
deriving (DeleteProfileObject -> DeleteProfileObject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfileObject -> DeleteProfileObject -> Bool
$c/= :: DeleteProfileObject -> DeleteProfileObject -> Bool
== :: DeleteProfileObject -> DeleteProfileObject -> Bool
$c== :: DeleteProfileObject -> DeleteProfileObject -> Bool
Prelude.Eq, ReadPrec [DeleteProfileObject]
ReadPrec DeleteProfileObject
Int -> ReadS DeleteProfileObject
ReadS [DeleteProfileObject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfileObject]
$creadListPrec :: ReadPrec [DeleteProfileObject]
readPrec :: ReadPrec DeleteProfileObject
$creadPrec :: ReadPrec DeleteProfileObject
readList :: ReadS [DeleteProfileObject]
$creadList :: ReadS [DeleteProfileObject]
readsPrec :: Int -> ReadS DeleteProfileObject
$creadsPrec :: Int -> ReadS DeleteProfileObject
Prelude.Read, Int -> DeleteProfileObject -> ShowS
[DeleteProfileObject] -> ShowS
DeleteProfileObject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfileObject] -> ShowS
$cshowList :: [DeleteProfileObject] -> ShowS
show :: DeleteProfileObject -> String
$cshow :: DeleteProfileObject -> String
showsPrec :: Int -> DeleteProfileObject -> ShowS
$cshowsPrec :: Int -> DeleteProfileObject -> ShowS
Prelude.Show, forall x. Rep DeleteProfileObject x -> DeleteProfileObject
forall x. DeleteProfileObject -> Rep DeleteProfileObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProfileObject x -> DeleteProfileObject
$cfrom :: forall x. DeleteProfileObject -> Rep DeleteProfileObject x
Prelude.Generic)
newDeleteProfileObject ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteProfileObject
newDeleteProfileObject :: Text -> Text -> Text -> Text -> DeleteProfileObject
newDeleteProfileObject
Text
pProfileId_
Text
pProfileObjectUniqueKey_
Text
pObjectTypeName_
Text
pDomainName_ =
DeleteProfileObject'
{ $sel:profileId:DeleteProfileObject' :: Text
profileId = Text
pProfileId_,
$sel:profileObjectUniqueKey:DeleteProfileObject' :: Text
profileObjectUniqueKey = Text
pProfileObjectUniqueKey_,
$sel:objectTypeName:DeleteProfileObject' :: Text
objectTypeName = Text
pObjectTypeName_,
$sel:domainName:DeleteProfileObject' :: Text
domainName = Text
pDomainName_
}
deleteProfileObject_profileId :: Lens.Lens' DeleteProfileObject Prelude.Text
deleteProfileObject_profileId :: Lens' DeleteProfileObject Text
deleteProfileObject_profileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObject' {Text
profileId :: Text
$sel:profileId:DeleteProfileObject' :: DeleteProfileObject -> Text
profileId} -> Text
profileId) (\s :: DeleteProfileObject
s@DeleteProfileObject' {} Text
a -> DeleteProfileObject
s {$sel:profileId:DeleteProfileObject' :: Text
profileId = Text
a} :: DeleteProfileObject)
deleteProfileObject_profileObjectUniqueKey :: Lens.Lens' DeleteProfileObject Prelude.Text
deleteProfileObject_profileObjectUniqueKey :: Lens' DeleteProfileObject Text
deleteProfileObject_profileObjectUniqueKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObject' {Text
profileObjectUniqueKey :: Text
$sel:profileObjectUniqueKey:DeleteProfileObject' :: DeleteProfileObject -> Text
profileObjectUniqueKey} -> Text
profileObjectUniqueKey) (\s :: DeleteProfileObject
s@DeleteProfileObject' {} Text
a -> DeleteProfileObject
s {$sel:profileObjectUniqueKey:DeleteProfileObject' :: Text
profileObjectUniqueKey = Text
a} :: DeleteProfileObject)
deleteProfileObject_objectTypeName :: Lens.Lens' DeleteProfileObject Prelude.Text
deleteProfileObject_objectTypeName :: Lens' DeleteProfileObject Text
deleteProfileObject_objectTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObject' {Text
objectTypeName :: Text
$sel:objectTypeName:DeleteProfileObject' :: DeleteProfileObject -> Text
objectTypeName} -> Text
objectTypeName) (\s :: DeleteProfileObject
s@DeleteProfileObject' {} Text
a -> DeleteProfileObject
s {$sel:objectTypeName:DeleteProfileObject' :: Text
objectTypeName = Text
a} :: DeleteProfileObject)
deleteProfileObject_domainName :: Lens.Lens' DeleteProfileObject Prelude.Text
deleteProfileObject_domainName :: Lens' DeleteProfileObject Text
deleteProfileObject_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObject' {Text
domainName :: Text
$sel:domainName:DeleteProfileObject' :: DeleteProfileObject -> Text
domainName} -> Text
domainName) (\s :: DeleteProfileObject
s@DeleteProfileObject' {} Text
a -> DeleteProfileObject
s {$sel:domainName:DeleteProfileObject' :: Text
domainName = Text
a} :: DeleteProfileObject)
instance Core.AWSRequest DeleteProfileObject where
type
AWSResponse DeleteProfileObject =
DeleteProfileObjectResponse
request :: (Service -> Service)
-> DeleteProfileObject -> Request DeleteProfileObject
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 DeleteProfileObject
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProfileObject)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> DeleteProfileObjectResponse
DeleteProfileObjectResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Message")
forall (f :: * -> *) a b. Applicative f => 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 DeleteProfileObject where
hashWithSalt :: Int -> DeleteProfileObject -> Int
hashWithSalt Int
_salt DeleteProfileObject' {Text
domainName :: Text
objectTypeName :: Text
profileObjectUniqueKey :: Text
profileId :: Text
$sel:domainName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:objectTypeName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileObjectUniqueKey:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileId:DeleteProfileObject' :: DeleteProfileObject -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profileId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profileObjectUniqueKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
objectTypeName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName
instance Prelude.NFData DeleteProfileObject where
rnf :: DeleteProfileObject -> ()
rnf DeleteProfileObject' {Text
domainName :: Text
objectTypeName :: Text
profileObjectUniqueKey :: Text
profileId :: Text
$sel:domainName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:objectTypeName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileObjectUniqueKey:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileId:DeleteProfileObject' :: DeleteProfileObject -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
profileId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profileObjectUniqueKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
objectTypeName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domainName
instance Data.ToHeaders DeleteProfileObject where
toHeaders :: DeleteProfileObject -> 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 DeleteProfileObject where
toJSON :: DeleteProfileObject -> Value
toJSON DeleteProfileObject' {Text
domainName :: Text
objectTypeName :: Text
profileObjectUniqueKey :: Text
profileId :: Text
$sel:domainName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:objectTypeName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileObjectUniqueKey:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileId:DeleteProfileObject' :: DeleteProfileObject -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ProfileId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
profileId),
forall a. a -> Maybe a
Prelude.Just
( Key
"ProfileObjectUniqueKey"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
profileObjectUniqueKey
),
forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectTypeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
objectTypeName)
]
)
instance Data.ToPath DeleteProfileObject where
toPath :: DeleteProfileObject -> ByteString
toPath DeleteProfileObject' {Text
domainName :: Text
objectTypeName :: Text
profileObjectUniqueKey :: Text
profileId :: Text
$sel:domainName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:objectTypeName:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileObjectUniqueKey:DeleteProfileObject' :: DeleteProfileObject -> Text
$sel:profileId:DeleteProfileObject' :: DeleteProfileObject -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/domains/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName,
ByteString
"/profiles/objects/delete"
]
instance Data.ToQuery DeleteProfileObject where
toQuery :: DeleteProfileObject -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteProfileObjectResponse = DeleteProfileObjectResponse'
{
DeleteProfileObjectResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
DeleteProfileObjectResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProfileObjectResponse -> DeleteProfileObjectResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfileObjectResponse -> DeleteProfileObjectResponse -> Bool
$c/= :: DeleteProfileObjectResponse -> DeleteProfileObjectResponse -> Bool
== :: DeleteProfileObjectResponse -> DeleteProfileObjectResponse -> Bool
$c== :: DeleteProfileObjectResponse -> DeleteProfileObjectResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProfileObjectResponse]
ReadPrec DeleteProfileObjectResponse
Int -> ReadS DeleteProfileObjectResponse
ReadS [DeleteProfileObjectResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfileObjectResponse]
$creadListPrec :: ReadPrec [DeleteProfileObjectResponse]
readPrec :: ReadPrec DeleteProfileObjectResponse
$creadPrec :: ReadPrec DeleteProfileObjectResponse
readList :: ReadS [DeleteProfileObjectResponse]
$creadList :: ReadS [DeleteProfileObjectResponse]
readsPrec :: Int -> ReadS DeleteProfileObjectResponse
$creadsPrec :: Int -> ReadS DeleteProfileObjectResponse
Prelude.Read, Int -> DeleteProfileObjectResponse -> ShowS
[DeleteProfileObjectResponse] -> ShowS
DeleteProfileObjectResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfileObjectResponse] -> ShowS
$cshowList :: [DeleteProfileObjectResponse] -> ShowS
show :: DeleteProfileObjectResponse -> String
$cshow :: DeleteProfileObjectResponse -> String
showsPrec :: Int -> DeleteProfileObjectResponse -> ShowS
$cshowsPrec :: Int -> DeleteProfileObjectResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteProfileObjectResponse x -> DeleteProfileObjectResponse
forall x.
DeleteProfileObjectResponse -> Rep DeleteProfileObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteProfileObjectResponse x -> DeleteProfileObjectResponse
$cfrom :: forall x.
DeleteProfileObjectResponse -> Rep DeleteProfileObjectResponse x
Prelude.Generic)
newDeleteProfileObjectResponse ::
Prelude.Int ->
DeleteProfileObjectResponse
newDeleteProfileObjectResponse :: Int -> DeleteProfileObjectResponse
newDeleteProfileObjectResponse Int
pHttpStatus_ =
DeleteProfileObjectResponse'
{ $sel:message:DeleteProfileObjectResponse' :: Maybe Text
message =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteProfileObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteProfileObjectResponse_message :: Lens.Lens' DeleteProfileObjectResponse (Prelude.Maybe Prelude.Text)
deleteProfileObjectResponse_message :: Lens' DeleteProfileObjectResponse (Maybe Text)
deleteProfileObjectResponse_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObjectResponse' {Maybe Text
message :: Maybe Text
$sel:message:DeleteProfileObjectResponse' :: DeleteProfileObjectResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: DeleteProfileObjectResponse
s@DeleteProfileObjectResponse' {} Maybe Text
a -> DeleteProfileObjectResponse
s {$sel:message:DeleteProfileObjectResponse' :: Maybe Text
message = Maybe Text
a} :: DeleteProfileObjectResponse)
deleteProfileObjectResponse_httpStatus :: Lens.Lens' DeleteProfileObjectResponse Prelude.Int
deleteProfileObjectResponse_httpStatus :: Lens' DeleteProfileObjectResponse Int
deleteProfileObjectResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileObjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProfileObjectResponse' :: DeleteProfileObjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProfileObjectResponse
s@DeleteProfileObjectResponse' {} Int
a -> DeleteProfileObjectResponse
s {$sel:httpStatus:DeleteProfileObjectResponse' :: Int
httpStatus = Int
a} :: DeleteProfileObjectResponse)
instance Prelude.NFData DeleteProfileObjectResponse where
rnf :: DeleteProfileObjectResponse -> ()
rnf DeleteProfileObjectResponse' {Int
Maybe Text
httpStatus :: Int
message :: Maybe Text
$sel:httpStatus:DeleteProfileObjectResponse' :: DeleteProfileObjectResponse -> Int
$sel:message:DeleteProfileObjectResponse' :: DeleteProfileObjectResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus