{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Discovery.DescribeExportTasks
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieve status of one or more export tasks. You can retrieve the status
-- of up to 100 export tasks.
--
-- This operation returns paginated results.
module Amazonka.Discovery.DescribeExportTasks
  ( -- * Creating a Request
    DescribeExportTasks (..),
    newDescribeExportTasks,

    -- * Request Lenses
    describeExportTasks_filters,
    describeExportTasks_nextToken,
    describeExportTasks_exportIds,
    describeExportTasks_maxResults,

    -- * Destructuring the Response
    DescribeExportTasksResponse (..),
    newDescribeExportTasksResponse,

    -- * Response Lenses
    describeExportTasksResponse_nextToken,
    describeExportTasksResponse_exportsInfo,
    describeExportTasksResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeExportTasks' smart constructor.
data DescribeExportTasks = DescribeExportTasks'
  { -- | One or more filters.
    --
    -- -   @AgentId@ - ID of the agent whose collected data will be exported
    DescribeExportTasks -> Maybe [ExportFilter]
filters :: Prelude.Maybe [ExportFilter],
    -- | The @nextToken@ value returned from a previous paginated
    -- @DescribeExportTasks@ request where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    -- This value is null when there are no more results to return.
    DescribeExportTasks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more unique identifiers used to query the status of an export
    -- request.
    DescribeExportTasks -> Maybe [Text]
exportIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of volume results returned by @DescribeExportTasks@
    -- in paginated output. When this parameter is used, @DescribeExportTasks@
    -- only returns @maxResults@ results in a single page along with a
    -- @nextToken@ response element.
    DescribeExportTasks -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeExportTasks -> DescribeExportTasks -> Bool
(DescribeExportTasks -> DescribeExportTasks -> Bool)
-> (DescribeExportTasks -> DescribeExportTasks -> Bool)
-> Eq DescribeExportTasks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeExportTasks -> DescribeExportTasks -> Bool
$c/= :: DescribeExportTasks -> DescribeExportTasks -> Bool
== :: DescribeExportTasks -> DescribeExportTasks -> Bool
$c== :: DescribeExportTasks -> DescribeExportTasks -> Bool
Prelude.Eq, ReadPrec [DescribeExportTasks]
ReadPrec DescribeExportTasks
Int -> ReadS DescribeExportTasks
ReadS [DescribeExportTasks]
(Int -> ReadS DescribeExportTasks)
-> ReadS [DescribeExportTasks]
-> ReadPrec DescribeExportTasks
-> ReadPrec [DescribeExportTasks]
-> Read DescribeExportTasks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeExportTasks]
$creadListPrec :: ReadPrec [DescribeExportTasks]
readPrec :: ReadPrec DescribeExportTasks
$creadPrec :: ReadPrec DescribeExportTasks
readList :: ReadS [DescribeExportTasks]
$creadList :: ReadS [DescribeExportTasks]
readsPrec :: Int -> ReadS DescribeExportTasks
$creadsPrec :: Int -> ReadS DescribeExportTasks
Prelude.Read, Int -> DescribeExportTasks -> ShowS
[DescribeExportTasks] -> ShowS
DescribeExportTasks -> String
(Int -> DescribeExportTasks -> ShowS)
-> (DescribeExportTasks -> String)
-> ([DescribeExportTasks] -> ShowS)
-> Show DescribeExportTasks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeExportTasks] -> ShowS
$cshowList :: [DescribeExportTasks] -> ShowS
show :: DescribeExportTasks -> String
$cshow :: DescribeExportTasks -> String
showsPrec :: Int -> DescribeExportTasks -> ShowS
$cshowsPrec :: Int -> DescribeExportTasks -> ShowS
Prelude.Show, (forall x. DescribeExportTasks -> Rep DescribeExportTasks x)
-> (forall x. Rep DescribeExportTasks x -> DescribeExportTasks)
-> Generic DescribeExportTasks
forall x. Rep DescribeExportTasks x -> DescribeExportTasks
forall x. DescribeExportTasks -> Rep DescribeExportTasks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeExportTasks x -> DescribeExportTasks
$cfrom :: forall x. DescribeExportTasks -> Rep DescribeExportTasks x
Prelude.Generic)

