{-# 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.ExportJobRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExportJobRequest = ExportJobRequest'
{
ExportJobRequest -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
ExportJobRequest -> Maybe Int
segmentVersion :: Prelude.Maybe Prelude.Int,
ExportJobRequest -> Text
s3UrlPrefix :: Prelude.Text,
ExportJobRequest -> Text
roleArn :: Prelude.Text
}
deriving (ExportJobRequest -> ExportJobRequest -> Bool
(ExportJobRequest -> ExportJobRequest -> Bool)
-> (ExportJobRequest -> ExportJobRequest -> Bool)
-> Eq ExportJobRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportJobRequest -> ExportJobRequest -> Bool
$c/= :: ExportJobRequest -> ExportJobRequest -> Bool
== :: ExportJobRequest -> ExportJobRequest -> Bool
$c== :: ExportJobRequest -> ExportJobRequest -> Bool
Prelude.Eq, ReadPrec [ExportJobRequest]
ReadPrec ExportJobRequest
Int -> ReadS ExportJobRequest
ReadS [ExportJobRequest]
(Int -> ReadS ExportJobRequest)
-> ReadS [ExportJobRequest]
-> ReadPrec ExportJobRequest
-> ReadPrec [ExportJobRequest]
-> Read ExportJobRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportJobRequest]
$creadListPrec :: ReadPrec [ExportJobRequest]
readPrec :: ReadPrec ExportJobRequest
$creadPrec :: ReadPrec ExportJobRequest
readList :: ReadS [ExportJobRequest]
$creadList :: ReadS [ExportJobRequest]
readsPrec :: Int -> ReadS ExportJobRequest
$creadsPrec :: Int -> ReadS ExportJobRequest
Prelude.Read, Int -> ExportJobRequest -> ShowS
[ExportJobRequest] -> ShowS
ExportJobRequest -> String
(Int -> ExportJobRequest -> ShowS)
-> (ExportJobRequest -> String)
-> ([ExportJobRequest] -> ShowS)
-> Show ExportJobRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportJobRequest] -> ShowS
$cshowList :: [ExportJobRequest] -> ShowS
show :: ExportJobRequest -> String
$cshow :: ExportJobRequest -> String
showsPrec :: Int -> ExportJobRequest -> ShowS
$cshowsPrec :: Int -> ExportJobRequest -> ShowS
Prelude.Show, (forall x. ExportJobRequest -> Rep ExportJobRequest x)
-> (forall x. Rep ExportJobRequest x -> ExportJobRequest)
-> Generic ExportJobRequest
forall x. Rep ExportJobRequest x -> ExportJobRequest
forall x. ExportJobRequest -> Rep ExportJobRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportJobRequest x -> ExportJobRequest
$cfrom :: forall x. ExportJobRequest -> Rep ExportJobRequest x
Prelude.Generic)
newExportJobRequest ::
Prelude.Text ->
Prelude.Text ->
ExportJobRequest
newExportJobRequest :: Text -> Text -> ExportJobRequest
newExportJobRequest Text
pS3UrlPrefix_ Text
pRoleArn_ =
ExportJobRequest' :: Maybe Text -> Maybe Int -> Text -> Text -> ExportJobRequest
ExportJobRequest'
{ $sel:segmentId:ExportJobRequest' :: Maybe Text
segmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:segmentVersion:ExportJobRequest' :: Maybe Int
segmentVersion = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:s3UrlPrefix:ExportJobRequest' :: Text
s3UrlPrefix = Text
pS3UrlPrefix_,
$sel:roleArn:ExportJobRequest' :: Text
roleArn = Text
pRoleArn_
}
exportJobRequest_segmentId :: Lens.Lens' ExportJobRequest (Prelude.Maybe Prelude.Text)
exportJobRequest_segmentId :: (Maybe Text -> f (Maybe Text))
-> ExportJobRequest -> f ExportJobRequest
exportJobRequest_segmentId = (ExportJobRequest -> Maybe Text)
-> (ExportJobRequest -> Maybe Text -> ExportJobRequest)
-> Lens ExportJobRequest ExportJobRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobRequest' {Maybe Text
segmentId :: Maybe Text
$sel:segmentId:ExportJobRequest' :: ExportJobRequest -> Maybe Text
segmentId} -> Maybe Text
segmentId) (\s :: ExportJobRequest
s@ExportJobRequest' {} Maybe Text
a -> ExportJobRequest
s {$sel:segmentId:ExportJobRequest' :: Maybe Text
segmentId = Maybe Text
a} :: ExportJobRequest)
exportJobRequest_segmentVersion :: Lens.Lens' ExportJobRequest (Prelude.Maybe Prelude.Int)
exportJobRequest_segmentVersion :: (Maybe Int -> f (Maybe Int))
-> ExportJobRequest -> f ExportJobRequest
exportJobRequest_segmentVersion = (ExportJobRequest -> Maybe Int)
-> (ExportJobRequest -> Maybe Int -> ExportJobRequest)
-> Lens ExportJobRequest ExportJobRequest (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobRequest' {Maybe Int
segmentVersion :: Maybe Int
$sel:segmentVersion:ExportJobRequest' :: ExportJobRequest -> Maybe Int
segmentVersion} -> Maybe Int
segmentVersion) (\s :: ExportJobRequest
s@ExportJobRequest' {} Maybe Int
a -> ExportJobRequest
s {$sel:segmentVersion:ExportJobRequest' :: Maybe Int
segmentVersion = Maybe Int
a} :: ExportJobRequest)
exportJobRequest_s3UrlPrefix :: Lens.Lens' ExportJobRequest Prelude.Text
exportJobRequest_s3UrlPrefix :: (Text -> f Text) -> ExportJobRequest -> f ExportJobRequest
exportJobRequest_s3UrlPrefix = (ExportJobRequest -> Text)
-> (ExportJobRequest -> Text -> ExportJobRequest)
-> Lens ExportJobRequest ExportJobRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobRequest' {Text
s3UrlPrefix :: Text
$sel:s3UrlPrefix:ExportJobRequest' :: ExportJobRequest -> Text
s3UrlPrefix} -> Text
s3UrlPrefix) (\s :: ExportJobRequest
s@ExportJobRequest' {} Text
a -> ExportJobRequest
s {$sel:s3UrlPrefix:ExportJobRequest' :: Text
s3UrlPrefix = Text
a} :: ExportJobRequest)
exportJobRequest_roleArn :: Lens.Lens' ExportJobRequest Prelude.Text
exportJobRequest_roleArn :: (Text -> f Text) -> ExportJobRequest -> f ExportJobRequest
exportJobRequest_roleArn = (ExportJobRequest -> Text)
-> (ExportJobRequest -> Text -> ExportJobRequest)
-> Lens ExportJobRequest ExportJobRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobRequest' {Text
roleArn :: Text
$sel:roleArn:ExportJobRequest' :: ExportJobRequest -> Text
roleArn} -> Text
roleArn) (\s :: ExportJobRequest
s@ExportJobRequest' {} Text
a -> ExportJobRequest
s {$sel:roleArn:ExportJobRequest' :: Text
roleArn = Text
a} :: ExportJobRequest)
instance Prelude.Hashable ExportJobRequest
instance Prelude.NFData ExportJobRequest
instance Core.ToJSON ExportJobRequest where
toJSON :: ExportJobRequest -> Value
toJSON ExportJobRequest' {Maybe Int
Maybe Text
Text
roleArn :: Text
s3UrlPrefix :: Text
segmentVersion :: Maybe Int
segmentId :: Maybe Text
$sel:roleArn:ExportJobRequest' :: ExportJobRequest -> Text
$sel:s3UrlPrefix:ExportJobRequest' :: ExportJobRequest -> Text
$sel:segmentVersion:ExportJobRequest' :: ExportJobRequest -> Maybe Int
$sel:segmentId:ExportJobRequest' :: ExportJobRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
(Text
"SegmentVersion" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
segmentVersion,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3UrlPrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3UrlPrefix),
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)
]
)