{-# 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.DeleteProfileKey
(
DeleteProfileKey (..),
newDeleteProfileKey,
deleteProfileKey_profileId,
deleteProfileKey_keyName,
deleteProfileKey_values,
deleteProfileKey_domainName,
DeleteProfileKeyResponse (..),
newDeleteProfileKeyResponse,
deleteProfileKeyResponse_message,
deleteProfileKeyResponse_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 DeleteProfileKey = DeleteProfileKey'
{
DeleteProfileKey -> Text
profileId :: Prelude.Text,
DeleteProfileKey -> Text
keyName :: Prelude.Text,
DeleteProfileKey -> [Text]
values :: [Prelude.Text],
DeleteProfileKey -> Text
domainName :: Prelude.Text
}
deriving (DeleteProfileKey -> DeleteProfileKey -> Bool
(DeleteProfileKey -> DeleteProfileKey -> Bool)
-> (DeleteProfileKey -> DeleteProfileKey -> Bool)
-> Eq DeleteProfileKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfileKey -> DeleteProfileKey -> Bool
$c/= :: DeleteProfileKey -> DeleteProfileKey -> Bool
== :: DeleteProfileKey -> DeleteProfileKey -> Bool
$c== :: DeleteProfileKey -> DeleteProfileKey -> Bool
Prelude.Eq, ReadPrec [DeleteProfileKey]
ReadPrec DeleteProfileKey
Int -> ReadS DeleteProfileKey
ReadS [DeleteProfileKey]
(Int -> ReadS DeleteProfileKey)
-> ReadS [DeleteProfileKey]
-> ReadPrec DeleteProfileKey
-> ReadPrec [DeleteProfileKey]
-> Read DeleteProfileKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfileKey]
$creadListPrec :: ReadPrec [DeleteProfileKey]
readPrec :: ReadPrec DeleteProfileKey
$creadPrec :: ReadPrec DeleteProfileKey
readList :: ReadS [DeleteProfileKey]
$creadList :: ReadS [DeleteProfileKey]
readsPrec :: Int -> ReadS DeleteProfileKey
$creadsPrec :: Int -> ReadS DeleteProfileKey
Prelude.Read, Int -> DeleteProfileKey -> ShowS
[DeleteProfileKey] -> ShowS
DeleteProfileKey -> String
(Int -> DeleteProfileKey -> ShowS)
-> (DeleteProfileKey -> String)
-> ([DeleteProfileKey] -> ShowS)
-> Show DeleteProfileKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfileKey] -> ShowS
$cshowList :: [DeleteProfileKey] -> ShowS
show :: DeleteProfileKey -> String
$cshow :: DeleteProfileKey -> String
showsPrec :: Int -> DeleteProfileKey -> ShowS
$cshowsPrec :: Int -> DeleteProfileKey -> ShowS
Prelude.Show, (forall x. DeleteProfileKey -> Rep DeleteProfileKey x)
-> (forall x. Rep DeleteProfileKey x -> DeleteProfileKey)
-> Generic DeleteProfileKey
forall x. Rep DeleteProfileKey x -> DeleteProfileKey
forall x. DeleteProfileKey -> Rep DeleteProfileKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProfileKey x -> DeleteProfileKey
$cfrom :: forall x. DeleteProfileKey -> Rep DeleteProfileKey x
Prelude.Generic)
newDeleteProfileKey ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteProfileKey
newDeleteProfileKey :: Text -> Text -> Text -> DeleteProfileKey
newDeleteProfileKey
Text
pProfileId_
Text
pKeyName_
Text
pDomainName_ =
DeleteProfileKey' :: Text -> Text -> [Text] -> Text -> DeleteProfileKey
DeleteProfileKey'
{ $sel:profileId:DeleteProfileKey' :: Text
profileId = Text
pProfileId_,
$sel:keyName:DeleteProfileKey' :: Text
keyName = Text
pKeyName_,
$sel:values:DeleteProfileKey' :: [Text]
values = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:domainName:DeleteProfileKey' :: Text
domainName = Text
pDomainName_
}
deleteProfileKey_profileId :: Lens.Lens' DeleteProfileKey Prelude.Text
deleteProfileKey_profileId :: (Text -> f Text) -> DeleteProfileKey -> f DeleteProfileKey
deleteProfileKey_profileId = (DeleteProfileKey -> Text)
-> (DeleteProfileKey -> Text -> DeleteProfileKey)
-> Lens DeleteProfileKey DeleteProfileKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKey' {Text
profileId :: Text
$sel:profileId:DeleteProfileKey' :: DeleteProfileKey -> Text
profileId} -> Text
profileId) (\s :: DeleteProfileKey
s@DeleteProfileKey' {} Text
a -> DeleteProfileKey
s {$sel:profileId:DeleteProfileKey' :: Text
profileId = Text
a} :: DeleteProfileKey)
deleteProfileKey_keyName :: Lens.Lens' DeleteProfileKey Prelude.Text
deleteProfileKey_keyName :: (Text -> f Text) -> DeleteProfileKey -> f DeleteProfileKey
deleteProfileKey_keyName = (DeleteProfileKey -> Text)
-> (DeleteProfileKey -> Text -> DeleteProfileKey)
-> Lens DeleteProfileKey DeleteProfileKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKey' {Text
keyName :: Text
$sel:keyName:DeleteProfileKey' :: DeleteProfileKey -> Text
keyName} -> Text
keyName) (\s :: DeleteProfileKey
s@DeleteProfileKey' {} Text
a -> DeleteProfileKey
s {$sel:keyName:DeleteProfileKey' :: Text
keyName = Text
a} :: DeleteProfileKey)
deleteProfileKey_values :: Lens.Lens' DeleteProfileKey [Prelude.Text]
deleteProfileKey_values :: ([Text] -> f [Text]) -> DeleteProfileKey -> f DeleteProfileKey
deleteProfileKey_values = (DeleteProfileKey -> [Text])
-> (DeleteProfileKey -> [Text] -> DeleteProfileKey)
-> Lens DeleteProfileKey DeleteProfileKey [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKey' {[Text]
values :: [Text]
$sel:values:DeleteProfileKey' :: DeleteProfileKey -> [Text]
values} -> [Text]
values) (\s :: DeleteProfileKey
s@DeleteProfileKey' {} [Text]
a -> DeleteProfileKey
s {$sel:values:DeleteProfileKey' :: [Text]
values = [Text]
a} :: DeleteProfileKey) (([Text] -> f [Text]) -> DeleteProfileKey -> f DeleteProfileKey)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DeleteProfileKey
-> f DeleteProfileKey
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteProfileKey_domainName :: Lens.Lens' DeleteProfileKey Prelude.Text
deleteProfileKey_domainName :: (Text -> f Text) -> DeleteProfileKey -> f DeleteProfileKey
deleteProfileKey_domainName = (DeleteProfileKey -> Text)
-> (DeleteProfileKey -> Text -> DeleteProfileKey)
-> Lens DeleteProfileKey DeleteProfileKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKey' {Text
domainName :: Text
$sel:domainName:DeleteProfileKey' :: DeleteProfileKey -> Text
domainName} -> Text
domainName) (\s :: DeleteProfileKey
s@DeleteProfileKey' {} Text
a -> DeleteProfileKey
s {$sel:domainName:DeleteProfileKey' :: Text
domainName = Text
a} :: DeleteProfileKey)
instance Core.AWSRequest DeleteProfileKey where
type
AWSResponse DeleteProfileKey =
DeleteProfileKeyResponse
request :: DeleteProfileKey -> Request DeleteProfileKey
request = Service -> DeleteProfileKey -> Request DeleteProfileKey
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteProfileKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteProfileKey)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteProfileKey))
-> Logger
-> Service
-> Proxy DeleteProfileKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteProfileKey)))
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 -> DeleteProfileKeyResponse
DeleteProfileKeyResponse'
(Maybe Text -> Int -> DeleteProfileKeyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteProfileKeyResponse)
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 -> DeleteProfileKeyResponse)
-> Either String Int -> Either String DeleteProfileKeyResponse
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 DeleteProfileKey
instance Prelude.NFData DeleteProfileKey
instance Core.ToHeaders DeleteProfileKey where
toHeaders :: DeleteProfileKey -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteProfileKey -> 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 DeleteProfileKey where
toJSON :: DeleteProfileKey -> Value
toJSON DeleteProfileKey' {[Text]
Text
domainName :: Text
values :: [Text]
keyName :: Text
profileId :: Text
$sel:domainName:DeleteProfileKey' :: DeleteProfileKey -> Text
$sel:values:DeleteProfileKey' :: DeleteProfileKey -> [Text]
$sel:keyName:DeleteProfileKey' :: DeleteProfileKey -> Text
$sel:profileId:DeleteProfileKey' :: DeleteProfileKey -> 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
"KeyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Values" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
values)
]
)
instance Core.ToPath DeleteProfileKey where
toPath :: DeleteProfileKey -> ByteString
toPath DeleteProfileKey' {[Text]
Text
domainName :: Text
values :: [Text]
keyName :: Text
profileId :: Text
$sel:domainName:DeleteProfileKey' :: DeleteProfileKey -> Text
$sel:values:DeleteProfileKey' :: DeleteProfileKey -> [Text]
$sel:keyName:DeleteProfileKey' :: DeleteProfileKey -> Text
$sel:profileId:DeleteProfileKey' :: DeleteProfileKey -> 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/keys/delete"
]
instance Core.ToQuery DeleteProfileKey where
toQuery :: DeleteProfileKey -> QueryString
toQuery = QueryString -> DeleteProfileKey -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteProfileKeyResponse = DeleteProfileKeyResponse'
{
DeleteProfileKeyResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
DeleteProfileKeyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool
(DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool)
-> (DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool)
-> Eq DeleteProfileKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool
$c/= :: DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool
== :: DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool
$c== :: DeleteProfileKeyResponse -> DeleteProfileKeyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProfileKeyResponse]
ReadPrec DeleteProfileKeyResponse
Int -> ReadS DeleteProfileKeyResponse
ReadS [DeleteProfileKeyResponse]
(Int -> ReadS DeleteProfileKeyResponse)
-> ReadS [DeleteProfileKeyResponse]
-> ReadPrec DeleteProfileKeyResponse
-> ReadPrec [DeleteProfileKeyResponse]
-> Read DeleteProfileKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfileKeyResponse]
$creadListPrec :: ReadPrec [DeleteProfileKeyResponse]
readPrec :: ReadPrec DeleteProfileKeyResponse
$creadPrec :: ReadPrec DeleteProfileKeyResponse
readList :: ReadS [DeleteProfileKeyResponse]
$creadList :: ReadS [DeleteProfileKeyResponse]
readsPrec :: Int -> ReadS DeleteProfileKeyResponse
$creadsPrec :: Int -> ReadS DeleteProfileKeyResponse
Prelude.Read, Int -> DeleteProfileKeyResponse -> ShowS
[DeleteProfileKeyResponse] -> ShowS
DeleteProfileKeyResponse -> String
(Int -> DeleteProfileKeyResponse -> ShowS)
-> (DeleteProfileKeyResponse -> String)
-> ([DeleteProfileKeyResponse] -> ShowS)
-> Show DeleteProfileKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfileKeyResponse] -> ShowS
$cshowList :: [DeleteProfileKeyResponse] -> ShowS
show :: DeleteProfileKeyResponse -> String
$cshow :: DeleteProfileKeyResponse -> String
showsPrec :: Int -> DeleteProfileKeyResponse -> ShowS
$cshowsPrec :: Int -> DeleteProfileKeyResponse -> ShowS
Prelude.Show, (forall x.
DeleteProfileKeyResponse -> Rep DeleteProfileKeyResponse x)
-> (forall x.
Rep DeleteProfileKeyResponse x -> DeleteProfileKeyResponse)
-> Generic DeleteProfileKeyResponse
forall x.
Rep DeleteProfileKeyResponse x -> DeleteProfileKeyResponse
forall x.
DeleteProfileKeyResponse -> Rep DeleteProfileKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteProfileKeyResponse x -> DeleteProfileKeyResponse
$cfrom :: forall x.
DeleteProfileKeyResponse -> Rep DeleteProfileKeyResponse x
Prelude.Generic)
newDeleteProfileKeyResponse ::
Prelude.Int ->
DeleteProfileKeyResponse
newDeleteProfileKeyResponse :: Int -> DeleteProfileKeyResponse
newDeleteProfileKeyResponse Int
pHttpStatus_ =
DeleteProfileKeyResponse' :: Maybe Text -> Int -> DeleteProfileKeyResponse
DeleteProfileKeyResponse'
{ $sel:message:DeleteProfileKeyResponse' :: Maybe Text
message =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteProfileKeyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteProfileKeyResponse_message :: Lens.Lens' DeleteProfileKeyResponse (Prelude.Maybe Prelude.Text)
deleteProfileKeyResponse_message :: (Maybe Text -> f (Maybe Text))
-> DeleteProfileKeyResponse -> f DeleteProfileKeyResponse
deleteProfileKeyResponse_message = (DeleteProfileKeyResponse -> Maybe Text)
-> (DeleteProfileKeyResponse
-> Maybe Text -> DeleteProfileKeyResponse)
-> Lens
DeleteProfileKeyResponse
DeleteProfileKeyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKeyResponse' {Maybe Text
message :: Maybe Text
$sel:message:DeleteProfileKeyResponse' :: DeleteProfileKeyResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: DeleteProfileKeyResponse
s@DeleteProfileKeyResponse' {} Maybe Text
a -> DeleteProfileKeyResponse
s {$sel:message:DeleteProfileKeyResponse' :: Maybe Text
message = Maybe Text
a} :: DeleteProfileKeyResponse)
deleteProfileKeyResponse_httpStatus :: Lens.Lens' DeleteProfileKeyResponse Prelude.Int
deleteProfileKeyResponse_httpStatus :: (Int -> f Int)
-> DeleteProfileKeyResponse -> f DeleteProfileKeyResponse
deleteProfileKeyResponse_httpStatus = (DeleteProfileKeyResponse -> Int)
-> (DeleteProfileKeyResponse -> Int -> DeleteProfileKeyResponse)
-> Lens DeleteProfileKeyResponse DeleteProfileKeyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfileKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProfileKeyResponse' :: DeleteProfileKeyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProfileKeyResponse
s@DeleteProfileKeyResponse' {} Int
a -> DeleteProfileKeyResponse
s {$sel:httpStatus:DeleteProfileKeyResponse' :: Int
httpStatus = Int
a} :: DeleteProfileKeyResponse)
instance Prelude.NFData DeleteProfileKeyResponse