{-# 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 Amazonka.CustomerProfiles.Types
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 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
(DeleteProfileObject -> DeleteProfileObject -> Bool)
-> (DeleteProfileObject -> DeleteProfileObject -> Bool)
-> Eq DeleteProfileObject
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]
(Int -> ReadS DeleteProfileObject)
-> ReadS [DeleteProfileObject]
-> ReadPrec DeleteProfileObject
-> ReadPrec [DeleteProfileObject]
-> Read 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
(Int -> DeleteProfileObject -> ShowS)
-> (DeleteProfileObject -> String)
-> ([DeleteProfileObject] -> ShowS)
-> Show DeleteProfileObject
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. DeleteProfileObject -> Rep DeleteProfileObject x)
-> (forall x. Rep DeleteProfileObject x -> DeleteProfileObject)
-> Generic DeleteProfileObject
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' :: Text -> Text -> Text -> Text -> DeleteProfileObject
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 :: (Text -> f Text) -> DeleteProfileObject -> f DeleteProfileObject
deleteProfileObject_profileId = (DeleteProfileObject -> Text)
-> (DeleteProfileObject -> Text -> DeleteProfileObject)
-> Lens DeleteProfileObject DeleteProfileObject Text Text
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 :: (Text -> f Text) -> DeleteProfileObject -> f DeleteProfileObject
deleteProfileObject_profileObjectUniqueKey = (DeleteProfileObject -> Text)
-> (DeleteProfileObject -> Text -> DeleteProfileObject)
-> Lens DeleteProfileObject DeleteProfileObject Text Text
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 :: (Text -> f Text) -> DeleteProfileObject -> f DeleteProfileObject
deleteProfileObject_objectTypeName = (DeleteProfileObject -> Text)
-> (DeleteProfileObject -> Text -> DeleteProfileObject)
-> Lens DeleteProfileObject DeleteProfileObject Text Text
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 :: (Text -> f Text) -> DeleteProfileObject -> f DeleteProfileObject
deleteProfileObject_domainName = (DeleteProfileObject -> Text)
-> (DeleteProfileObject -> Text -> DeleteProfileObject)
-> Lens DeleteProfileObject DeleteProfileObject Text Text
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 :: DeleteProfileObject -> Request DeleteProfileObject
request = Service -> DeleteProfileObject -> Request DeleteProfileObject
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteProfileObject
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProfileObject)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteProfileObject))
-> Logger
-> Service
-> Proxy DeleteProfileObject
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProfileObject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> DeleteProfileObjectResponse
DeleteProfileObjectResponse'
(Maybe Text -> Int -> DeleteProfileObjectResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteProfileObjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Message")
Either String (Int -> DeleteProfileObjectResponse)
-> Either String Int -> Either String DeleteProfileObjectResponse
forall (f :: * -> *) a b. Applicative f => 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 DeleteProfileObject
instance Prelude.NFData DeleteProfileObject
instance Core.ToHeaders DeleteProfileObject where
toHeaders :: DeleteProfileObject -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteProfileObject -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProfileId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profileId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ProfileObjectUniqueKey"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profileObjectUniqueKey
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ObjectTypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
objectTypeName)
]
)
instance Core.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
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/domains/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName,
ByteString
"/profiles/objects/delete"
]
instance Core.ToQuery DeleteProfileObject where
toQuery :: DeleteProfileObject -> QueryString
toQuery = QueryString -> DeleteProfileObject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteProfileObjectResponse
-> DeleteProfileObjectResponse -> Bool)
-> (DeleteProfileObjectResponse
-> DeleteProfileObjectResponse -> Bool)
-> Eq DeleteProfileObjectResponse
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]
(Int -> ReadS DeleteProfileObjectResponse)
-> ReadS [DeleteProfileObjectResponse]
-> ReadPrec DeleteProfileObjectResponse
-> ReadPrec [DeleteProfileObjectResponse]
-> Read 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
(Int -> DeleteProfileObjectResponse -> ShowS)
-> (DeleteProfileObjectResponse -> String)
-> ([DeleteProfileObjectResponse] -> ShowS)
-> Show DeleteProfileObjectResponse
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.
DeleteProfileObjectResponse -> Rep DeleteProfileObjectResponse x)
-> (forall x.
Rep DeleteProfileObjectResponse x -> DeleteProfileObjectResponse)
-> Generic DeleteProfileObjectResponse
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' :: Maybe Text -> Int -> DeleteProfileObjectResponse
DeleteProfileObjectResponse'
{ $sel:message:DeleteProfileObjectResponse' :: Maybe Text
message =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteProfileObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteProfileObjectResponse_message :: Lens.Lens' DeleteProfileObjectResponse (Prelude.Maybe Prelude.Text)
deleteProfileObjectResponse_message :: (Maybe Text -> f (Maybe Text))
-> DeleteProfileObjectResponse -> f DeleteProfileObjectResponse
deleteProfileObjectResponse_message = (DeleteProfileObjectResponse -> Maybe Text)
-> (DeleteProfileObjectResponse
-> Maybe Text -> DeleteProfileObjectResponse)
-> Lens
DeleteProfileObjectResponse
DeleteProfileObjectResponse
(Maybe Text)
(Maybe Text)
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 :: (Int -> f Int)
-> DeleteProfileObjectResponse -> f DeleteProfileObjectResponse
deleteProfileObjectResponse_httpStatus = (DeleteProfileObjectResponse -> Int)
-> (DeleteProfileObjectResponse
-> Int -> DeleteProfileObjectResponse)
-> Lens
DeleteProfileObjectResponse DeleteProfileObjectResponse Int Int
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