{-# 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.ExportJobResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExportJobResource = ExportJobResource'
{
ExportJobResource -> Maybe Text
segmentId :: Prelude.Maybe Prelude.Text,
ExportJobResource -> Maybe Int
segmentVersion :: Prelude.Maybe Prelude.Int,
ExportJobResource -> Text
s3UrlPrefix :: Prelude.Text,
ExportJobResource -> Text
roleArn :: Prelude.Text
}
deriving (ExportJobResource -> ExportJobResource -> Bool
(ExportJobResource -> ExportJobResource -> Bool)
-> (ExportJobResource -> ExportJobResource -> Bool)
-> Eq ExportJobResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportJobResource -> ExportJobResource -> Bool
$c/= :: ExportJobResource -> ExportJobResource -> Bool
== :: ExportJobResource -> ExportJobResource -> Bool
$c== :: ExportJobResource -> ExportJobResource -> Bool
Prelude.Eq, ReadPrec [ExportJobResource]
ReadPrec ExportJobResource
Int -> ReadS ExportJobResource
ReadS [ExportJobResource]
(Int -> ReadS ExportJobResource)
-> ReadS [ExportJobResource]
-> ReadPrec ExportJobResource
-> ReadPrec [ExportJobResource]
-> Read ExportJobResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportJobResource]
$creadListPrec :: ReadPrec [ExportJobResource]
readPrec :: ReadPrec ExportJobResource
$creadPrec :: ReadPrec ExportJobResource
readList :: ReadS [ExportJobResource]
$creadList :: ReadS [ExportJobResource]
readsPrec :: Int -> ReadS ExportJobResource
$creadsPrec :: Int -> ReadS ExportJobResource
Prelude.Read, Int -> ExportJobResource -> ShowS
[ExportJobResource] -> ShowS
ExportJobResource -> String
(Int -> ExportJobResource -> ShowS)
-> (ExportJobResource -> String)
-> ([ExportJobResource] -> ShowS)
-> Show ExportJobResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportJobResource] -> ShowS
$cshowList :: [ExportJobResource] -> ShowS
show :: ExportJobResource -> String
$cshow :: ExportJobResource -> String
showsPrec :: Int -> ExportJobResource -> ShowS
$cshowsPrec :: Int -> ExportJobResource -> ShowS
Prelude.Show, (forall x. ExportJobResource -> Rep ExportJobResource x)
-> (forall x. Rep ExportJobResource x -> ExportJobResource)
-> Generic ExportJobResource
forall x. Rep ExportJobResource x -> ExportJobResource
forall x. ExportJobResource -> Rep ExportJobResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportJobResource x -> ExportJobResource
$cfrom :: forall x. ExportJobResource -> Rep ExportJobResource x
Prelude.Generic)
newExportJobResource ::
Prelude.Text ->
Prelude.Text ->
ExportJobResource
newExportJobResource :: Text -> Text -> ExportJobResource
newExportJobResource Text
pS3UrlPrefix_ Text
pRoleArn_ =
ExportJobResource' :: Maybe Text -> Maybe Int -> Text -> Text -> ExportJobResource
ExportJobResource'
{ $sel:segmentId:ExportJobResource' :: Maybe Text
segmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:segmentVersion:ExportJobResource' :: Maybe Int
segmentVersion = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:s3UrlPrefix:ExportJobResource' :: Text
s3UrlPrefix = Text
pS3UrlPrefix_,
$sel:roleArn:ExportJobResource' :: Text
roleArn = Text
pRoleArn_
}
exportJobResource_segmentId :: Lens.Lens' ExportJobResource (Prelude.Maybe Prelude.Text)
exportJobResource_segmentId :: (Maybe Text -> f (Maybe Text))
-> ExportJobResource -> f ExportJobResource
exportJobResource_segmentId = (ExportJobResource -> Maybe Text)
-> (ExportJobResource -> Maybe Text -> ExportJobResource)
-> Lens
ExportJobResource ExportJobResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResource' {Maybe Text
segmentId :: Maybe Text
$sel:segmentId:ExportJobResource' :: ExportJobResource -> Maybe Text
segmentId} -> Maybe Text
segmentId) (\s :: ExportJobResource
s@ExportJobResource' {} Maybe Text
a -> ExportJobResource
s {$sel:segmentId:ExportJobResource' :: Maybe Text
segmentId = Maybe Text
a} :: ExportJobResource)
exportJobResource_segmentVersion :: Lens.Lens' ExportJobResource (Prelude.Maybe Prelude.Int)
exportJobResource_segmentVersion :: (Maybe Int -> f (Maybe Int))
-> ExportJobResource -> f ExportJobResource
exportJobResource_segmentVersion = (ExportJobResource -> Maybe Int)
-> (ExportJobResource -> Maybe Int -> ExportJobResource)
-> Lens ExportJobResource ExportJobResource (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResource' {Maybe Int
segmentVersion :: Maybe Int
$sel:segmentVersion:ExportJobResource' :: ExportJobResource -> Maybe Int
segmentVersion} -> Maybe Int
segmentVersion) (\s :: ExportJobResource
s@ExportJobResource' {} Maybe Int
a -> ExportJobResource
s {$sel:segmentVersion:ExportJobResource' :: Maybe Int
segmentVersion = Maybe Int
a} :: ExportJobResource)
exportJobResource_s3UrlPrefix :: Lens.Lens' ExportJobResource Prelude.Text
exportJobResource_s3UrlPrefix :: (Text -> f Text) -> ExportJobResource -> f ExportJobResource
exportJobResource_s3UrlPrefix = (ExportJobResource -> Text)
-> (ExportJobResource -> Text -> ExportJobResource)
-> Lens ExportJobResource ExportJobResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResource' {Text
s3UrlPrefix :: Text
$sel:s3UrlPrefix:ExportJobResource' :: ExportJobResource -> Text
s3UrlPrefix} -> Text
s3UrlPrefix) (\s :: ExportJobResource
s@ExportJobResource' {} Text
a -> ExportJobResource
s {$sel:s3UrlPrefix:ExportJobResource' :: Text
s3UrlPrefix = Text
a} :: ExportJobResource)
exportJobResource_roleArn :: Lens.Lens' ExportJobResource Prelude.Text
exportJobResource_roleArn :: (Text -> f Text) -> ExportJobResource -> f ExportJobResource
exportJobResource_roleArn = (ExportJobResource -> Text)
-> (ExportJobResource -> Text -> ExportJobResource)
-> Lens ExportJobResource ExportJobResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResource' {Text
roleArn :: Text
$sel:roleArn:ExportJobResource' :: ExportJobResource -> Text
roleArn} -> Text
roleArn) (\s :: ExportJobResource
s@ExportJobResource' {} Text
a -> ExportJobResource
s {$sel:roleArn:ExportJobResource' :: Text
roleArn = Text
a} :: ExportJobResource)
instance Core.FromJSON ExportJobResource where
parseJSON :: Value -> Parser ExportJobResource
parseJSON =
String
-> (Object -> Parser ExportJobResource)
-> Value
-> Parser ExportJobResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExportJobResource"
( \Object
x ->
Maybe Text -> Maybe Int -> Text -> Text -> ExportJobResource
ExportJobResource'
(Maybe Text -> Maybe Int -> Text -> Text -> ExportJobResource)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Text -> Text -> ExportJobResource)
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
"SegmentId")
Parser (Maybe Int -> Text -> Text -> ExportJobResource)
-> Parser (Maybe Int) -> Parser (Text -> Text -> ExportJobResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SegmentVersion")
Parser (Text -> Text -> ExportJobResource)
-> Parser Text -> Parser (Text -> ExportJobResource)
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
"S3UrlPrefix")
Parser (Text -> ExportJobResource)
-> Parser Text -> Parser ExportJobResource
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 ExportJobResource
instance Prelude.NFData ExportJobResource