{-# 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.CognitoSync.UnsubscribeFromDataset
(
UnsubscribeFromDataset (..),
newUnsubscribeFromDataset,
unsubscribeFromDataset_identityPoolId,
unsubscribeFromDataset_identityId,
unsubscribeFromDataset_datasetName,
unsubscribeFromDataset_deviceId,
UnsubscribeFromDatasetResponse (..),
newUnsubscribeFromDatasetResponse,
unsubscribeFromDatasetResponse_httpStatus,
)
where
import Amazonka.CognitoSync.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 UnsubscribeFromDataset = UnsubscribeFromDataset'
{
UnsubscribeFromDataset -> Text
identityPoolId :: Prelude.Text,
UnsubscribeFromDataset -> Text
identityId :: Prelude.Text,
UnsubscribeFromDataset -> Text
datasetName :: Prelude.Text,
UnsubscribeFromDataset -> Text
deviceId :: Prelude.Text
}
deriving (UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool
(UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool)
-> (UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool)
-> Eq UnsubscribeFromDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool
$c/= :: UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool
== :: UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool
$c== :: UnsubscribeFromDataset -> UnsubscribeFromDataset -> Bool
Prelude.Eq, ReadPrec [UnsubscribeFromDataset]
ReadPrec UnsubscribeFromDataset
Int -> ReadS UnsubscribeFromDataset
ReadS [UnsubscribeFromDataset]
(Int -> ReadS UnsubscribeFromDataset)
-> ReadS [UnsubscribeFromDataset]
-> ReadPrec UnsubscribeFromDataset
-> ReadPrec [UnsubscribeFromDataset]
-> Read UnsubscribeFromDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnsubscribeFromDataset]
$creadListPrec :: ReadPrec [UnsubscribeFromDataset]
readPrec :: ReadPrec UnsubscribeFromDataset
$creadPrec :: ReadPrec UnsubscribeFromDataset
readList :: ReadS [UnsubscribeFromDataset]
$creadList :: ReadS [UnsubscribeFromDataset]
readsPrec :: Int -> ReadS UnsubscribeFromDataset
$creadsPrec :: Int -> ReadS UnsubscribeFromDataset
Prelude.Read, Int -> UnsubscribeFromDataset -> ShowS
[UnsubscribeFromDataset] -> ShowS
UnsubscribeFromDataset -> String
(Int -> UnsubscribeFromDataset -> ShowS)
-> (UnsubscribeFromDataset -> String)
-> ([UnsubscribeFromDataset] -> ShowS)
-> Show UnsubscribeFromDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnsubscribeFromDataset] -> ShowS
$cshowList :: [UnsubscribeFromDataset] -> ShowS
show :: UnsubscribeFromDataset -> String
$cshow :: UnsubscribeFromDataset -> String
showsPrec :: Int -> UnsubscribeFromDataset -> ShowS
$cshowsPrec :: Int -> UnsubscribeFromDataset -> ShowS
Prelude.Show, (forall x. UnsubscribeFromDataset -> Rep UnsubscribeFromDataset x)
-> (forall x.
Rep UnsubscribeFromDataset x -> UnsubscribeFromDataset)
-> Generic UnsubscribeFromDataset
forall x. Rep UnsubscribeFromDataset x -> UnsubscribeFromDataset
forall x. UnsubscribeFromDataset -> Rep UnsubscribeFromDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnsubscribeFromDataset x -> UnsubscribeFromDataset
$cfrom :: forall x. UnsubscribeFromDataset -> Rep UnsubscribeFromDataset x
Prelude.Generic)
newUnsubscribeFromDataset ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UnsubscribeFromDataset
newUnsubscribeFromDataset :: Text -> Text -> Text -> Text -> UnsubscribeFromDataset
newUnsubscribeFromDataset
Text
pIdentityPoolId_
Text
pIdentityId_
Text
pDatasetName_
Text
pDeviceId_ =
UnsubscribeFromDataset' :: Text -> Text -> Text -> Text -> UnsubscribeFromDataset
UnsubscribeFromDataset'
{ $sel:identityPoolId:UnsubscribeFromDataset' :: Text
identityPoolId =
Text
pIdentityPoolId_,
$sel:identityId:UnsubscribeFromDataset' :: Text
identityId = Text
pIdentityId_,
$sel:datasetName:UnsubscribeFromDataset' :: Text
datasetName = Text
pDatasetName_,
$sel:deviceId:UnsubscribeFromDataset' :: Text
deviceId = Text
pDeviceId_
}
unsubscribeFromDataset_identityPoolId :: Lens.Lens' UnsubscribeFromDataset Prelude.Text
unsubscribeFromDataset_identityPoolId :: (Text -> f Text)
-> UnsubscribeFromDataset -> f UnsubscribeFromDataset
unsubscribeFromDataset_identityPoolId = (UnsubscribeFromDataset -> Text)
-> (UnsubscribeFromDataset -> Text -> UnsubscribeFromDataset)
-> Lens UnsubscribeFromDataset UnsubscribeFromDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromDataset' {Text
identityPoolId :: Text
$sel:identityPoolId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
identityPoolId} -> Text
identityPoolId) (\s :: UnsubscribeFromDataset
s@UnsubscribeFromDataset' {} Text
a -> UnsubscribeFromDataset
s {$sel:identityPoolId:UnsubscribeFromDataset' :: Text
identityPoolId = Text
a} :: UnsubscribeFromDataset)
unsubscribeFromDataset_identityId :: Lens.Lens' UnsubscribeFromDataset Prelude.Text
unsubscribeFromDataset_identityId :: (Text -> f Text)
-> UnsubscribeFromDataset -> f UnsubscribeFromDataset
unsubscribeFromDataset_identityId = (UnsubscribeFromDataset -> Text)
-> (UnsubscribeFromDataset -> Text -> UnsubscribeFromDataset)
-> Lens UnsubscribeFromDataset UnsubscribeFromDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromDataset' {Text
identityId :: Text
$sel:identityId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
identityId} -> Text
identityId) (\s :: UnsubscribeFromDataset
s@UnsubscribeFromDataset' {} Text
a -> UnsubscribeFromDataset
s {$sel:identityId:UnsubscribeFromDataset' :: Text
identityId = Text
a} :: UnsubscribeFromDataset)
unsubscribeFromDataset_datasetName :: Lens.Lens' UnsubscribeFromDataset Prelude.Text
unsubscribeFromDataset_datasetName :: (Text -> f Text)
-> UnsubscribeFromDataset -> f UnsubscribeFromDataset
unsubscribeFromDataset_datasetName = (UnsubscribeFromDataset -> Text)
-> (UnsubscribeFromDataset -> Text -> UnsubscribeFromDataset)
-> Lens UnsubscribeFromDataset UnsubscribeFromDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromDataset' {Text
datasetName :: Text
$sel:datasetName:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
datasetName} -> Text
datasetName) (\s :: UnsubscribeFromDataset
s@UnsubscribeFromDataset' {} Text
a -> UnsubscribeFromDataset
s {$sel:datasetName:UnsubscribeFromDataset' :: Text
datasetName = Text
a} :: UnsubscribeFromDataset)
unsubscribeFromDataset_deviceId :: Lens.Lens' UnsubscribeFromDataset Prelude.Text
unsubscribeFromDataset_deviceId :: (Text -> f Text)
-> UnsubscribeFromDataset -> f UnsubscribeFromDataset
unsubscribeFromDataset_deviceId = (UnsubscribeFromDataset -> Text)
-> (UnsubscribeFromDataset -> Text -> UnsubscribeFromDataset)
-> Lens UnsubscribeFromDataset UnsubscribeFromDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromDataset' {Text
deviceId :: Text
$sel:deviceId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
deviceId} -> Text
deviceId) (\s :: UnsubscribeFromDataset
s@UnsubscribeFromDataset' {} Text
a -> UnsubscribeFromDataset
s {$sel:deviceId:UnsubscribeFromDataset' :: Text
deviceId = Text
a} :: UnsubscribeFromDataset)
instance Core.AWSRequest UnsubscribeFromDataset where
type
AWSResponse UnsubscribeFromDataset =
UnsubscribeFromDatasetResponse
request :: UnsubscribeFromDataset -> Request UnsubscribeFromDataset
request = Service -> UnsubscribeFromDataset -> Request UnsubscribeFromDataset
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy UnsubscribeFromDataset
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnsubscribeFromDataset)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UnsubscribeFromDataset))
-> Logger
-> Service
-> Proxy UnsubscribeFromDataset
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnsubscribeFromDataset)))
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 -> UnsubscribeFromDatasetResponse
UnsubscribeFromDatasetResponse'
(Int -> UnsubscribeFromDatasetResponse)
-> Either String Int
-> Either String UnsubscribeFromDatasetResponse
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 UnsubscribeFromDataset
instance Prelude.NFData UnsubscribeFromDataset
instance Core.ToHeaders UnsubscribeFromDataset where
toHeaders :: UnsubscribeFromDataset -> ResponseHeaders
toHeaders =
ResponseHeaders -> UnsubscribeFromDataset -> 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.ToPath UnsubscribeFromDataset where
toPath :: UnsubscribeFromDataset -> ByteString
toPath UnsubscribeFromDataset' {Text
deviceId :: Text
datasetName :: Text
identityId :: Text
identityPoolId :: Text
$sel:deviceId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
$sel:datasetName:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
$sel:identityId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
$sel:identityPoolId:UnsubscribeFromDataset' :: UnsubscribeFromDataset -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/identitypools/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
identityPoolId,
ByteString
"/identities/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
identityId,
ByteString
"/datasets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
datasetName,
ByteString
"/subscriptions/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceId
]
instance Core.ToQuery UnsubscribeFromDataset where
toQuery :: UnsubscribeFromDataset -> QueryString
toQuery = QueryString -> UnsubscribeFromDataset -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UnsubscribeFromDatasetResponse = UnsubscribeFromDatasetResponse'
{
UnsubscribeFromDatasetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool
(UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool)
-> (UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool)
-> Eq UnsubscribeFromDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool
$c/= :: UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool
== :: UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool
$c== :: UnsubscribeFromDatasetResponse
-> UnsubscribeFromDatasetResponse -> Bool
Prelude.Eq, ReadPrec [UnsubscribeFromDatasetResponse]
ReadPrec UnsubscribeFromDatasetResponse
Int -> ReadS UnsubscribeFromDatasetResponse
ReadS [UnsubscribeFromDatasetResponse]
(Int -> ReadS UnsubscribeFromDatasetResponse)
-> ReadS [UnsubscribeFromDatasetResponse]
-> ReadPrec UnsubscribeFromDatasetResponse
-> ReadPrec [UnsubscribeFromDatasetResponse]
-> Read UnsubscribeFromDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnsubscribeFromDatasetResponse]
$creadListPrec :: ReadPrec [UnsubscribeFromDatasetResponse]
readPrec :: ReadPrec UnsubscribeFromDatasetResponse
$creadPrec :: ReadPrec UnsubscribeFromDatasetResponse
readList :: ReadS [UnsubscribeFromDatasetResponse]
$creadList :: ReadS [UnsubscribeFromDatasetResponse]
readsPrec :: Int -> ReadS UnsubscribeFromDatasetResponse
$creadsPrec :: Int -> ReadS UnsubscribeFromDatasetResponse
Prelude.Read, Int -> UnsubscribeFromDatasetResponse -> ShowS
[UnsubscribeFromDatasetResponse] -> ShowS
UnsubscribeFromDatasetResponse -> String
(Int -> UnsubscribeFromDatasetResponse -> ShowS)
-> (UnsubscribeFromDatasetResponse -> String)
-> ([UnsubscribeFromDatasetResponse] -> ShowS)
-> Show UnsubscribeFromDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnsubscribeFromDatasetResponse] -> ShowS
$cshowList :: [UnsubscribeFromDatasetResponse] -> ShowS
show :: UnsubscribeFromDatasetResponse -> String
$cshow :: UnsubscribeFromDatasetResponse -> String
showsPrec :: Int -> UnsubscribeFromDatasetResponse -> ShowS
$cshowsPrec :: Int -> UnsubscribeFromDatasetResponse -> ShowS
Prelude.Show, (forall x.
UnsubscribeFromDatasetResponse
-> Rep UnsubscribeFromDatasetResponse x)
-> (forall x.
Rep UnsubscribeFromDatasetResponse x
-> UnsubscribeFromDatasetResponse)
-> Generic UnsubscribeFromDatasetResponse
forall x.
Rep UnsubscribeFromDatasetResponse x
-> UnsubscribeFromDatasetResponse
forall x.
UnsubscribeFromDatasetResponse
-> Rep UnsubscribeFromDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnsubscribeFromDatasetResponse x
-> UnsubscribeFromDatasetResponse
$cfrom :: forall x.
UnsubscribeFromDatasetResponse
-> Rep UnsubscribeFromDatasetResponse x
Prelude.Generic)
newUnsubscribeFromDatasetResponse ::
Prelude.Int ->
UnsubscribeFromDatasetResponse
newUnsubscribeFromDatasetResponse :: Int -> UnsubscribeFromDatasetResponse
newUnsubscribeFromDatasetResponse Int
pHttpStatus_ =
UnsubscribeFromDatasetResponse' :: Int -> UnsubscribeFromDatasetResponse
UnsubscribeFromDatasetResponse'
{ $sel:httpStatus:UnsubscribeFromDatasetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
unsubscribeFromDatasetResponse_httpStatus :: Lens.Lens' UnsubscribeFromDatasetResponse Prelude.Int
unsubscribeFromDatasetResponse_httpStatus :: (Int -> f Int)
-> UnsubscribeFromDatasetResponse
-> f UnsubscribeFromDatasetResponse
unsubscribeFromDatasetResponse_httpStatus = (UnsubscribeFromDatasetResponse -> Int)
-> (UnsubscribeFromDatasetResponse
-> Int -> UnsubscribeFromDatasetResponse)
-> Lens
UnsubscribeFromDatasetResponse
UnsubscribeFromDatasetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromDatasetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UnsubscribeFromDatasetResponse' :: UnsubscribeFromDatasetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UnsubscribeFromDatasetResponse
s@UnsubscribeFromDatasetResponse' {} Int
a -> UnsubscribeFromDatasetResponse
s {$sel:httpStatus:UnsubscribeFromDatasetResponse' :: Int
httpStatus = Int
a} :: UnsubscribeFromDatasetResponse)
instance
Prelude.NFData
UnsubscribeFromDatasetResponse