-- |
-- Create a value of 'DescribeExportTasks' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'describeExportTasks_filters' - One or more filters.
--
-- -   @AgentId@ - ID of the agent whose collected data will be exported
--
-- 'nextToken', 'describeExportTasks_nextToken' - The @nextToken@ value returned from a previous paginated
-- @DescribeExportTasks@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
-- This value is null when there are no more results to return.
--
-- 'exportIds', 'describeExportTasks_exportIds' - One or more unique identifiers used to query the status of an export
-- request.
--
-- 'maxResults', 'describeExportTasks_maxResults' - The maximum number of volume results returned by @DescribeExportTasks@
-- in paginated output. When this parameter is used, @DescribeExportTasks@
-- only returns @maxResults@ results in a single page along with a
-- @nextToken@ response element.
newDescribeExportTasks ::
  DescribeExportTasks
newDescribeExportTasks :: DescribeExportTasks
newDescribeExportTasks =
  DescribeExportTasks' :: Maybe [ExportFilter]
-> Maybe Text -> Maybe [Text] -> Maybe Int -> DescribeExportTasks
DescribeExportTasks'
    { $sel:filters:DescribeExportTasks' :: Maybe [ExportFilter]
filters = Maybe [ExportFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeExportTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:exportIds:DescribeExportTasks' :: Maybe [Text]
exportIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeExportTasks' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | One or more filters.
--
-- -   @AgentId@ - ID of the agent whose collected data will be exported
describeExportTasks_filters :: Lens.Lens' DescribeExportTasks (Prelude.Maybe [ExportFilter])
describeExportTasks_filters :: (Maybe [ExportFilter] -> f (Maybe [ExportFilter]))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_filters = (DescribeExportTasks -> Maybe [ExportFilter])
-> (DescribeExportTasks
    -> Maybe [ExportFilter] -> DescribeExportTasks)
-> Lens
     DescribeExportTasks
     DescribeExportTasks
     (Maybe [ExportFilter])
     (Maybe [ExportFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe [ExportFilter]
filters :: Maybe [ExportFilter]
$sel:filters:DescribeExportTasks' :: DescribeExportTasks -> Maybe [ExportFilter]
filters} -> Maybe [ExportFilter]
filters) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe [ExportFilter]
a -> DescribeExportTasks
s {$sel:filters:DescribeExportTasks' :: Maybe [ExportFilter]
filters = Maybe [ExportFilter]
a} :: DescribeExportTasks) ((Maybe [ExportFilter] -> f (Maybe [ExportFilter]))
 -> DescribeExportTasks -> f DescribeExportTasks)
-> ((Maybe [ExportFilter] -> f (Maybe [ExportFilter]))
    -> Maybe [ExportFilter] -> f (Maybe [ExportFilter]))
-> (Maybe [ExportFilter] -> f (Maybe [ExportFilter]))
-> DescribeExportTasks
-> f DescribeExportTasks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ExportFilter] [ExportFilter] [ExportFilter] [ExportFilter]
-> Iso
     (Maybe [ExportFilter])
     (Maybe [ExportFilter])
     (Maybe [ExportFilter])
     (Maybe [ExportFilter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ExportFilter] [ExportFilter] [ExportFilter] [ExportFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @nextToken@ value returned from a previous paginated
-- @DescribeExportTasks@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
-- This value is null when there are no more results to return.
describeExportTasks_nextToken :: Lens.Lens' DescribeExportTasks (Prelude.Maybe Prelude.Text)
describeExportTasks_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_nextToken = (DescribeExportTasks -> Maybe Text)
-> (DescribeExportTasks -> Maybe Text -> DescribeExportTasks)
-> Lens
     DescribeExportTasks DescribeExportTasks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeExportTasks' :: DescribeExportTasks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe Text
a -> DescribeExportTasks
s {$sel:nextToken:DescribeExportTasks' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeExportTasks)

-- | One or more unique identifiers used to query the status of an export
-- request.
describeExportTasks_exportIds :: Lens.Lens' DescribeExportTasks (Prelude.Maybe [Prelude.Text])
describeExportTasks_exportIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_exportIds = (DescribeExportTasks -> Maybe [Text])
-> (DescribeExportTasks -> Maybe [Text] -> DescribeExportTasks)
-> Lens
     DescribeExportTasks
     DescribeExportTasks
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe [Text]
exportIds :: Maybe [Text]
$sel:exportIds:DescribeExportTasks' :: DescribeExportTasks -> Maybe [Text]
exportIds} -> Maybe [Text]
exportIds) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe [Text]
a -> DescribeExportTasks
s {$sel:exportIds:DescribeExportTasks' :: Maybe [Text]
exportIds = Maybe [Text]
a} :: DescribeExportTasks) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeExportTasks -> f DescribeExportTasks)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeExportTasks
-> f DescribeExportTasks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of volume results returned by @DescribeExportTasks@
-- in paginated output. When this parameter is used, @DescribeExportTasks@
-- only returns @maxResults@ results in a single page along with a
-- @nextToken@ response element.
describeExportTasks_maxResults :: Lens.Lens' DescribeExportTasks (Prelude.Maybe Prelude.Int)
describeExportTasks_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_maxResults = (DescribeExportTasks -> Maybe Int)
-> (DescribeExportTasks -> Maybe Int -> DescribeExportTasks)
-> Lens
     DescribeExportTasks DescribeExportTasks (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeExportTasks' :: DescribeExportTasks -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe Int
a -> DescribeExportTasks
s {$sel:maxResults:DescribeExportTasks' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeExportTasks)

instance Core.AWSPager DescribeExportTasks where
  page :: DescribeExportTasks
-> AWSResponse DescribeExportTasks -> Maybe DescribeExportTasks
page DescribeExportTasks
rq AWSResponse DescribeExportTasks
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeExportTasks
DescribeExportTasksResponse
rs
            DescribeExportTasksResponse
-> Getting (First Text) DescribeExportTasksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeExportTasksResponse
-> Const (First Text) DescribeExportTasksResponse
Lens' DescribeExportTasksResponse (Maybe Text)
describeExportTasksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeExportTasksResponse
 -> Const (First Text) DescribeExportTasksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeExportTasksResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeExportTasks
forall a. Maybe a
Prelude.Nothing
    | Maybe [ExportInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeExportTasks
DescribeExportTasksResponse
rs
            DescribeExportTasksResponse
-> Getting
     (First [ExportInfo]) DescribeExportTasksResponse [ExportInfo]
-> Maybe [ExportInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ExportInfo]
 -> Const (First [ExportInfo]) (Maybe [ExportInfo]))
-> DescribeExportTasksResponse
-> Const (First [ExportInfo]) DescribeExportTasksResponse
Lens' DescribeExportTasksResponse (Maybe [ExportInfo])
describeExportTasksResponse_exportsInfo
              ((Maybe [ExportInfo]
  -> Const (First [ExportInfo]) (Maybe [ExportInfo]))
 -> DescribeExportTasksResponse
 -> Const (First [ExportInfo]) DescribeExportTasksResponse)
-> (([ExportInfo] -> Const (First [ExportInfo]) [ExportInfo])
    -> Maybe [ExportInfo]
    -> Const (First [ExportInfo]) (Maybe [ExportInfo]))
-> Getting
     (First [ExportInfo]) DescribeExportTasksResponse [ExportInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ExportInfo] -> Const (First [ExportInfo]) [ExportInfo])
-> Maybe [ExportInfo]
-> Const (First [ExportInfo]) (Maybe [ExportInfo])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeExportTasks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeExportTasks -> Maybe DescribeExportTasks
forall a. a -> Maybe a
Prelude.Just (DescribeExportTasks -> Maybe DescribeExportTasks)
-> DescribeExportTasks -> Maybe DescribeExportTasks
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeExportTasks
rq
          DescribeExportTasks
-> (DescribeExportTasks -> DescribeExportTasks)
-> DescribeExportTasks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeExportTasks -> Identity DescribeExportTasks
Lens
  DescribeExportTasks DescribeExportTasks (Maybe Text) (Maybe Text)
describeExportTasks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeExportTasks -> Identity DescribeExportTasks)
-> Maybe Text -> DescribeExportTasks -> DescribeExportTasks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeExportTasks
DescribeExportTasksResponse
rs
          DescribeExportTasksResponse
