{-# 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.ImportJobResource 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 ImportJobResource = ImportJobResource'
{
ImportJobResource -> Maybe Text
segmentName :: Prelude.Maybe Prelude.Text,
ImportJobResource -> Maybe Bool
defineSegment :: Prelude.Maybe Prelude.Bool,
ImportJobResource -> Maybe Bool
registerEndpoints :: Prelude.Maybe Prelude.Bool,
ImportJobResource -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
ImportJobResource -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
ImportJobResource -> DefinitionFormat
format :: DefinitionFormat,
ImportJobResource -> Text
s3Url :: Prelude.Text,
ImportJobResource -> Text
roleArn :: Prelude.Text
}
deriving (ImportJobResource -> ImportJobResource -> Bool
(ImportJobResource -> ImportJobResource -> Bool)
-> (ImportJobResource -> ImportJobResource -> Bool)
-> Eq ImportJobResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportJobResource -> ImportJobResource -> Bool
$c/= :: ImportJobResource -> ImportJobResource -> Bool
== :: ImportJobResource -> ImportJobResource -> Bool
$c== :: ImportJobResource -> ImportJobResource -> Bool
Prelude.Eq, ReadPrec [ImportJobResource]
ReadPrec ImportJobResource
Int -> ReadS ImportJobResource
ReadS [ImportJobResource]
(Int -> ReadS ImportJobResource)
-> ReadS [ImportJobResource]
-> ReadPrec ImportJobResource
-> ReadPrec [ImportJobResource]
-> Read ImportJobResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportJobResource]
$creadListPrec :: ReadPrec [ImportJobResource]
readPrec :: ReadPrec ImportJobResource
$creadPrec :: ReadPrec ImportJobResource
readList :: ReadS [ImportJobResource]
$creadList :: ReadS [ImportJobResource]
readsPrec :: Int -> ReadS ImportJobResource
$creadsPrec :: Int -> ReadS ImportJobResource
Prelude.Read, Int -> ImportJobResource -> ShowS
[ImportJobResource] -> ShowS
ImportJobResource -> String
(Int -> ImportJobResource -> ShowS)
-> (ImportJobResource -> String)
-> ([ImportJobResource] -> ShowS)
-> Show ImportJobResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportJobResource] -> ShowS
$cshowList :: [ImportJobResource] -> ShowS
show :: ImportJobResource -> String
$cshow :: ImportJobResource -> String
showsPrec :: Int -> ImportJobResource -> ShowS
$cshowsPrec :: Int -> ImportJobResource -> ShowS
Prelude.Show, (forall x. ImportJobResource -> Rep ImportJobResource x)
-> (forall x. Rep ImportJobResource x -> ImportJobResource)
-> Generic ImportJobResource
forall x. Rep ImportJobResource x -> ImportJobResource
forall x. ImportJobResource -> Rep ImportJobResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportJobResource x -> ImportJobResource
$cfrom :: forall x. ImportJobResource -> Rep ImportJobResource x
Prelude.Generic)
newImportJobResource ::
DefinitionFormat ->
Prelude.Text ->
Prelude.Text ->
ImportJobResource
newImportJobResource :: DefinitionFormat -> Text -> Text -> ImportJobResource
newImportJobResource DefinitionFormat
pFormat_ Text
pS3Url_ Text
pRoleArn_ =
ImportJobResource' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource
ImportJobResource'
{ $sel:segmentName:ImportJobResource' :: Maybe Text
segmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defineSegment:ImportJobResource' :: Maybe Bool
defineSegment = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:registerEndpoints:ImportJobResource' :: Maybe Bool
registerEndpoints = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:externalId:ImportJobResource' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:segmentId:ImportJobResource' :: Maybe Text
segmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:format:ImportJobResource' :: DefinitionFormat
format = DefinitionFormat
pFormat_,
$sel:s3Url:ImportJobResource' :: Text
s3Url = Text
pS3Url_,
$sel:roleArn:ImportJobResource' :: Text
roleArn = Text
pRoleArn_
}
importJobResource_segmentName :: Lens.Lens' ImportJobResource (Prelude.Maybe Prelude.Text)
importJobResource_segmentName :: (Maybe Text -> f (Maybe Text))
-> ImportJobResource -> f ImportJobResource
importJobResource_segmentName = (ImportJobResource -> Maybe Text)
-> (ImportJobResource -> Maybe Text -> ImportJobResource)
-> Lens
ImportJobResource ImportJobResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Maybe Text
segmentName :: Maybe Text
$sel:segmentName:ImportJobResource' :: ImportJobResource -> Maybe Text
segmentName} -> Maybe Text
segmentName) (\s :: ImportJobResource
s@ImportJobResource' {} Maybe Text
a -> ImportJobResource
s {$sel:segmentName:ImportJobResource' :: Maybe Text
segmentName = Maybe Text
a} :: ImportJobResource)
importJobResource_defineSegment :: Lens.Lens' ImportJobResource (Prelude.Maybe Prelude.Bool)
importJobResource_defineSegment :: (Maybe Bool -> f (Maybe Bool))
-> ImportJobResource -> f ImportJobResource
importJobResource_defineSegment = (ImportJobResource -> Maybe Bool)
-> (ImportJobResource -> Maybe Bool -> ImportJobResource)
-> Lens
ImportJobResource ImportJobResource (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Maybe Bool
defineSegment :: Maybe Bool
$sel:defineSegment:ImportJobResource' :: ImportJobResource -> Maybe Bool
defineSegment} -> Maybe Bool
defineSegment) (\s :: ImportJobResource
s@ImportJobResource' {} Maybe Bool
a -> ImportJobResource
s {$sel:defineSegment:ImportJobResource' :: Maybe Bool
defineSegment = Maybe Bool
a} :: ImportJobResource)
importJobResource_registerEndpoints :: Lens.Lens' ImportJobResource (Prelude.Maybe Prelude.Bool)
importJobResource_registerEndpoints :: (Maybe Bool -> f (Maybe Bool))
-> ImportJobResource -> f ImportJobResource
importJobResource_registerEndpoints = (ImportJobResource -> Maybe Bool)
-> (ImportJobResource -> Maybe Bool -> ImportJobResource)
-> Lens
ImportJobResource ImportJobResource (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Maybe Bool
registerEndpoints :: Maybe Bool
$sel:registerEndpoints:ImportJobResource' :: ImportJobResource -> Maybe Bool
registerEndpoints} -> Maybe Bool
registerEndpoints) (\s :: ImportJobResource
s@ImportJobResource' {} Maybe Bool
a -> ImportJobResource
s {$sel:registerEndpoints:ImportJobResource' :: Maybe Bool
registerEndpoints = Maybe Bool
a} :: ImportJobResource)
importJobResource_externalId :: Lens.Lens' ImportJobResource (Prelude.Maybe Prelude.Text)
importJobResource_externalId :: (Maybe Text -> f (Maybe Text))
-> ImportJobResource -> f ImportJobResource
importJobResource_externalId = (ImportJobResource -> Maybe Text)
-> (ImportJobResource -> Maybe Text -> ImportJobResource)
-> Lens
ImportJobResource ImportJobResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Maybe Text
externalId :: Maybe Text
$sel:externalId:ImportJobResource' :: ImportJobResource -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: ImportJobResource
s@ImportJobResource' {} Maybe Text
a -> ImportJobResource
s {$sel:externalId:ImportJobResource' :: Maybe Text
externalId = Maybe Text
a} :: ImportJobResource)
importJobResource_segmentId :: Lens.Lens' ImportJobResource (Prelude.Maybe Prelude.Text)
importJobResource_segmentId :: (Maybe Text -> f (Maybe Text))
-> ImportJobResource -> f ImportJobResource
importJobResource_segmentId = (ImportJobResource -> Maybe Text)
-> (ImportJobResource -> Maybe Text -> ImportJobResource)
-> Lens
ImportJobResource ImportJobResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Maybe Text
segmentId :: Maybe Text
$sel:segmentId:ImportJobResource' :: ImportJobResource -> Maybe Text
segmentId} -> Maybe Text
segmentId) (\s :: ImportJobResource
s@ImportJobResource' {} Maybe Text
a -> ImportJobResource
s {$sel:segmentId:ImportJobResource' :: Maybe Text
segmentId = Maybe Text
a} :: ImportJobResource)
importJobResource_format :: Lens.Lens' ImportJobResource DefinitionFormat
importJobResource_format :: (DefinitionFormat -> f DefinitionFormat)
-> ImportJobResource -> f ImportJobResource
importJobResource_format = (ImportJobResource -> DefinitionFormat)
-> (ImportJobResource -> DefinitionFormat -> ImportJobResource)
-> Lens
ImportJobResource
ImportJobResource
DefinitionFormat
DefinitionFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {DefinitionFormat
format :: DefinitionFormat
$sel:format:ImportJobResource' :: ImportJobResource -> DefinitionFormat
format} -> DefinitionFormat
format) (\s :: ImportJobResource
s@ImportJobResource' {} DefinitionFormat
a -> ImportJobResource
s {$sel:format:ImportJobResource' :: DefinitionFormat
format = DefinitionFormat
a} :: ImportJobResource)
importJobResource_s3Url :: Lens.Lens' ImportJobResource Prelude.Text
importJobResource_s3Url :: (Text -> f Text) -> ImportJobResource -> f ImportJobResource
importJobResource_s3Url = (ImportJobResource -> Text)
-> (ImportJobResource -> Text -> ImportJobResource)
-> Lens ImportJobResource ImportJobResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Text
s3Url :: Text
$sel:s3Url:ImportJobResource' :: ImportJobResource -> Text
s3Url} -> Text
s3Url) (\s :: ImportJobResource
s@ImportJobResource' {} Text
a -> ImportJobResource
s {$sel:s3Url:ImportJobResource' :: Text
s3Url = Text
a} :: ImportJobResource)
importJobResource_roleArn :: Lens.Lens' ImportJobResource Prelude.Text
importJobResource_roleArn :: (Text -> f Text) -> ImportJobResource -> f ImportJobResource
importJobResource_roleArn = (ImportJobResource -> Text)
-> (ImportJobResource -> Text -> ImportJobResource)
-> Lens ImportJobResource ImportJobResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobResource' {Text
roleArn :: Text
$sel:roleArn:ImportJobResource' :: ImportJobResource -> Text
roleArn} -> Text
roleArn) (\s :: ImportJobResource
s@ImportJobResource' {} Text
a -> ImportJobResource
s {$sel:roleArn:ImportJobResource' :: Text
roleArn = Text
a} :: ImportJobResource)
instance Core.FromJSON ImportJobResource where
parseJSON :: Value -> Parser ImportJobResource
parseJSON =
String
-> (Object -> Parser ImportJobResource)
-> Value
-> Parser ImportJobResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImportJobResource"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource
ImportJobResource'
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SegmentName")
Parser
(Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefineSegment")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RegisterEndpoints")
Parser
(Maybe Text
-> Maybe Text
-> DefinitionFormat
-> Text
-> Text
-> ImportJobResource)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> DefinitionFormat -> Text -> Text -> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExternalId")
Parser
(Maybe Text
-> DefinitionFormat -> Text -> Text -> ImportJobResource)
-> Parser (Maybe Text)
-> Parser (DefinitionFormat -> Text -> Text -> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SegmentId")
Parser (DefinitionFormat -> Text -> Text -> ImportJobResource)
-> Parser DefinitionFormat
-> Parser (Text -> Text -> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DefinitionFormat
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Format")
Parser (Text -> Text -> ImportJobResource)
-> Parser Text -> Parser (Text -> ImportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Url")
Parser (Text -> ImportJobResource)
-> Parser Text -> Parser ImportJobResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RoleArn")
)
instance Prelude.Hashable ImportJobResource
instance Prelude.NFData ImportJobResource