{-# 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.CloudWatchLogs.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)
--
-- Lists the specified export tasks. You can list all your export tasks or
-- filter the results based on task ID or task status.
--
-- This operation returns paginated results.
module Amazonka.CloudWatchLogs.DescribeExportTasks
  ( -- * Creating a Request
    DescribeExportTasks (..),
    newDescribeExportTasks,

    -- * Request Lenses
    describeExportTasks_taskId,
    describeExportTasks_nextToken,
    describeExportTasks_limit,
    describeExportTasks_statusCode,

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

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

import Amazonka.CloudWatchLogs.Types
import qualified Amazonka.Core as Core
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'
  { -- | The ID of the export task. Specifying a task ID filters the results to
    -- zero or one export tasks.
    DescribeExportTasks -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeExportTasks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items returned. If you don\'t specify a value, the
    -- default is up to 50 items.
    DescribeExportTasks -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The status code of the export task. Specifying a status code filters the
    -- results to zero or more export tasks.
    DescribeExportTasks -> Maybe ExportTaskStatusCode
statusCode :: Prelude.Maybe ExportTaskStatusCode
  }
  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:
--
-- 'taskId', 'describeExportTasks_taskId' - The ID of the export task. Specifying a task ID filters the results to
-- zero or one export tasks.
--
-- 'nextToken', 'describeExportTasks_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'limit', 'describeExportTasks_limit' - The maximum number of items returned. If you don\'t specify a value, the
-- default is up to 50 items.
--
-- 'statusCode', 'describeExportTasks_statusCode' - The status code of the export task. Specifying a status code filters the
-- results to zero or more export tasks.
newDescribeExportTasks ::
  DescribeExportTasks
newDescribeExportTasks :: DescribeExportTasks
newDescribeExportTasks =
  DescribeExportTasks' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe ExportTaskStatusCode
-> DescribeExportTasks
DescribeExportTasks'
    { $sel:taskId:DescribeExportTasks' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeExportTasks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeExportTasks' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:DescribeExportTasks' :: Maybe ExportTaskStatusCode
statusCode = Maybe ExportTaskStatusCode
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the export task. Specifying a task ID filters the results to
-- zero or one export tasks.
describeExportTasks_taskId :: Lens.Lens' DescribeExportTasks (Prelude.Maybe Prelude.Text)
describeExportTasks_taskId :: (Maybe Text -> f (Maybe Text))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_taskId = (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
taskId :: Maybe Text
$sel:taskId:DescribeExportTasks' :: DescribeExportTasks -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe Text
a -> DescribeExportTasks
s {$sel:taskId:DescribeExportTasks' :: Maybe Text
taskId = Maybe Text
a} :: DescribeExportTasks)

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
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)

-- | The maximum number of items returned. If you don\'t specify a value, the
-- default is up to 50 items.
describeExportTasks_limit :: Lens.Lens' DescribeExportTasks (Prelude.Maybe Prelude.Natural)
describeExportTasks_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_limit = (DescribeExportTasks -> Maybe Natural)
-> (DescribeExportTasks -> Maybe Natural -> DescribeExportTasks)
-> Lens
     DescribeExportTasks
     DescribeExportTasks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeExportTasks' :: DescribeExportTasks -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe Natural
a -> DescribeExportTasks
s {$sel:limit:DescribeExportTasks' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeExportTasks)

-- | The status code of the export task. Specifying a status code filters the
-- results to zero or more export tasks.
describeExportTasks_statusCode :: Lens.Lens' DescribeExportTasks (Prelude.Maybe ExportTaskStatusCode)
describeExportTasks_statusCode :: (Maybe ExportTaskStatusCode -> f (Maybe ExportTaskStatusCode))
-> DescribeExportTasks -> f DescribeExportTasks
describeExportTasks_statusCode = (DescribeExportTasks -> Maybe ExportTaskStatusCode)
-> (DescribeExportTasks
    -> Maybe ExportTaskStatusCode -> DescribeExportTasks)
-> Lens
     DescribeExportTasks
     DescribeExportTasks
     (Maybe ExportTaskStatusCode)
     (Maybe ExportTaskStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasks' {Maybe ExportTaskStatusCode
statusCode :: Maybe ExportTaskStatusCode
$sel:statusCode:DescribeExportTasks' :: DescribeExportTasks -> Maybe ExportTaskStatusCode
statusCode} -> Maybe ExportTaskStatusCode
statusCode) (\s :: DescribeExportTasks
s@DescribeExportTasks' {} Maybe ExportTaskStatusCode
a -> DescribeExportTasks
s {$sel:statusCode:DescribeExportTasks' :: Maybe ExportTaskStatusCode
statusCode = Maybe ExportTaskStatusCode
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 [ExportTask] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeExportTasks
DescribeExportTasksResponse
rs
            DescribeExportTasksResponse
-> Getting
     (First [ExportTask]) DescribeExportTasksResponse [ExportTask]
-> Maybe [ExportTask]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ExportTask]
 -> Const (First [ExportTask]) (Maybe [ExportTask]))
-> DescribeExportTasksResponse
-> Const (First [ExportTask]) DescribeExportTasksResponse
Lens' DescribeExportTasksResponse (Maybe [ExportTask])
describeExportTasksResponse_exportTasks
              ((Maybe [ExportTask]
  -> Const (First [ExportTask]) (Maybe [ExportTask]))
 -> DescribeExportTasksResponse
 -> Const (First [ExportTask]) DescribeExportTasksResponse)
-> (([ExportTask] -> Const (First [ExportTask]) [ExportTask])
    -> Maybe [ExportTask]
    -> Const (First [ExportTask]) (Maybe [ExportTask]))
-> Getting
     (First [ExportTask]) DescribeExportTasksResponse [ExportTask]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ExportTask] -> Const (First [ExportTask]) [ExportTask])