-> Getting (First Text) DescribeExportTasksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeExportTasksResponse
-> Const (First Text) DescribeExportTasksResponse
Lens' DescribeExportTasksResponse (Maybe Text)
describeExportTasksResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeExportTasksResponse
 -> Const (First Text) DescribeExportTasksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeExportTasksResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeExportTasks where
  type
    AWSResponse DescribeExportTasks =
      DescribeExportTasksResponse
  request :: DescribeExportTasks -> Request DescribeExportTasks
request = Service -> DescribeExportTasks -> Request DescribeExportTasks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeExportTasks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeExportTasks)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeExportTasks))
-> Logger
-> Service
-> Proxy DescribeExportTasks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeExportTasks)))
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 ->
          Maybe Text
-> Maybe [ExportInfo] -> Int -> DescribeExportTasksResponse
DescribeExportTasksResponse'
            (Maybe Text
 -> Maybe [ExportInfo] -> Int -> DescribeExportTasksResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [ExportInfo] -> Int -> DescribeExportTasksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String (Maybe [ExportInfo] -> Int -> DescribeExportTasksResponse)
-> Either String (Maybe [ExportInfo])
-> Either String (Int -> DescribeExportTasksResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ExportInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"exportsInfo" Either String (Maybe (Maybe [ExportInfo]))
-> Maybe [ExportInfo] -> Either String (Maybe [ExportInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ExportInfo]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeExportTasksResponse)
-> Either String Int -> Either String DescribeExportTasksResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable DescribeExportTasks

instance Prelude.NFData DescribeExportTasks

instance Core.ToHeaders DescribeExportTasks where
  toHeaders :: DescribeExportTasks -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeExportTasks -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSPoseidonService_V2015_11_01.DescribeExportTasks" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DescribeExportTasks where
  toJSON :: DescribeExportTasks -> Value
toJSON DescribeExportTasks' {Maybe Int
Maybe [Text]
Maybe [ExportFilter]
Maybe Text
maxResults :: Maybe Int
exportIds :: Maybe [Text]
nextToken :: Maybe Text
filters :: Maybe [ExportFilter]
$sel:maxResults:DescribeExportTasks' :: DescribeExportTasks -> Maybe Int
$sel:exportIds:DescribeExportTasks' :: DescribeExportTasks -> Maybe [Text]
$sel:nextToken:DescribeExportTasks' :: DescribeExportTasks -> Maybe Text
$sel:filters:DescribeExportTasks' :: DescribeExportTasks -> Maybe [ExportFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> [ExportFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ExportFilter] -> Pair) -> Maybe [ExportFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExportFilter]
filters,
            (Text
"nextToken" 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
nextToken,
            (Text
"exportIds" 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]
exportIds,
            (Text
"maxResults" 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
maxResults
          ]
      )

instance Core.ToPath DescribeExportTasks where
  toPath :: DescribeExportTasks -> ByteString
toPath = ByteString -> DescribeExportTasks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeExportTasks where
  toQuery :: DescribeExportTasks -> QueryString
toQuery = QueryString -> DescribeExportTasks -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeExportTasksResponse' smart constructor.
data DescribeExportTasksResponse = DescribeExportTasksResponse'
  { -- | The @nextToken@ value to include in a future @DescribeExportTasks@
    -- request. When the results of a @DescribeExportTasks@ request exceed
    -- @maxResults@, this value can be used to retrieve the next page of
    -- results. This value is null when there are no more results to return.
    DescribeExportTasksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Contains one or more sets of export request details. When the status of
    -- a request is @SUCCEEDED@, the response includes a URL for an Amazon S3
    -- bucket where you can view the data in a CSV file.
    DescribeExportTasksResponse -> Maybe [ExportInfo]
exportsInfo :: Prelude.Maybe [ExportInfo],
    -- | The response's http status code.
    DescribeExportTasksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeExportTasksResponse -> DescribeExportTasksResponse -> Bool
(DescribeExportTasksResponse
 -> DescribeExportTasksResponse -> Bool)
-> (DescribeExportTasksResponse
    -> DescribeExportTasksResponse -> Bool)
-> Eq DescribeExportTasksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeExportTasksResponse -> DescribeExportTasksResponse -> Bool
$c/= :: DescribeExportTasksResponse -> DescribeExportTasksResponse -> Bool
== :: DescribeExportTasksResponse -> DescribeExportTasksResponse -> Bool
$c== :: DescribeExportTasksResponse -> DescribeExportTasksResponse -> Bool
Prelude.Eq, ReadPrec [DescribeExportTasksResponse]
ReadPrec DescribeExportTasksResponse
Int -> ReadS DescribeExportTasksResponse
ReadS [DescribeExportTasksResponse]
(Int -> ReadS DescribeExportTasksResponse)
-> ReadS [DescribeExportTasksResponse]
-> ReadPrec DescribeExportTasksResponse
-> ReadPrec [DescribeExportTasksResponse]
-> Read DescribeExportTasksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeExportTasksResponse]
$creadListPrec :: ReadPrec [DescribeExportTasksResponse]
readPrec :: ReadPrec DescribeExportTasksResponse
$creadPrec :: ReadPrec DescribeExportTasksResponse
readList :: ReadS [DescribeExportTasksResponse]
$creadList :: ReadS [DescribeExportTasksResponse]
readsPrec :: Int -> ReadS DescribeExportTasksResponse
$creadsPrec :: Int -> ReadS DescribeExportTasksResponse
Prelude.Read, Int -> DescribeExportTasksResponse -> ShowS
[DescribeExportTasksResponse] -> ShowS
DescribeExportTasksResponse -> String
(Int -> DescribeExportTasksResponse -> ShowS)
-> (DescribeExportTasksResponse -> String)
-> ([DescribeExportTasksResponse] -> ShowS)
-> Show DescribeExportTasksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeExportTasksResponse] -> ShowS
$cshowList :: [DescribeExportTasksResponse] -> ShowS
show :: DescribeExportTasksResponse -> String
$cshow :: DescribeExportTasksResponse -> String
showsPrec :: Int -> DescribeExportTasksResponse -> ShowS
$cshowsPrec :: Int -> DescribeExportTasksResponse -> ShowS
Prelude.Show, (forall x.
 DescribeExportTasksResponse -> Rep DescribeExportTasksResponse x)
-> (forall x.
    Rep DescribeExportTasksResponse x -> DescribeExportTasksResponse)
-> Generic DescribeExportTasksResponse
forall x.
Rep DescribeExportTasksResponse x -> DescribeExportTasksResponse
forall x.
DescribeExportTasksResponse -> Rep DescribeExportTasksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeExportTasksResponse x -> DescribeExportTasksResponse
$cfrom :: forall x.
DescribeExportTasksResponse -> Rep DescribeExportTasksResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeExportTasksResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'describeExportTasksResponse_nextToken' - The @nextToken@ value to include in a future @DescribeExportTasks@
-- request. When the results of a @DescribeExportTasks@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is null when there are no more results to return.
--
-- 'exportsInfo', 'describeExportTasksResponse_exportsInfo' - Contains one or more sets of export request details. When the status of
-- a request is @SUCCEEDED@, the response includes a URL for an Amazon S3
-- bucket where you can view the data in a CSV file.
--
-- 'httpStatus', 'describeExportTasksResponse_httpStatus' - The response's http status code.
newDescribeExportTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeExportTasksResponse
newDescribeExportTasksResponse :: Int -> DescribeExportTasksResponse
newDescribeExportTasksResponse Int
pHttpStatus_ =
  DescribeExportTasksResponse' :: Maybe Text
-> Maybe [ExportInfo] -> Int -> DescribeExportTasksResponse
DescribeExportTasksResponse'
    { $sel:nextToken:DescribeExportTasksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:exportsInfo:DescribeExportTasksResponse' :: Maybe [ExportInfo]
exportsInfo = Maybe [ExportInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeExportTasksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @nextToken@ value to include in a future @DescribeExportTasks@
-- request. When the results of a @DescribeExportTasks@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is null when there are no more results to return.
describeExportTasksResponse_nextToken :: Lens.Lens' DescribeExportTasksResponse (Prelude.Maybe Prelude.Text)
describeExportTasksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeExportTasksResponse -> f DescribeExportTasksResponse
describeExportTasksResponse_nextToken = (DescribeExportTasksResponse -> Maybe Text)
-> (DescribeExportTasksResponse
    -> Maybe Text -> DescribeExportTasksResponse)
-> Lens' DescribeExportTasksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeExportTasksResponse' :: DescribeExportTasksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeExportTasksResponse
s@DescribeExportTasksResponse' {} Maybe Text
a -> DescribeExportTasksResponse
s {$sel:nextToken:DescribeExportTasksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeExportTasksResponse)

-- | Contains one or more sets of export request details. When the status of
-- a request is @SUCCEEDED@, the response includes a URL for an Amazon S3
-- bucket where you can view the data in a CSV file.
describeExportTasksResponse_exportsInfo :: Lens.Lens' DescribeExportTasksResponse (Prelude.Maybe [ExportInfo])
describeExportTasksResponse_exportsInfo :: (Maybe [ExportInfo] -> f (Maybe [ExportInfo]))
-> DescribeExportTasksResponse -> f DescribeExportTasksResponse
describeExportTasksResponse_exportsInfo = (DescribeExportTasksResponse -> Maybe [ExportInfo])
-> (DescribeExportTasksResponse
    -> Maybe [ExportInfo] -> DescribeExportTasksResponse)
-> Lens' DescribeExportTasksResponse (Maybe [ExportInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasksResponse' {Maybe [ExportInfo]
exportsInfo :: Maybe [ExportInfo]
$sel:exportsInfo:DescribeExportTasksResponse' :: DescribeExportTasksResponse -> Maybe [ExportInfo]
exportsInfo} -> Maybe [ExportInfo]
exportsInfo) (\s :: DescribeExportTasksResponse
s@DescribeExportTasksResponse' {} Maybe [ExportInfo]
a -> DescribeExportTasksResponse
s {$sel:exportsInfo:DescribeExportTasksResponse' :: Maybe [ExportInfo]
exportsInfo = Maybe [ExportInfo]
a} :: DescribeExportTasksResponse) ((Maybe [ExportInfo] -> f (Maybe [ExportInfo]))
 -> DescribeExportTasksResponse -> f DescribeExportTasksResponse)
-> ((Maybe [ExportInfo] -> f (Maybe [ExportInfo]))
    -> Maybe [ExportInfo] -> f (Maybe [ExportInfo]))
-> (Maybe [ExportInfo] -> f (Maybe [ExportInfo]))
-> DescribeExportTasksResponse
-> f DescribeExportTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ExportInfo] [ExportInfo] [ExportInfo] [ExportInfo]
-> Iso
     (Maybe [ExportInfo])
     (Maybe [ExportInfo])
     (Maybe [ExportInfo])
     (Maybe [ExportInfo])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ExportInfo] [ExportInfo] [ExportInfo] [ExportInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeExportTasksResponse_httpStatus :: Lens.Lens' DescribeExportTasksResponse Prelude.Int
describeExportTasksResponse_httpStatus :: (Int -> f Int)
-> DescribeExportTasksResponse -> f DescribeExportTasksResponse
describeExportTasksResponse_httpStatus = (DescribeExportTasksResponse -> Int)
-> (DescribeExportTasksResponse
    -> Int -> DescribeExportTasksResponse)
-> Lens
     DescribeExportTasksResponse DescribeExportTasksResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasksResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeExportTasksResponse' :: DescribeExportTasksResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeExportTasksResponse
s@DescribeExportTasksResponse' {} Int
a -> DescribeExportTasksResponse
s {$sel:httpStatus:DescribeExportTasksResponse' :: Int
httpStatus = Int
a} :: DescribeExportTasksResponse)

instance Prelude.NFData DescribeExportTasksResponse