{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Pinpoint.GetSegmentExportJobs
(
GetSegmentExportJobs (..),
newGetSegmentExportJobs,
getSegmentExportJobs_token,
getSegmentExportJobs_pageSize,
getSegmentExportJobs_segmentId,
getSegmentExportJobs_applicationId,
GetSegmentExportJobsResponse (..),
newGetSegmentExportJobsResponse,
getSegmentExportJobsResponse_httpStatus,
getSegmentExportJobsResponse_exportJobsResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetSegmentExportJobs = GetSegmentExportJobs'
{
GetSegmentExportJobs -> Maybe Text
token :: Prelude.Maybe Prelude.Text,
GetSegmentExportJobs -> Maybe Text
pageSize :: Prelude.Maybe Prelude.Text,
GetSegmentExportJobs -> Text
segmentId :: Prelude.Text,
GetSegmentExportJobs -> Text
applicationId :: Prelude.Text
}
deriving (GetSegmentExportJobs -> GetSegmentExportJobs -> Bool
(GetSegmentExportJobs -> GetSegmentExportJobs -> Bool)
-> (GetSegmentExportJobs -> GetSegmentExportJobs -> Bool)
-> Eq GetSegmentExportJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSegmentExportJobs -> GetSegmentExportJobs -> Bool
$c/= :: GetSegmentExportJobs -> GetSegmentExportJobs -> Bool
== :: GetSegmentExportJobs -> GetSegmentExportJobs -> Bool
$c== :: GetSegmentExportJobs -> GetSegmentExportJobs -> Bool
Prelude.Eq, ReadPrec [GetSegmentExportJobs]
ReadPrec GetSegmentExportJobs
Int -> ReadS GetSegmentExportJobs
ReadS [GetSegmentExportJobs]
(Int -> ReadS GetSegmentExportJobs)
-> ReadS [GetSegmentExportJobs]
-> ReadPrec GetSegmentExportJobs
-> ReadPrec [GetSegmentExportJobs]
-> Read GetSegmentExportJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSegmentExportJobs]
$creadListPrec :: ReadPrec [GetSegmentExportJobs]
readPrec :: ReadPrec GetSegmentExportJobs
$creadPrec :: ReadPrec GetSegmentExportJobs
readList :: ReadS [GetSegmentExportJobs]
$creadList :: ReadS [GetSegmentExportJobs]
readsPrec :: Int -> ReadS GetSegmentExportJobs
$creadsPrec :: Int -> ReadS GetSegmentExportJobs
Prelude.Read, Int -> GetSegmentExportJobs -> ShowS
[GetSegmentExportJobs] -> ShowS
GetSegmentExportJobs -> String
(Int -> GetSegmentExportJobs -> ShowS)
-> (GetSegmentExportJobs -> String)
-> ([GetSegmentExportJobs] -> ShowS)
-> Show GetSegmentExportJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSegmentExportJobs] -> ShowS
$cshowList :: [GetSegmentExportJobs] -> ShowS
show :: GetSegmentExportJobs -> String
$cshow :: GetSegmentExportJobs -> String
showsPrec :: Int -> GetSegmentExportJobs -> ShowS
$cshowsPrec :: Int -> GetSegmentExportJobs -> ShowS
Prelude.Show, (forall x. GetSegmentExportJobs -> Rep GetSegmentExportJobs x)
-> (forall x. Rep GetSegmentExportJobs x -> GetSegmentExportJobs)
-> Generic GetSegmentExportJobs
forall x. Rep GetSegmentExportJobs x -> GetSegmentExportJobs
forall x. GetSegmentExportJobs -> Rep GetSegmentExportJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSegmentExportJobs x -> GetSegmentExportJobs
$cfrom :: forall x. GetSegmentExportJobs -> Rep GetSegmentExportJobs x
Prelude.Generic)
newGetSegmentExportJobs ::
Prelude.Text ->
Prelude.Text ->
GetSegmentExportJobs
newGetSegmentExportJobs :: Text -> Text -> GetSegmentExportJobs
newGetSegmentExportJobs Text
pSegmentId_ Text
pApplicationId_ =
GetSegmentExportJobs' :: Maybe Text -> Maybe Text -> Text -> Text -> GetSegmentExportJobs
GetSegmentExportJobs'
{ $sel:token:GetSegmentExportJobs' :: Maybe Text
token = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:GetSegmentExportJobs' :: Maybe Text
pageSize = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:segmentId:GetSegmentExportJobs' :: Text
segmentId = Text
pSegmentId_,
$sel:applicationId:GetSegmentExportJobs' :: Text
applicationId = Text
pApplicationId_
}
getSegmentExportJobs_token :: Lens.Lens' GetSegmentExportJobs (Prelude.Maybe Prelude.Text)
getSegmentExportJobs_token :: (Maybe Text -> f (Maybe Text))
-> GetSegmentExportJobs -> f GetSegmentExportJobs
getSegmentExportJobs_token = (GetSegmentExportJobs -> Maybe Text)
-> (GetSegmentExportJobs -> Maybe Text -> GetSegmentExportJobs)
-> Lens
GetSegmentExportJobs GetSegmentExportJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobs' {Maybe Text
token :: Maybe Text
$sel:token:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
token} -> Maybe Text
token) (\s :: GetSegmentExportJobs
s@GetSegmentExportJobs' {} Maybe Text
a -> GetSegmentExportJobs
s {$sel:token:GetSegmentExportJobs' :: Maybe Text
token = Maybe Text
a} :: GetSegmentExportJobs)
getSegmentExportJobs_pageSize :: Lens.Lens' GetSegmentExportJobs (Prelude.Maybe Prelude.Text)
getSegmentExportJobs_pageSize :: (Maybe Text -> f (Maybe Text))
-> GetSegmentExportJobs -> f GetSegmentExportJobs
getSegmentExportJobs_pageSize = (GetSegmentExportJobs -> Maybe Text)
-> (GetSegmentExportJobs -> Maybe Text -> GetSegmentExportJobs)
-> Lens
GetSegmentExportJobs GetSegmentExportJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobs' {Maybe Text
pageSize :: Maybe Text
$sel:pageSize:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
pageSize} -> Maybe Text
pageSize) (\s :: GetSegmentExportJobs
s@GetSegmentExportJobs' {} Maybe Text
a -> GetSegmentExportJobs
s {$sel:pageSize:GetSegmentExportJobs' :: Maybe Text
pageSize = Maybe Text
a} :: GetSegmentExportJobs)
getSegmentExportJobs_segmentId :: Lens.Lens' GetSegmentExportJobs Prelude.Text
getSegmentExportJobs_segmentId :: (Text -> f Text) -> GetSegmentExportJobs -> f GetSegmentExportJobs
getSegmentExportJobs_segmentId = (GetSegmentExportJobs -> Text)
-> (GetSegmentExportJobs -> Text -> GetSegmentExportJobs)
-> Lens GetSegmentExportJobs GetSegmentExportJobs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobs' {Text
segmentId :: Text
$sel:segmentId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
segmentId} -> Text
segmentId) (\s :: GetSegmentExportJobs
s@GetSegmentExportJobs' {} Text
a -> GetSegmentExportJobs
s {$sel:segmentId:GetSegmentExportJobs' :: Text
segmentId = Text
a} :: GetSegmentExportJobs)
getSegmentExportJobs_applicationId :: Lens.Lens' GetSegmentExportJobs Prelude.Text
getSegmentExportJobs_applicationId :: (Text -> f Text) -> GetSegmentExportJobs -> f GetSegmentExportJobs
getSegmentExportJobs_applicationId = (GetSegmentExportJobs -> Text)
-> (GetSegmentExportJobs -> Text -> GetSegmentExportJobs)
-> Lens GetSegmentExportJobs GetSegmentExportJobs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobs' {Text
applicationId :: Text
$sel:applicationId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
applicationId} -> Text
applicationId) (\s :: GetSegmentExportJobs
s@GetSegmentExportJobs' {} Text
a -> GetSegmentExportJobs
s {$sel:applicationId:GetSegmentExportJobs' :: Text
applicationId = Text
a} :: GetSegmentExportJobs)
instance Core.AWSRequest GetSegmentExportJobs where
type
AWSResponse GetSegmentExportJobs =
GetSegmentExportJobsResponse
request :: GetSegmentExportJobs -> Request GetSegmentExportJobs
request = Service -> GetSegmentExportJobs -> Request GetSegmentExportJobs
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetSegmentExportJobs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSegmentExportJobs)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSegmentExportJobs))
-> Logger
-> Service
-> Proxy GetSegmentExportJobs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSegmentExportJobs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> ExportJobsResponse -> GetSegmentExportJobsResponse
GetSegmentExportJobsResponse'
(Int -> ExportJobsResponse -> GetSegmentExportJobsResponse)
-> Either String Int
-> Either
String (ExportJobsResponse -> GetSegmentExportJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (ExportJobsResponse -> GetSegmentExportJobsResponse)
-> Either String ExportJobsResponse
-> Either String GetSegmentExportJobsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String ExportJobsResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable GetSegmentExportJobs
instance Prelude.NFData GetSegmentExportJobs
instance Core.ToHeaders GetSegmentExportJobs where
toHeaders :: GetSegmentExportJobs -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSegmentExportJobs -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath GetSegmentExportJobs where
toPath :: GetSegmentExportJobs -> ByteString
toPath GetSegmentExportJobs' {Maybe Text
Text
applicationId :: Text
segmentId :: Text
pageSize :: Maybe Text
token :: Maybe Text
$sel:applicationId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
$sel:segmentId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
$sel:pageSize:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
$sel:token:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
ByteString
"/segments/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
segmentId,
ByteString
"/jobs/export"
]
instance Core.ToQuery GetSegmentExportJobs where
toQuery :: GetSegmentExportJobs -> QueryString
toQuery GetSegmentExportJobs' {Maybe Text
Text
applicationId :: Text
segmentId :: Text
pageSize :: Maybe Text
token :: Maybe Text
$sel:applicationId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
$sel:segmentId:GetSegmentExportJobs' :: GetSegmentExportJobs -> Text
$sel:pageSize:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
$sel:token:GetSegmentExportJobs' :: GetSegmentExportJobs -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
token, ByteString
"page-size" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
pageSize]
data GetSegmentExportJobsResponse = GetSegmentExportJobsResponse'
{
GetSegmentExportJobsResponse -> Int
httpStatus :: Prelude.Int,
GetSegmentExportJobsResponse -> ExportJobsResponse
exportJobsResponse :: ExportJobsResponse
}
deriving (GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool
(GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool)
-> (GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool)
-> Eq GetSegmentExportJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool
$c/= :: GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool
== :: GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool
$c== :: GetSegmentExportJobsResponse
-> GetSegmentExportJobsResponse -> Bool
Prelude.Eq, ReadPrec [GetSegmentExportJobsResponse]
ReadPrec GetSegmentExportJobsResponse
Int -> ReadS GetSegmentExportJobsResponse
ReadS [GetSegmentExportJobsResponse]
(Int -> ReadS GetSegmentExportJobsResponse)
-> ReadS [GetSegmentExportJobsResponse]
-> ReadPrec GetSegmentExportJobsResponse
-> ReadPrec [GetSegmentExportJobsResponse]
-> Read GetSegmentExportJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSegmentExportJobsResponse]
$creadListPrec :: ReadPrec [GetSegmentExportJobsResponse]
readPrec :: ReadPrec GetSegmentExportJobsResponse
$creadPrec :: ReadPrec GetSegmentExportJobsResponse
readList :: ReadS [GetSegmentExportJobsResponse]
$creadList :: ReadS [GetSegmentExportJobsResponse]
readsPrec :: Int -> ReadS GetSegmentExportJobsResponse
$creadsPrec :: Int -> ReadS GetSegmentExportJobsResponse
Prelude.Read, Int -> GetSegmentExportJobsResponse -> ShowS
[GetSegmentExportJobsResponse] -> ShowS
GetSegmentExportJobsResponse -> String
(Int -> GetSegmentExportJobsResponse -> ShowS)
-> (GetSegmentExportJobsResponse -> String)
-> ([GetSegmentExportJobsResponse] -> ShowS)
-> Show GetSegmentExportJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSegmentExportJobsResponse] -> ShowS
$cshowList :: [GetSegmentExportJobsResponse] -> ShowS
show :: GetSegmentExportJobsResponse -> String
$cshow :: GetSegmentExportJobsResponse -> String
showsPrec :: Int -> GetSegmentExportJobsResponse -> ShowS
$cshowsPrec :: Int -> GetSegmentExportJobsResponse -> ShowS
Prelude.Show, (forall x.
GetSegmentExportJobsResponse -> Rep GetSegmentExportJobsResponse x)
-> (forall x.
Rep GetSegmentExportJobsResponse x -> GetSegmentExportJobsResponse)
-> Generic GetSegmentExportJobsResponse
forall x.
Rep GetSegmentExportJobsResponse x -> GetSegmentExportJobsResponse
forall x.
GetSegmentExportJobsResponse -> Rep GetSegmentExportJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSegmentExportJobsResponse x -> GetSegmentExportJobsResponse
$cfrom :: forall x.
GetSegmentExportJobsResponse -> Rep GetSegmentExportJobsResponse x
Prelude.Generic)
newGetSegmentExportJobsResponse ::
Prelude.Int ->
ExportJobsResponse ->
GetSegmentExportJobsResponse
newGetSegmentExportJobsResponse :: Int -> ExportJobsResponse -> GetSegmentExportJobsResponse
newGetSegmentExportJobsResponse
Int
pHttpStatus_
ExportJobsResponse
pExportJobsResponse_ =
GetSegmentExportJobsResponse' :: Int -> ExportJobsResponse -> GetSegmentExportJobsResponse
GetSegmentExportJobsResponse'
{ $sel:httpStatus:GetSegmentExportJobsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:exportJobsResponse:GetSegmentExportJobsResponse' :: ExportJobsResponse
exportJobsResponse = ExportJobsResponse
pExportJobsResponse_
}
getSegmentExportJobsResponse_httpStatus :: Lens.Lens' GetSegmentExportJobsResponse Prelude.Int
getSegmentExportJobsResponse_httpStatus :: (Int -> f Int)
-> GetSegmentExportJobsResponse -> f GetSegmentExportJobsResponse
getSegmentExportJobsResponse_httpStatus = (GetSegmentExportJobsResponse -> Int)
-> (GetSegmentExportJobsResponse
-> Int -> GetSegmentExportJobsResponse)
-> Lens
GetSegmentExportJobsResponse GetSegmentExportJobsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSegmentExportJobsResponse' :: GetSegmentExportJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSegmentExportJobsResponse
s@GetSegmentExportJobsResponse' {} Int
a -> GetSegmentExportJobsResponse
s {$sel:httpStatus:GetSegmentExportJobsResponse' :: Int
httpStatus = Int
a} :: GetSegmentExportJobsResponse)
getSegmentExportJobsResponse_exportJobsResponse :: Lens.Lens' GetSegmentExportJobsResponse ExportJobsResponse
getSegmentExportJobsResponse_exportJobsResponse :: (ExportJobsResponse -> f ExportJobsResponse)
-> GetSegmentExportJobsResponse -> f GetSegmentExportJobsResponse
getSegmentExportJobsResponse_exportJobsResponse = (GetSegmentExportJobsResponse -> ExportJobsResponse)
-> (GetSegmentExportJobsResponse
-> ExportJobsResponse -> GetSegmentExportJobsResponse)
-> Lens
GetSegmentExportJobsResponse
GetSegmentExportJobsResponse
ExportJobsResponse
ExportJobsResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSegmentExportJobsResponse' {ExportJobsResponse
exportJobsResponse :: ExportJobsResponse
$sel:exportJobsResponse:GetSegmentExportJobsResponse' :: GetSegmentExportJobsResponse -> ExportJobsResponse
exportJobsResponse} -> ExportJobsResponse
exportJobsResponse) (\s :: GetSegmentExportJobsResponse
s@GetSegmentExportJobsResponse' {} ExportJobsResponse
a -> GetSegmentExportJobsResponse
s {$sel:exportJobsResponse:GetSegmentExportJobsResponse' :: ExportJobsResponse
exportJobsResponse = ExportJobsResponse
a} :: GetSegmentExportJobsResponse)
instance Prelude.NFData GetSegmentExportJobsResponse