-> Maybe [ExportTask]
-> Const (First [ExportTask]) (Maybe [ExportTask])
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 [ExportTask] -> Int -> DescribeExportTasksResponse
DescribeExportTasksResponse'
            (Maybe Text
 -> Maybe [ExportTask] -> Int -> DescribeExportTasksResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [ExportTask] -> 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 [ExportTask] -> Int -> DescribeExportTasksResponse)
-> Either String (Maybe [ExportTask])
-> 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 [ExportTask]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"exportTasks" Either String (Maybe (Maybe [ExportTask]))
-> Maybe [ExportTask] -> Either String (Maybe [ExportTask])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ExportTask]
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
"Logs_20140328.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 Natural
Maybe Text
Maybe ExportTaskStatusCode
statusCode :: Maybe ExportTaskStatusCode
limit :: Maybe Natural
nextToken :: Maybe Text
taskId :: Maybe Text
$sel:statusCode:DescribeExportTasks' :: DescribeExportTasks -> Maybe ExportTaskStatusCode
$sel:limit:DescribeExportTasks' :: DescribeExportTasks -> Maybe Natural
$sel:nextToken:DescribeExportTasks' :: DescribeExportTasks -> Maybe Text
$sel:taskId:DescribeExportTasks' :: DescribeExportTasks -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"taskId" 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
taskId,
            (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
"limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            (Text
"statusCode" Text -> ExportTaskStatusCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ExportTaskStatusCode -> Pair)
-> Maybe ExportTaskStatusCode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExportTaskStatusCode
statusCode
          ]
      )

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'
  { DescribeExportTasksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The export tasks.
    DescribeExportTasksResponse -> Maybe [ExportTask]
exportTasks :: Prelude.Maybe [ExportTask],
    -- | 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' - Undocumented member.
--
-- 'exportTasks', 'describeExportTasksResponse_exportTasks' - The export tasks.
--
-- 'httpStatus', 'describeExportTasksResponse_httpStatus' - The response's http status code.
newDescribeExportTasksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeExportTasksResponse
newDescribeExportTasksResponse :: Int -> DescribeExportTasksResponse
newDescribeExportTasksResponse Int
pHttpStatus_ =
  DescribeExportTasksResponse' :: Maybe Text
-> Maybe [ExportTask] -> Int -> DescribeExportTasksResponse
DescribeExportTasksResponse'
    { $sel:nextToken:DescribeExportTasksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:exportTasks:DescribeExportTasksResponse' :: Maybe [ExportTask]
exportTasks = Maybe [ExportTask]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeExportTasksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
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)

-- | The export tasks.
describeExportTasksResponse_exportTasks :: Lens.Lens' DescribeExportTasksResponse (Prelude.Maybe [ExportTask])
describeExportTasksResponse_exportTasks :: (Maybe [ExportTask] -> f (Maybe [ExportTask]))
-> DescribeExportTasksResponse -> f DescribeExportTasksResponse
describeExportTasksResponse_exportTasks = (DescribeExportTasksResponse -> Maybe [ExportTask])
-> (DescribeExportTasksResponse
    -> Maybe [ExportTask] -> DescribeExportTasksResponse)
-> Lens' DescribeExportTasksResponse (Maybe [ExportTask])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeExportTasksResponse' {Maybe [ExportTask]
exportTasks :: Maybe [ExportTask]
$sel:exportTasks:DescribeExportTasksResponse' :: DescribeExportTasksResponse -> Maybe [ExportTask]
exportTasks} -> Maybe [ExportTask]
exportTasks) (\s :: DescribeExportTasksResponse
s@DescribeExportTasksResponse' {} Maybe [ExportTask]
a -> DescribeExportTasksResponse
s {$sel:exportTasks:DescribeExportTasksResponse' :: Maybe [ExportTask]
exportTasks = Maybe [ExportTask]
a} :: DescribeExportTasksResponse) ((Maybe [ExportTask] -> f (Maybe [ExportTask]))
 -> DescribeExportTasksResponse -> f DescribeExportTasksResponse)
-> ((Maybe [ExportTask] -> f (Maybe [ExportTask]))
    -> Maybe [ExportTask] -> f (Maybe [ExportTask]))
-> (Maybe [ExportTask] -> f (Maybe [ExportTask]))
-> DescribeExportTasksResponse
-> f DescribeExportTasksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ExportTask] [ExportTask] [ExportTask] [ExportTask]
-> Iso
     (Maybe [ExportTask])
     (Maybe [ExportTask])
     (Maybe [ExportTask])
     (Maybe [ExportTask])
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 [ExportTask] [ExportTask] [ExportTask] [ExportTask]
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