{-# 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.FraudDetector.CreateBatchImportJob
(
CreateBatchImportJob (..),
newCreateBatchImportJob,
createBatchImportJob_tags,
createBatchImportJob_jobId,
createBatchImportJob_inputPath,
createBatchImportJob_outputPath,
createBatchImportJob_eventTypeName,
createBatchImportJob_iamRoleArn,
CreateBatchImportJobResponse (..),
newCreateBatchImportJobResponse,
createBatchImportJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateBatchImportJob = CreateBatchImportJob'
{
CreateBatchImportJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateBatchImportJob -> Text
jobId :: Prelude.Text,
CreateBatchImportJob -> Text
inputPath :: Prelude.Text,
CreateBatchImportJob -> Text
outputPath :: Prelude.Text,
CreateBatchImportJob -> Text
eventTypeName :: Prelude.Text,
CreateBatchImportJob -> Text
iamRoleArn :: Prelude.Text
}
deriving (CreateBatchImportJob -> CreateBatchImportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBatchImportJob -> CreateBatchImportJob -> Bool
$c/= :: CreateBatchImportJob -> CreateBatchImportJob -> Bool
== :: CreateBatchImportJob -> CreateBatchImportJob -> Bool
$c== :: CreateBatchImportJob -> CreateBatchImportJob -> Bool
Prelude.Eq, ReadPrec [CreateBatchImportJob]
ReadPrec CreateBatchImportJob
Int -> ReadS CreateBatchImportJob
ReadS [CreateBatchImportJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBatchImportJob]
$creadListPrec :: ReadPrec [CreateBatchImportJob]
readPrec :: ReadPrec CreateBatchImportJob
$creadPrec :: ReadPrec CreateBatchImportJob
readList :: ReadS [CreateBatchImportJob]
$creadList :: ReadS [CreateBatchImportJob]
readsPrec :: Int -> ReadS CreateBatchImportJob
$creadsPrec :: Int -> ReadS CreateBatchImportJob
Prelude.Read, Int -> CreateBatchImportJob -> ShowS
[CreateBatchImportJob] -> ShowS
CreateBatchImportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBatchImportJob] -> ShowS
$cshowList :: [CreateBatchImportJob] -> ShowS
show :: CreateBatchImportJob -> String
$cshow :: CreateBatchImportJob -> String
showsPrec :: Int -> CreateBatchImportJob -> ShowS
$cshowsPrec :: Int -> CreateBatchImportJob -> ShowS
Prelude.Show, forall x. Rep CreateBatchImportJob x -> CreateBatchImportJob
forall x. CreateBatchImportJob -> Rep CreateBatchImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBatchImportJob x -> CreateBatchImportJob
$cfrom :: forall x. CreateBatchImportJob -> Rep CreateBatchImportJob x
Prelude.Generic)
newCreateBatchImportJob ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateBatchImportJob
newCreateBatchImportJob :: Text -> Text -> Text -> Text -> Text -> CreateBatchImportJob
newCreateBatchImportJob
Text
pJobId_
Text
pInputPath_
Text
pOutputPath_
Text
pEventTypeName_
Text
pIamRoleArn_ =
CreateBatchImportJob'
{ $sel:tags:CreateBatchImportJob' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:jobId:CreateBatchImportJob' :: Text
jobId = Text
pJobId_,
$sel:inputPath:CreateBatchImportJob' :: Text
inputPath = Text
pInputPath_,
$sel:outputPath:CreateBatchImportJob' :: Text
outputPath = Text
pOutputPath_,
$sel:eventTypeName:CreateBatchImportJob' :: Text
eventTypeName = Text
pEventTypeName_,
$sel:iamRoleArn:CreateBatchImportJob' :: Text
iamRoleArn = Text
pIamRoleArn_
}
createBatchImportJob_tags :: Lens.Lens' CreateBatchImportJob (Prelude.Maybe [Tag])
createBatchImportJob_tags :: Lens' CreateBatchImportJob (Maybe [Tag])
createBatchImportJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateBatchImportJob' :: CreateBatchImportJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Maybe [Tag]
a -> CreateBatchImportJob
s {$sel:tags:CreateBatchImportJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateBatchImportJob) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createBatchImportJob_jobId :: Lens.Lens' CreateBatchImportJob Prelude.Text
createBatchImportJob_jobId :: Lens' CreateBatchImportJob Text
createBatchImportJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Text
jobId :: Text
$sel:jobId:CreateBatchImportJob' :: CreateBatchImportJob -> Text
jobId} -> Text
jobId) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Text
a -> CreateBatchImportJob
s {$sel:jobId:CreateBatchImportJob' :: Text
jobId = Text
a} :: CreateBatchImportJob)
createBatchImportJob_inputPath :: Lens.Lens' CreateBatchImportJob Prelude.Text
createBatchImportJob_inputPath :: Lens' CreateBatchImportJob Text
createBatchImportJob_inputPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Text
inputPath :: Text
$sel:inputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
inputPath} -> Text
inputPath) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Text
a -> CreateBatchImportJob
s {$sel:inputPath:CreateBatchImportJob' :: Text
inputPath = Text
a} :: CreateBatchImportJob)
createBatchImportJob_outputPath :: Lens.Lens' CreateBatchImportJob Prelude.Text
createBatchImportJob_outputPath :: Lens' CreateBatchImportJob Text
createBatchImportJob_outputPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Text
outputPath :: Text
$sel:outputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
outputPath} -> Text
outputPath) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Text
a -> CreateBatchImportJob
s {$sel:outputPath:CreateBatchImportJob' :: Text
outputPath = Text
a} :: CreateBatchImportJob)
createBatchImportJob_eventTypeName :: Lens.Lens' CreateBatchImportJob Prelude.Text
createBatchImportJob_eventTypeName :: Lens' CreateBatchImportJob Text
createBatchImportJob_eventTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Text
eventTypeName :: Text
$sel:eventTypeName:CreateBatchImportJob' :: CreateBatchImportJob -> Text
eventTypeName} -> Text
eventTypeName) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Text
a -> CreateBatchImportJob
s {$sel:eventTypeName:CreateBatchImportJob' :: Text
eventTypeName = Text
a} :: CreateBatchImportJob)
createBatchImportJob_iamRoleArn :: Lens.Lens' CreateBatchImportJob Prelude.Text
createBatchImportJob_iamRoleArn :: Lens' CreateBatchImportJob Text
createBatchImportJob_iamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJob' {Text
iamRoleArn :: Text
$sel:iamRoleArn:CreateBatchImportJob' :: CreateBatchImportJob -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: CreateBatchImportJob
s@CreateBatchImportJob' {} Text
a -> CreateBatchImportJob
s {$sel:iamRoleArn:CreateBatchImportJob' :: Text
iamRoleArn = Text
a} :: CreateBatchImportJob)
instance Core.AWSRequest CreateBatchImportJob where
type
AWSResponse CreateBatchImportJob =
CreateBatchImportJobResponse
request :: (Service -> Service)
-> CreateBatchImportJob -> Request CreateBatchImportJob
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 CreateBatchImportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateBatchImportJob)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CreateBatchImportJobResponse
CreateBatchImportJobResponse'
forall (f :: * -> *) a b. Functor 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 CreateBatchImportJob where
hashWithSalt :: Int -> CreateBatchImportJob -> Int
hashWithSalt Int
_salt CreateBatchImportJob' {Maybe [Tag]
Text
iamRoleArn :: Text
eventTypeName :: Text
outputPath :: Text
inputPath :: Text
jobId :: Text
tags :: Maybe [Tag]
$sel:iamRoleArn:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:eventTypeName:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:outputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:inputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:jobId:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:tags:CreateBatchImportJob' :: CreateBatchImportJob -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
inputPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
outputPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
eventTypeName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
iamRoleArn
instance Prelude.NFData CreateBatchImportJob where
rnf :: CreateBatchImportJob -> ()
rnf CreateBatchImportJob' {Maybe [Tag]
Text
iamRoleArn :: Text
eventTypeName :: Text
outputPath :: Text
inputPath :: Text
jobId :: Text
tags :: Maybe [Tag]
$sel:iamRoleArn:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:eventTypeName:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:outputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:inputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:jobId:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:tags:CreateBatchImportJob' :: CreateBatchImportJob -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
inputPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
outputPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
eventTypeName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
iamRoleArn
instance Data.ToHeaders CreateBatchImportJob where
toHeaders :: CreateBatchImportJob -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSHawksNestServiceFacade.CreateBatchImportJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateBatchImportJob where
toJSON :: CreateBatchImportJob -> Value
toJSON CreateBatchImportJob' {Maybe [Tag]
Text
iamRoleArn :: Text
eventTypeName :: Text
outputPath :: Text
inputPath :: Text
jobId :: Text
tags :: Maybe [Tag]
$sel:iamRoleArn:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:eventTypeName:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:outputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:inputPath:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:jobId:CreateBatchImportJob' :: CreateBatchImportJob -> Text
$sel:tags:CreateBatchImportJob' :: CreateBatchImportJob -> Maybe [Tag]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
forall a. a -> Maybe a
Prelude.Just (Key
"jobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId),
forall a. a -> Maybe a
Prelude.Just (Key
"inputPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
inputPath),
forall a. a -> Maybe a
Prelude.Just (Key
"outputPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
outputPath),
forall a. a -> Maybe a
Prelude.Just (Key
"eventTypeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
eventTypeName),
forall a. a -> Maybe a
Prelude.Just (Key
"iamRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
iamRoleArn)
]
)
instance Data.ToPath CreateBatchImportJob where
toPath :: CreateBatchImportJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateBatchImportJob where
toQuery :: CreateBatchImportJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateBatchImportJobResponse = CreateBatchImportJobResponse'
{
CreateBatchImportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateBatchImportJobResponse
-> CreateBatchImportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBatchImportJobResponse
-> CreateBatchImportJobResponse -> Bool
$c/= :: CreateBatchImportJobResponse
-> CreateBatchImportJobResponse -> Bool
== :: CreateBatchImportJobResponse
-> CreateBatchImportJobResponse -> Bool
$c== :: CreateBatchImportJobResponse
-> CreateBatchImportJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateBatchImportJobResponse]
ReadPrec CreateBatchImportJobResponse
Int -> ReadS CreateBatchImportJobResponse
ReadS [CreateBatchImportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBatchImportJobResponse]
$creadListPrec :: ReadPrec [CreateBatchImportJobResponse]
readPrec :: ReadPrec CreateBatchImportJobResponse
$creadPrec :: ReadPrec CreateBatchImportJobResponse
readList :: ReadS [CreateBatchImportJobResponse]
$creadList :: ReadS [CreateBatchImportJobResponse]
readsPrec :: Int -> ReadS CreateBatchImportJobResponse
$creadsPrec :: Int -> ReadS CreateBatchImportJobResponse
Prelude.Read, Int -> CreateBatchImportJobResponse -> ShowS
[CreateBatchImportJobResponse] -> ShowS
CreateBatchImportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBatchImportJobResponse] -> ShowS
$cshowList :: [CreateBatchImportJobResponse] -> ShowS
show :: CreateBatchImportJobResponse -> String
$cshow :: CreateBatchImportJobResponse -> String
showsPrec :: Int -> CreateBatchImportJobResponse -> ShowS
$cshowsPrec :: Int -> CreateBatchImportJobResponse -> ShowS
Prelude.Show, forall x.
Rep CreateBatchImportJobResponse x -> CreateBatchImportJobResponse
forall x.
CreateBatchImportJobResponse -> Rep CreateBatchImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBatchImportJobResponse x -> CreateBatchImportJobResponse
$cfrom :: forall x.
CreateBatchImportJobResponse -> Rep CreateBatchImportJobResponse x
Prelude.Generic)
newCreateBatchImportJobResponse ::
Prelude.Int ->
CreateBatchImportJobResponse
newCreateBatchImportJobResponse :: Int -> CreateBatchImportJobResponse
newCreateBatchImportJobResponse Int
pHttpStatus_ =
CreateBatchImportJobResponse'
{ $sel:httpStatus:CreateBatchImportJobResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createBatchImportJobResponse_httpStatus :: Lens.Lens' CreateBatchImportJobResponse Prelude.Int
createBatchImportJobResponse_httpStatus :: Lens' CreateBatchImportJobResponse Int
createBatchImportJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateBatchImportJobResponse' :: CreateBatchImportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateBatchImportJobResponse
s@CreateBatchImportJobResponse' {} Int
a -> CreateBatchImportJobResponse
s {$sel:httpStatus:CreateBatchImportJobResponse' :: Int
httpStatus = Int
a} :: CreateBatchImportJobResponse)
instance Prelude.NFData CreateBatchImportJobResponse where
rnf :: CreateBatchImportJobResponse -> ()
rnf CreateBatchImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateBatchImportJobResponse' :: CreateBatchImportJobResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus