{-# 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.Lens as Lens
import Amazonka.Pinpoint.Types.DefinitionFormat
import qualified Amazonka.Prelude as Prelude
data ImportJobRequest = ImportJobRequest'
{
ImportJobRequest -> Maybe Text
segmentName :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> Maybe Bool
defineSegment :: Prelude.Maybe Prelude.Bool,
ImportJobRequest -> Maybe Bool
registerEndpoints :: Prelude.Maybe Prelude.Bool,
ImportJobRequest -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
ImportJobRequest -> DefinitionFormat
format :: DefinitionFormat,
ImportJobRequest -> Text
s3Url :: Prelude.Text,
ImportJobRequest -> Text
roleArn :: Prelude.Text
}
deriving (ImportJobRequest -> ImportJobRequest -> Bool
(ImportJobRequest -> ImportJobRequest -> Bool)
-> (ImportJobRequest -> ImportJobRequest -> Bool)
-> Eq ImportJobRequest
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]
(Int -> ReadS ImportJobRequest)
-> ReadS [ImportJobRequest]
-> ReadPrec ImportJobRequest
-> ReadPrec [ImportJobRequest]
-> Read 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
(Int -> ImportJobRequest -> ShowS)
-> (ImportJobRequest -> String)
-> ([ImportJobRequest] -> ShowS)
-> Show ImportJobRequest
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. ImportJobRequest -> Rep ImportJobRequest x)
-> (forall x. Rep ImportJobRequest x -> ImportJobRequest)
-> Generic ImportJobRequest
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' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobRequest
ImportJobRequest'
{ $sel:segmentName:ImportJobRequest' :: Maybe Text
segmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defineSegment:ImportJobRequest' :: Maybe Bool
defineSegment = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:registerEndpoints:ImportJobRequest' :: Maybe Bool
registerEndpoints = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:externalId:ImportJobRequest' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:segmentId:ImportJobRequest' :: Maybe Text
segmentId = Maybe Text
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_segmentName :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_segmentName :: (Maybe Text -> f (Maybe Text))
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_segmentName = (ImportJobRequest -> Maybe Text)
-> (ImportJobRequest -> Maybe Text -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest (Maybe Text) (Maybe Text)
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_defineSegment :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Bool)
importJobRequest_defineSegment :: (Maybe Bool -> f (Maybe Bool))
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_defineSegment = (ImportJobRequest -> Maybe Bool)
-> (ImportJobRequest -> Maybe Bool -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest (Maybe Bool) (Maybe Bool)
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_registerEndpoints :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Bool)
importJobRequest_registerEndpoints :: (Maybe Bool -> f (Maybe Bool))
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_registerEndpoints = (ImportJobRequest -> Maybe Bool)
-> (ImportJobRequest -> Maybe Bool -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest (Maybe Bool) (Maybe Bool)
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_externalId :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_externalId :: (Maybe Text -> f (Maybe Text))
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_externalId = (ImportJobRequest -> Maybe Text)
-> (ImportJobRequest -> Maybe Text -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest (Maybe Text) (Maybe Text)
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_segmentId :: Lens.Lens' ImportJobRequest (Prelude.Maybe Prelude.Text)
importJobRequest_segmentId :: (Maybe Text -> f (Maybe Text))
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_segmentId = (ImportJobRequest -> Maybe Text)
-> (ImportJobRequest -> Maybe Text -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest (Maybe Text) (Maybe Text)
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_format :: Lens.Lens' ImportJobRequest DefinitionFormat
importJobRequest_format :: (DefinitionFormat -> f DefinitionFormat)
-> ImportJobRequest -> f ImportJobRequest
importJobRequest_format = (ImportJobRequest -> DefinitionFormat)
-> (ImportJobRequest -> DefinitionFormat -> ImportJobRequest)
-> Lens
ImportJobRequest ImportJobRequest DefinitionFormat DefinitionFormat
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 :: (Text -> f Text) -> ImportJobRequest -> f ImportJobRequest
importJobRequest_s3Url = (ImportJobRequest -> Text)
-> (ImportJobRequest -> Text -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest Text Text
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 :: (Text -> f Text) -> ImportJobRequest -> f ImportJobRequest
importJobRequest_roleArn = (ImportJobRequest -> Text)
-> (ImportJobRequest -> Text -> ImportJobRequest)
-> Lens ImportJobRequest ImportJobRequest Text Text
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
instance Prelude.NFData ImportJobRequest
instance Core.ToJSON ImportJobRequest where
toJSON :: ImportJobRequest -> Value
toJSON ImportJobRequest' {Maybe Bool
Maybe Text
Text
DefinitionFormat
roleArn :: Text
s3Url :: Text
format :: DefinitionFormat
segmentId :: Maybe Text
externalId :: Maybe Text
registerEndpoints :: Maybe Bool
defineSegment :: Maybe Bool
segmentName :: Maybe Text
$sel:roleArn:ImportJobRequest' :: ImportJobRequest -> Text
$sel:s3Url:ImportJobRequest' :: ImportJobRequest -> Text
$sel:format:ImportJobRequest' :: ImportJobRequest -> DefinitionFormat
$sel:segmentId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:externalId:ImportJobRequest' :: ImportJobRequest -> Maybe Text
$sel:registerEndpoints:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
$sel:defineSegment:ImportJobRequest' :: ImportJobRequest -> Maybe Bool
$sel:segmentName:ImportJobRequest' :: ImportJobRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SegmentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
segmentName,
(Text
"DefineSegment" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
defineSegment,
(Text
"RegisterEndpoints" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
registerEndpoints,
(Text
"ExternalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
externalId,
(Text
"SegmentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
segmentId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Format" Text -> DefinitionFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DefinitionFormat
format),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Url),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
]
)