{-# 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.CognitoIdentityProvider.StopUserImportJob
(
StopUserImportJob (..),
newStopUserImportJob,
stopUserImportJob_userPoolId,
stopUserImportJob_jobId,
StopUserImportJobResponse (..),
newStopUserImportJobResponse,
stopUserImportJobResponse_userImportJob,
stopUserImportJobResponse_httpStatus,
)
where
import Amazonka.CognitoIdentityProvider.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 StopUserImportJob = StopUserImportJob'
{
StopUserImportJob -> Text
userPoolId :: Prelude.Text,
StopUserImportJob -> Text
jobId :: Prelude.Text
}
deriving (StopUserImportJob -> StopUserImportJob -> Bool
(StopUserImportJob -> StopUserImportJob -> Bool)
-> (StopUserImportJob -> StopUserImportJob -> Bool)
-> Eq StopUserImportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopUserImportJob -> StopUserImportJob -> Bool
$c/= :: StopUserImportJob -> StopUserImportJob -> Bool
== :: StopUserImportJob -> StopUserImportJob -> Bool
$c== :: StopUserImportJob -> StopUserImportJob -> Bool
Prelude.Eq, ReadPrec [StopUserImportJob]
ReadPrec StopUserImportJob
Int -> ReadS StopUserImportJob
ReadS [StopUserImportJob]
(Int -> ReadS StopUserImportJob)
-> ReadS [StopUserImportJob]
-> ReadPrec StopUserImportJob
-> ReadPrec [StopUserImportJob]
-> Read StopUserImportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopUserImportJob]
$creadListPrec :: ReadPrec [StopUserImportJob]
readPrec :: ReadPrec StopUserImportJob
$creadPrec :: ReadPrec StopUserImportJob
readList :: ReadS [StopUserImportJob]
$creadList :: ReadS [StopUserImportJob]
readsPrec :: Int -> ReadS StopUserImportJob
$creadsPrec :: Int -> ReadS StopUserImportJob
Prelude.Read, Int -> StopUserImportJob -> ShowS
[StopUserImportJob] -> ShowS
StopUserImportJob -> String
(Int -> StopUserImportJob -> ShowS)
-> (StopUserImportJob -> String)
-> ([StopUserImportJob] -> ShowS)
-> Show StopUserImportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopUserImportJob] -> ShowS
$cshowList :: [StopUserImportJob] -> ShowS
show :: StopUserImportJob -> String
$cshow :: StopUserImportJob -> String
showsPrec :: Int -> StopUserImportJob -> ShowS
$cshowsPrec :: Int -> StopUserImportJob -> ShowS
Prelude.Show, (forall x. StopUserImportJob -> Rep StopUserImportJob x)
-> (forall x. Rep StopUserImportJob x -> StopUserImportJob)
-> Generic StopUserImportJob
forall x. Rep StopUserImportJob x -> StopUserImportJob
forall x. StopUserImportJob -> Rep StopUserImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopUserImportJob x -> StopUserImportJob
$cfrom :: forall x. StopUserImportJob -> Rep StopUserImportJob x
Prelude.Generic)
newStopUserImportJob ::
Prelude.Text ->
Prelude.Text ->
StopUserImportJob
newStopUserImportJob :: Text -> Text -> StopUserImportJob
newStopUserImportJob Text
pUserPoolId_ Text
pJobId_ =
StopUserImportJob' :: Text -> Text -> StopUserImportJob
StopUserImportJob'
{ $sel:userPoolId:StopUserImportJob' :: Text
userPoolId = Text
pUserPoolId_,
$sel:jobId:StopUserImportJob' :: Text
jobId = Text
pJobId_
}
stopUserImportJob_userPoolId :: Lens.Lens' StopUserImportJob Prelude.Text
stopUserImportJob_userPoolId :: (Text -> f Text) -> StopUserImportJob -> f StopUserImportJob
stopUserImportJob_userPoolId = (StopUserImportJob -> Text)
-> (StopUserImportJob -> Text -> StopUserImportJob)
-> Lens StopUserImportJob StopUserImportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopUserImportJob' {Text
userPoolId :: Text
$sel:userPoolId:StopUserImportJob' :: StopUserImportJob -> Text
userPoolId} -> Text
userPoolId) (\s :: StopUserImportJob
s@StopUserImportJob' {} Text
a -> StopUserImportJob
s {$sel:userPoolId:StopUserImportJob' :: Text
userPoolId = Text
a} :: StopUserImportJob)
stopUserImportJob_jobId :: Lens.Lens' StopUserImportJob Prelude.Text
stopUserImportJob_jobId :: (Text -> f Text) -> StopUserImportJob -> f StopUserImportJob
stopUserImportJob_jobId = (StopUserImportJob -> Text)
-> (StopUserImportJob -> Text -> StopUserImportJob)
-> Lens StopUserImportJob StopUserImportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopUserImportJob' {Text
jobId :: Text
$sel:jobId:StopUserImportJob' :: StopUserImportJob -> Text
jobId} -> Text
jobId) (\s :: StopUserImportJob
s@StopUserImportJob' {} Text
a -> StopUserImportJob
s {$sel:jobId:StopUserImportJob' :: Text
jobId = Text
a} :: StopUserImportJob)
instance Core.AWSRequest StopUserImportJob where
type
AWSResponse StopUserImportJob =
StopUserImportJobResponse
request :: StopUserImportJob -> Request StopUserImportJob
request = Service -> StopUserImportJob -> Request StopUserImportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopUserImportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopUserImportJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopUserImportJob))
-> Logger
-> Service
-> Proxy StopUserImportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopUserImportJob)))
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 UserImportJobType -> Int -> StopUserImportJobResponse
StopUserImportJobResponse'
(Maybe UserImportJobType -> Int -> StopUserImportJobResponse)
-> Either String (Maybe UserImportJobType)
-> Either String (Int -> StopUserImportJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe UserImportJobType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserImportJob")
Either String (Int -> StopUserImportJobResponse)
-> Either String Int -> Either String StopUserImportJobResponse
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 StopUserImportJob
instance Prelude.NFData StopUserImportJob
instance Core.ToHeaders StopUserImportJob where
toHeaders :: StopUserImportJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopUserImportJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.StopUserImportJob" ::
Prelude.ByteString
),
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 StopUserImportJob where
toJSON :: StopUserImportJob -> Value
toJSON StopUserImportJob' {Text
jobId :: Text
userPoolId :: Text
$sel:jobId:StopUserImportJob' :: StopUserImportJob -> Text
$sel:userPoolId:StopUserImportJob' :: StopUserImportJob -> 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
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)
]
)
instance Core.ToPath StopUserImportJob where
toPath :: StopUserImportJob -> ByteString
toPath = ByteString -> StopUserImportJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopUserImportJob where
toQuery :: StopUserImportJob -> QueryString
toQuery = QueryString -> StopUserImportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopUserImportJobResponse = StopUserImportJobResponse'
{
StopUserImportJobResponse -> Maybe UserImportJobType
userImportJob :: Prelude.Maybe UserImportJobType,
StopUserImportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopUserImportJobResponse -> StopUserImportJobResponse -> Bool
(StopUserImportJobResponse -> StopUserImportJobResponse -> Bool)
-> (StopUserImportJobResponse -> StopUserImportJobResponse -> Bool)
-> Eq StopUserImportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopUserImportJobResponse -> StopUserImportJobResponse -> Bool
$c/= :: StopUserImportJobResponse -> StopUserImportJobResponse -> Bool
== :: StopUserImportJobResponse -> StopUserImportJobResponse -> Bool
$c== :: StopUserImportJobResponse -> StopUserImportJobResponse -> Bool
Prelude.Eq, ReadPrec [StopUserImportJobResponse]
ReadPrec StopUserImportJobResponse
Int -> ReadS StopUserImportJobResponse
ReadS [StopUserImportJobResponse]
(Int -> ReadS StopUserImportJobResponse)
-> ReadS [StopUserImportJobResponse]
-> ReadPrec StopUserImportJobResponse
-> ReadPrec [StopUserImportJobResponse]
-> Read StopUserImportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopUserImportJobResponse]
$creadListPrec :: ReadPrec [StopUserImportJobResponse]
readPrec :: ReadPrec StopUserImportJobResponse
$creadPrec :: ReadPrec StopUserImportJobResponse
readList :: ReadS [StopUserImportJobResponse]
$creadList :: ReadS [StopUserImportJobResponse]
readsPrec :: Int -> ReadS StopUserImportJobResponse
$creadsPrec :: Int -> ReadS StopUserImportJobResponse
Prelude.Read, Int -> StopUserImportJobResponse -> ShowS
[StopUserImportJobResponse] -> ShowS
StopUserImportJobResponse -> String
(Int -> StopUserImportJobResponse -> ShowS)
-> (StopUserImportJobResponse -> String)
-> ([StopUserImportJobResponse] -> ShowS)
-> Show StopUserImportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopUserImportJobResponse] -> ShowS
$cshowList :: [StopUserImportJobResponse] -> ShowS
show :: StopUserImportJobResponse -> String
$cshow :: StopUserImportJobResponse -> String
showsPrec :: Int -> StopUserImportJobResponse -> ShowS
$cshowsPrec :: Int -> StopUserImportJobResponse -> ShowS
Prelude.Show, (forall x.
StopUserImportJobResponse -> Rep StopUserImportJobResponse x)
-> (forall x.
Rep StopUserImportJobResponse x -> StopUserImportJobResponse)
-> Generic StopUserImportJobResponse
forall x.
Rep StopUserImportJobResponse x -> StopUserImportJobResponse
forall x.
StopUserImportJobResponse -> Rep StopUserImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopUserImportJobResponse x -> StopUserImportJobResponse
$cfrom :: forall x.
StopUserImportJobResponse -> Rep StopUserImportJobResponse x
Prelude.Generic)
newStopUserImportJobResponse ::
Prelude.Int ->
StopUserImportJobResponse
newStopUserImportJobResponse :: Int -> StopUserImportJobResponse
newStopUserImportJobResponse Int
pHttpStatus_ =
StopUserImportJobResponse' :: Maybe UserImportJobType -> Int -> StopUserImportJobResponse
StopUserImportJobResponse'
{ $sel:userImportJob:StopUserImportJobResponse' :: Maybe UserImportJobType
userImportJob =
Maybe UserImportJobType
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopUserImportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopUserImportJobResponse_userImportJob :: Lens.Lens' StopUserImportJobResponse (Prelude.Maybe UserImportJobType)
stopUserImportJobResponse_userImportJob :: (Maybe UserImportJobType -> f (Maybe UserImportJobType))
-> StopUserImportJobResponse -> f StopUserImportJobResponse
stopUserImportJobResponse_userImportJob = (StopUserImportJobResponse -> Maybe UserImportJobType)
-> (StopUserImportJobResponse
-> Maybe UserImportJobType -> StopUserImportJobResponse)
-> Lens
StopUserImportJobResponse
StopUserImportJobResponse
(Maybe UserImportJobType)
(Maybe UserImportJobType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopUserImportJobResponse' {Maybe UserImportJobType
userImportJob :: Maybe UserImportJobType
$sel:userImportJob:StopUserImportJobResponse' :: StopUserImportJobResponse -> Maybe UserImportJobType
userImportJob} -> Maybe UserImportJobType
userImportJob) (\s :: StopUserImportJobResponse
s@StopUserImportJobResponse' {} Maybe UserImportJobType
a -> StopUserImportJobResponse
s {$sel:userImportJob:StopUserImportJobResponse' :: Maybe UserImportJobType
userImportJob = Maybe UserImportJobType
a} :: StopUserImportJobResponse)
stopUserImportJobResponse_httpStatus :: Lens.Lens' StopUserImportJobResponse Prelude.Int
stopUserImportJobResponse_httpStatus :: (Int -> f Int)
-> StopUserImportJobResponse -> f StopUserImportJobResponse
stopUserImportJobResponse_httpStatus = (StopUserImportJobResponse -> Int)
-> (StopUserImportJobResponse -> Int -> StopUserImportJobResponse)
-> Lens StopUserImportJobResponse StopUserImportJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopUserImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopUserImportJobResponse' :: StopUserImportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopUserImportJobResponse
s@StopUserImportJobResponse' {} Int
a -> StopUserImportJobResponse
s {$sel:httpStatus:StopUserImportJobResponse' :: Int
httpStatus = Int
a} :: StopUserImportJobResponse)
instance Prelude.NFData StopUserImportJobResponse