{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Pinpoint.Types.ImportJobRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types.DefinitionFormat
import qualified Amazonka.Prelude as Prelude
data ImportJobRequest = ImportJobRequest'
{
ImportJobRequest -> Maybe Bool
defineSegment :: Prelude.Maybe Prelude.Bool,
ImportJobRequest -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> Maybe Bool
registerEndpoints :: Prelude.Maybe Prelude.Bool,
ImportJobRequest -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> Maybe Text
segmentName :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> DefinitionFormat
format :: DefinitionFormat,
ImportJobRequest -> Text
s3Url :: Prelude.Text,
ImportJobRequest -> Text
roleArn :: Prelude.Text
}
deriving (ImportJobRequest -> ImportJobRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportJobRequest -> ImportJobRequest -> Bool
$c/= :: ImportJobRequest -> ImportJobRequest -> Bool
== :: ImportJobRequest -> ImportJobRequest -> Bool
$c== :: ImportJobRequest -> ImportJobRequest -> Bool
Prelude.Eq, ReadPrec [ImportJobRequest]
ReadPrec ImportJobRequest
Int -> ReadS ImportJobRequest
ReadS [ImportJobRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportJobRequest]
$creadListPrec :: ReadPrec [ImportJobRequest]
readPrec :: ReadPrec ImportJobRequest
$creadPrec :: ReadPrec ImportJobRequest
readList :: ReadS [ImportJobRequest]
$creadList :: ReadS [ImportJobRequest]
readsPrec :: Int -> ReadS ImportJobRequest
$creadsPrec :: Int -> ReadS ImportJobRequest
Prelude.Read, Int -> ImportJobRequest -> ShowS
[ImportJobRequest] -> ShowS
ImportJobRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportJobRequest] -> ShowS
$cshowList :: [ImportJobRequest] -> ShowS
show :: ImportJobRequest -> String
$cshow :: ImportJobRequest -> String
showsPrec :: Int -> ImportJobRequest -> ShowS
$cshowsPrec :: Int -> ImportJobRequest -> ShowS
Prelude.Show, forall x. Rep ImportJobRequest x -> ImportJobRequest
forall x. ImportJobRequest -> Rep ImportJobRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportJobRequest x -> ImportJobRequest
$cfrom :: forall x. ImportJobRequest -> Rep ImportJobRequest x
Prelude.Generic)
newImportJobRequest ::
DefinitionFormat ->
Prelude.Text ->
Prelude.Text ->
ImportJobRequest
newImportJobRequest :: DefinitionFormat -> Text -> Text -> ImportJobRequest
newImportJobRequest DefinitionFormat
pFormat_ Text
pS3Url_ Text
pRoleArn_ =
ImportJobRequest'
{ $sel:defineSegment:ImportJobRequest' :: Maybe Bool
defineSegment = forall a. Maybe a
Prelude.Nothing,
$sel:externalId:ImportJobRequest' :: Maybe Text
externalId = forall a. Maybe a
Prelude.Nothing,
$sel:registerEndpoints:ImportJobRequest' :: Maybe Bool
registerEndpoints = forall a. Maybe a
Prelude.Nothing,
$sel:segmentId:ImportJobRequest' :: Maybe Text
segmentId = forall a. Maybe a
Prelude.Nothing,
$sel:segmentName:ImportJobRequest' :: Maybe Text
segmentName = forall a. Maybe a
Prelude.Nothing,
$sel:format:ImportJobRequest' :: DefinitionFormat
format = DefinitionFormat
pFormat_,
$sel:s3Url:ImportJobRequest' :: Text
s3Url = Text
pS3Url_,
$sel:roleArn:ImportJobRequest' :: Text
roleArn = Text
pRoleArn_
}
importJobRequest_defineSegment :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Bool)
importJobRequest_defineSegment :: Lens' ImportJobRequest (Maybe Bool)
importJobRequest_defineSegment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Maybe Bool
defineSegment :: Maybe Bool
$sel:defineSegment:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
defineSegment} -> Maybe Bool
defineSegment) (\s :: ImportJobRequest
s@ImportJobRequest' {} Maybe Bool
a -> ImportJobRequest
s {$sel:defineSegment:ImportJobRequest' :: Maybe Bool
defineSegment = Maybe Bool
a} :: ImportJobRequest)
importJobRequest_externalId :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_externalId :: Lens' ImportJobRequest (Maybe Text)
importJobRequest_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Maybe Text
externalId :: Maybe Text
$sel:externalId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: ImportJobRequest
s@ImportJobRequest' {} Maybe Text
a -> ImportJobRequest
s {$sel:externalId:ImportJobRequest' :: Maybe Text
externalId = Maybe Text
a} :: ImportJobRequest)
importJobRequest_registerEndpoints :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Bool)
importJobRequest_registerEndpoints :: Lens' ImportJobRequest (Maybe Bool)
importJobRequest_registerEndpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Maybe Bool
registerEndpoints :: Maybe Bool
$sel:registerEndpoints:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
registerEndpoints} -> Maybe Bool
registerEndpoints) (\s :: ImportJobRequest
s@ImportJobRequest' {} Maybe Bool
a -> ImportJobRequest
s {$sel:registerEndpoints:ImportJobRequest' :: Maybe Bool
registerEndpoints = Maybe Bool
a} :: ImportJobRequest)
importJobRequest_segmentId :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_segmentId :: Lens' ImportJobRequest (Maybe Text)
importJobRequest_segmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Maybe Text
segmentId :: Maybe Text
$sel:segmentId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
segmentId} -> Maybe Text
segmentId) (\s :: ImportJobRequest
s@ImportJobRequest' {} Maybe Text
a -> ImportJobRequest
s {$sel:segmentId:ImportJobRequest' :: Maybe Text
segmentId = Maybe Text
a} :: ImportJobRequest)
importJobRequest_segmentName :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_segmentName :: Lens' ImportJobRequest (Maybe Text)
importJobRequest_segmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Maybe Text
segmentName :: Maybe Text
$sel:segmentName:ImportJobRequest' :: ImportJobRequest -> Maybe Text
segmentName} -> Maybe Text
segmentName) (\s :: ImportJobRequest
s@ImportJobRequest' {} Maybe Text
a -> ImportJobRequest
s {$sel:segmentName:ImportJobRequest' :: Maybe Text
segmentName = Maybe Text
a} :: ImportJobRequest)
importJobRequest_format :: Lens.Lens' ImportJobRequest DefinitionFormat
importJobRequest_format :: Lens' ImportJobRequest DefinitionFormat
importJobRequest_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {DefinitionFormat
format :: DefinitionFormat
$sel:format:ImportJobRequest' :: ImportJobRequest -> DefinitionFormat
format} -> DefinitionFormat
format) (\s :: ImportJobRequest
s@ImportJobRequest' {} DefinitionFormat
a -> ImportJobRequest
s {$sel:format:ImportJobRequest' :: DefinitionFormat
format = DefinitionFormat
a} :: ImportJobRequest)
importJobRequest_s3Url :: Lens.Lens' ImportJobRequest Prelude.Text
importJobRequest_s3Url :: Lens' ImportJobRequest Text
importJobRequest_s3Url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Text
s3Url :: Text
$sel:s3Url:ImportJobRequest' :: ImportJobRequest -> Text
s3Url} -> Text
s3Url) (\s :: ImportJobRequest
s@ImportJobRequest' {} Text
a -> ImportJobRequest
s {$sel:s3Url:ImportJobRequest' :: Text
s3Url = Text
a} :: ImportJobRequest)
importJobRequest_roleArn :: Lens.Lens' ImportJobRequest Prelude.Text
importJobRequest_roleArn :: Lens' ImportJobRequest Text
importJobRequest_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobRequest' {Text
roleArn :: Text
$sel:roleArn:ImportJobRequest' :: ImportJobRequest -> Text
roleArn} -> Text
roleArn) (\s :: ImportJobRequest
s@ImportJobRequest' {} Text
a -> ImportJobRequest
s {$sel:roleArn:ImportJobRequest' :: Text
roleArn = Text
a} :: ImportJobRequest)
instance Prelude.Hashable ImportJobRequest where
hashWithSalt :: Int -> ImportJobRequest -> Int
hashWithSalt Int
_salt ImportJobRequest' {Maybe Bool
Maybe Text
Text
DefinitionFormat
roleArn :: Text
s3Url :: Text
format :: DefinitionFormat
segmentName :: Maybe Text
segmentId :: Maybe Text
registerEndpoints :: Maybe Bool
externalId :: Maybe Text
defineSegment :: Maybe Bool
$sel:roleArn:ImportJobRequest' :: ImportJobRequest -> Text
$sel:s3Url:ImportJobRequest' :: ImportJobRequest -> Text
$sel:format:ImportJobRequest' :: ImportJobRequest -> DefinitionFormat
$sel:segmentName:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:segmentId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:registerEndpoints:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
$sel:externalId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:defineSegment:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defineSegment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
registerEndpoints
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DefinitionFormat
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Url
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData ImportJobRequest where
rnf :: ImportJobRequest -> ()
rnf ImportJobRequest' {Maybe Bool
Maybe Text
Text
DefinitionFormat
roleArn :: Text
s3Url :: Text
format :: DefinitionFormat
segmentName :: Maybe Text
segmentId :: Maybe Text
registerEndpoints :: Maybe Bool
externalId :: Maybe Text
defineSegment :: Maybe Bool
$sel:roleArn:ImportJobRequest' :: ImportJobRequest -> Text
$sel:s3Url:ImportJobRequest' :: ImportJobRequest -> Text
$sel:format:ImportJobRequest' :: ImportJobRequest -> DefinitionFormat
$sel:segmentName:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:segmentId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:registerEndpoints:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
$sel:externalId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:defineSegment:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defineSegment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
registerEndpoints
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
segmentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
segmentName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DefinitionFormat
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3Url
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance Data.ToJSON ImportJobRequest where
toJSON :: ImportJobRequest -> Value
toJSON ImportJobRequest' {Maybe Bool
Maybe Text
Text
DefinitionFormat
roleArn :: Text
s3Url :: Text
format :: DefinitionFormat
segmentName :: Maybe Text
segmentId :: Maybe Text
registerEndpoints :: Maybe Bool
externalId :: Maybe Text
defineSegment :: Maybe Bool
$sel:roleArn:ImportJobRequest' :: ImportJobRequest -> Text
$sel:s3Url:ImportJobRequest' :: ImportJobRequest -> Text
$sel:format:ImportJobRequest' :: ImportJobRequest -> DefinitionFormat
$sel:segmentName:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:segmentId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:registerEndpoints:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
$sel:externalId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:defineSegment:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DefineSegment" 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 Bool
defineSegment,
(Key
"ExternalId" 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 Text
externalId,
(Key
"RegisterEndpoints" 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 Bool
registerEndpoints,
(Key
"SegmentId" 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 Text
segmentId,
(Key
"SegmentName" 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 Text
segmentName,
forall a. a -> Maybe a
Prelude.Just (Key
"Format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DefinitionFormat
format),
forall a. a -> Maybe a
Prelude.Just (Key
"S3Url" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3Url),
forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
]
)