{-# 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.CreateExportTask
-- 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)
--
-- Creates an export task, which allows you to efficiently export data from
-- a log group to an Amazon S3 bucket. When you perform a
-- @CreateExportTask@ operation, you must use credentials that have
-- permission to write to the S3 bucket that you specify as the
-- destination.
--
-- This is an asynchronous call. If all the required information is
-- provided, this operation initiates an export task and responds with the
-- ID of the task. After the task has started, you can use
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html DescribeExportTasks>
-- to get the status of the export task. Each account can only have one
-- active (@RUNNING@ or @PENDING@) export task at a time. To cancel an
-- export task, use
-- <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html CancelExportTask>.
--
-- You can export logs from multiple log groups or multiple time ranges to
-- the same S3 bucket. To separate out log data for each export task, you
-- can specify a prefix to be used as the Amazon S3 key prefix for all
-- exported objects.
--
-- Exporting to S3 buckets that are encrypted with AES-256 is supported.
-- Exporting to S3 buckets encrypted with SSE-KMS is not supported.
module Amazonka.CloudWatchLogs.CreateExportTask
  ( -- * Creating a Request
    CreateExportTask (..),
    newCreateExportTask,

    -- * Request Lenses
    createExportTask_destinationPrefix,
    createExportTask_taskName,
    createExportTask_logStreamNamePrefix,
    createExportTask_logGroupName,
    createExportTask_from,
    createExportTask_to,
    createExportTask_destination,

    -- * Destructuring the Response
    CreateExportTaskResponse (..),
    newCreateExportTaskResponse,

    -- * Response Lenses
    createExportTaskResponse_taskId,
    createExportTaskResponse_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:/ 'newCreateExportTask' smart constructor.
data CreateExportTask = CreateExportTask'
  { -- | The prefix used as the start of the key for every object exported. If
    -- you don\'t specify a value, the default is @exportedlogs@.
    CreateExportTask -> Maybe Text
destinationPrefix :: Prelude.Maybe Prelude.Text,
    -- | The name of the export task.
    CreateExportTask -> Maybe Text
taskName :: Prelude.Maybe Prelude.Text,
    -- | Export only log streams that match the provided prefix. If you don\'t
    -- specify a value, no prefix filter is applied.
    CreateExportTask -> Maybe Text
logStreamNamePrefix :: Prelude.Maybe Prelude.Text,
    -- | The name of the log group.
    CreateExportTask -> Text
logGroupName :: Prelude.Text,
    -- | The start time of the range for the request, expressed as the number of
    -- milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp
    -- earlier than this time are not exported.
    CreateExportTask -> Natural
from :: Prelude.Natural,
    -- | The end time of the range for the request, expreswatchlogsdocused as the
    -- number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a
    -- timestamp later than this time are not exported.
    CreateExportTask -> Natural
to :: Prelude.Natural,
    -- | The name of S3 bucket for the exported log data. The bucket must be in
    -- the same Amazon Web Services region.
    CreateExportTask -> Text
destination :: Prelude.Text
  }
  deriving (CreateExportTask -> CreateExportTask -> Bool
(CreateExportTask -> CreateExportTask -> Bool)
-> (CreateExportTask -> CreateExportTask -> Bool)
-> Eq CreateExportTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExportTask -> CreateExportTask -> Bool
$c/= :: CreateExportTask -> CreateExportTask -> Bool
== :: CreateExportTask -> CreateExportTask -> Bool
$c== :: CreateExportTask -> CreateExportTask -> Bool
Prelude.Eq, ReadPrec [CreateExportTask]
ReadPrec CreateExportTask
Int -> ReadS CreateExportTask
ReadS [CreateExportTask]
(Int -> ReadS CreateExportTask)
-> ReadS [CreateExportTask]
-> ReadPrec CreateExportTask
-> ReadPrec [CreateExportTask]
-> Read CreateExportTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExportTask]
$creadListPrec :: ReadPrec [CreateExportTask]
readPrec :: ReadPrec CreateExportTask
$creadPrec :: ReadPrec CreateExportTask
readList :: ReadS [CreateExportTask]
$creadList :: ReadS [CreateExportTask]
readsPrec :: Int -> ReadS CreateExportTask
$creadsPrec :: Int -> ReadS CreateExportTask
Prelude.Read, Int -> CreateExportTask -> ShowS
[CreateExportTask] -> ShowS
CreateExportTask -> String
(Int -> CreateExportTask -> ShowS)
-> (CreateExportTask -> String)
-> ([CreateExportTask] -> ShowS)
-> Show CreateExportTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExportTask] -> ShowS
$cshowList :: [CreateExportTask] -> ShowS
show :: CreateExportTask -> String
$cshow :: CreateExportTask -> String
showsPrec :: Int -> CreateExportTask -> ShowS
$cshowsPrec :: Int -> CreateExportTask -> ShowS
Prelude.Show, (forall x. CreateExportTask -> Rep CreateExportTask x)
-> (forall x. Rep CreateExportTask x -> CreateExportTask)
-> Generic CreateExportTask
forall x. Rep CreateExportTask x -> CreateExportTask
forall x. CreateExportTask -> Rep CreateExportTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateExportTask x -> CreateExportTask
$cfrom :: forall x. CreateExportTask -> Rep CreateExportTask x
Prelude.Generic)

-- |
-- Create a value of 'CreateExportTask' 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:
--
-- 'destinationPrefix', 'createExportTask_destinationPrefix' - The prefix used as the start of the key for every object exported. If
-- you don\'t specify a value, the default is @exportedlogs@.
--
-- 'taskName', 'createExportTask_taskName' - The name of the export task.
--
-- 'logStreamNamePrefix', 'createExportTask_logStreamNamePrefix' - Export only log streams that match the provided prefix. If you don\'t
-- specify a value, no prefix filter is applied.
--
-- 'logGroupName', 'createExportTask_logGroupName' - The name of the log group.
--
-- 'from', 'createExportTask_from' - The start time of the range for the request, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp
-- earlier than this time are not exported.
--
-- 'to', 'createExportTask_to' - The end time of the range for the request, expreswatchlogsdocused as the
-- number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a
-- timestamp later than this time are not exported.
--
-- 'destination', 'createExportTask_destination' - The name of S3 bucket for the exported log data. The bucket must be in
-- the same Amazon Web Services region.
newCreateExportTask ::
  -- | 'logGroupName'
  Prelude.Text ->
  -- | 'from'
  Prelude.Natural ->
  -- | 'to'
  Prelude.Natural ->
  -- | 'destination'
  Prelude.Text ->
  CreateExportTask
newCreateExportTask :: Text -> Natural -> Natural -> Text -> CreateExportTask
newCreateExportTask
  Text
pLogGroupName_
  Natural
pFrom_
  Natural
pTo_
  Text
pDestination_ =
    CreateExportTask' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Natural
-> Natural
-> Text
-> CreateExportTask
CreateExportTask'
      { $sel:destinationPrefix:CreateExportTask' :: Maybe Text
destinationPrefix =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:taskName:CreateExportTask' :: Maybe Text
taskName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:logStreamNamePrefix:CreateExportTask' :: Maybe Text
logStreamNamePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:logGroupName:CreateExportTask' :: Text
logGroupName = Text
pLogGroupName_,
        $sel:from:CreateExportTask' :: Natural
from = Natural
pFrom_,
        $sel:to:CreateExportTask' :: Natural
to = Natural
pTo_,
        $sel:destination:CreateExportTask' :: Text
destination = Text
pDestination_
      }

-- | The prefix used as the start of the key for every object exported. If
-- you don\'t specify a value, the default is @exportedlogs@.
createExportTask_destinationPrefix :: Lens.Lens' CreateExportTask (Prelude.Maybe Prelude.Text)
createExportTask_destinationPrefix :: (Maybe Text -> f (Maybe Text))
-> CreateExportTask -> f CreateExportTask
createExportTask_destinationPrefix = (CreateExportTask -> Maybe Text)
-> (CreateExportTask -> Maybe Text -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Maybe Text
destinationPrefix :: Maybe Text
$sel:destinationPrefix:CreateExportTask' :: CreateExportTask -> Maybe Text
destinationPrefix} -> Maybe Text
destinationPrefix) (\s :: CreateExportTask
s@CreateExportTask' {} Maybe Text
a -> CreateExportTask
s {$sel:destinationPrefix:CreateExportTask' :: Maybe Text
destinationPrefix = Maybe Text
a} :: CreateExportTask)

-- | The name of the export task.
createExportTask_taskName :: Lens.Lens' CreateExportTask (Prelude.Maybe Prelude.Text)
createExportTask_taskName :: (Maybe Text -> f (Maybe Text))
-> CreateExportTask -> f CreateExportTask
createExportTask_taskName = (CreateExportTask -> Maybe Text)
-> (CreateExportTask -> Maybe Text -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Maybe Text
taskName :: Maybe Text
$sel:taskName:CreateExportTask' :: CreateExportTask -> Maybe Text
taskName} -> Maybe Text
taskName) (\s :: CreateExportTask
s@CreateExportTask' {} Maybe Text
a -> CreateExportTask
s {$sel:taskName:CreateExportTask' :: Maybe Text
taskName = Maybe Text
a} :: CreateExportTask)

-- | Export only log streams that match the provided prefix. If you don\'t
-- specify a value, no prefix filter is applied.
createExportTask_logStreamNamePrefix :: Lens.Lens' CreateExportTask (Prelude.Maybe Prelude.Text)
createExportTask_logStreamNamePrefix :: (Maybe Text -> f (Maybe Text))
-> CreateExportTask -> f CreateExportTask
createExportTask_logStreamNamePrefix = (CreateExportTask -> Maybe Text)
-> (CreateExportTask -> Maybe Text -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Maybe Text
logStreamNamePrefix :: Maybe Text
$sel:logStreamNamePrefix:CreateExportTask' :: CreateExportTask -> Maybe Text
logStreamNamePrefix} -> Maybe Text
logStreamNamePrefix) (\s :: CreateExportTask
s@CreateExportTask' {} Maybe Text
a -> CreateExportTask
s {$sel:logStreamNamePrefix:CreateExportTask' :: Maybe Text
logStreamNamePrefix = Maybe Text
a} :: CreateExportTask)

-- | The name of the log group.
createExportTask_logGroupName :: Lens.Lens' CreateExportTask Prelude.Text
createExportTask_logGroupName :: (Text -> f Text) -> CreateExportTask -> f CreateExportTask
createExportTask_logGroupName = (CreateExportTask -> Text)
-> (CreateExportTask -> Text -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Text
logGroupName :: Text
$sel:logGroupName:CreateExportTask' :: CreateExportTask -> Text
logGroupName} -> Text
logGroupName) (\s :: CreateExportTask
s@CreateExportTask' {} Text
a -> CreateExportTask
s {$sel:logGroupName:CreateExportTask' :: Text
logGroupName = Text
a} :: CreateExportTask)

-- | The start time of the range for the request, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp
-- earlier than this time are not exported.
createExportTask_from :: Lens.Lens' CreateExportTask Prelude.Natural
createExportTask_from :: (Natural -> f Natural) -> CreateExportTask -> f CreateExportTask
createExportTask_from = (CreateExportTask -> Natural)
-> (CreateExportTask -> Natural -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Natural
from :: Natural
$sel:from:CreateExportTask' :: CreateExportTask -> Natural
from} -> Natural
from) (\s :: CreateExportTask
s@CreateExportTask' {} Natural
a -> CreateExportTask
s {$sel:from:CreateExportTask' :: Natural
from = Natural
a} :: CreateExportTask)

-- | The end time of the range for the request, expreswatchlogsdocused as the
-- number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a
-- timestamp later than this time are not exported.
createExportTask_to :: Lens.Lens' CreateExportTask Prelude.Natural
createExportTask_to :: (Natural -> f Natural) -> CreateExportTask -> f CreateExportTask
createExportTask_to = (CreateExportTask -> Natural)
-> (CreateExportTask -> Natural -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Natural
to :: Natural
$sel:to:CreateExportTask' :: CreateExportTask -> Natural
to} -> Natural
to) (\s :: CreateExportTask
s@CreateExportTask' {} Natural
a -> CreateExportTask
s {$sel:to:CreateExportTask' :: Natural
to = Natural
a} :: CreateExportTask)

-- | The name of S3 bucket for the exported log data. The bucket must be in
-- the same Amazon Web Services region.
createExportTask_destination :: Lens.Lens' CreateExportTask Prelude.Text
createExportTask_destination :: (Text -> f Text) -> CreateExportTask -> f CreateExportTask
createExportTask_destination = (CreateExportTask -> Text)
-> (CreateExportTask -> Text -> CreateExportTask)
-> Lens CreateExportTask CreateExportTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTask' {Text
destination :: Text
$sel:destination:CreateExportTask' :: CreateExportTask -> Text
destination} -> Text
destination) (\s :: CreateExportTask
s@CreateExportTask' {} Text
a -> CreateExportTask
s {$sel:destination:CreateExportTask' :: Text
destination = Text
a} :: CreateExportTask)

instance Core.AWSRequest CreateExportTask where
  type
    AWSResponse CreateExportTask =
      CreateExportTaskResponse
  request :: CreateExportTask -> Request CreateExportTask
request = Service -> CreateExportTask -> Request CreateExportTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateExportTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateExportTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateExportTask))
-> Logger
-> Service
-> Proxy CreateExportTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateExportTask)))
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 -> Int -> CreateExportTaskResponse
CreateExportTaskResponse'
            (Maybe Text -> Int -> CreateExportTaskResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateExportTaskResponse)
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
"taskId")
            Either String (Int -> CreateExportTaskResponse)
-> Either String Int -> Either String CreateExportTaskResponse
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 CreateExportTask

instance Prelude.NFData CreateExportTask

instance Core.ToHeaders CreateExportTask where
  toHeaders :: CreateExportTask -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateExportTask -> 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.CreateExportTask" ::
                          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 CreateExportTask where
  toJSON :: CreateExportTask -> Value
toJSON CreateExportTask' {Natural
Maybe Text
Text
destination :: Text
to :: Natural
from :: Natural
logGroupName :: Text
logStreamNamePrefix :: Maybe Text
taskName :: Maybe Text
destinationPrefix :: Maybe Text
$sel:destination:CreateExportTask' :: CreateExportTask -> Text
$sel:to:CreateExportTask' :: CreateExportTask -> Natural
$sel:from:CreateExportTask' :: CreateExportTask -> Natural
$sel:logGroupName:CreateExportTask' :: CreateExportTask -> Text
$sel:logStreamNamePrefix:CreateExportTask' :: CreateExportTask -> Maybe Text
$sel:taskName:CreateExportTask' :: CreateExportTask -> Maybe Text
$sel:destinationPrefix:CreateExportTask' :: CreateExportTask -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"destinationPrefix" 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
destinationPrefix,
            (Text
"taskName" 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
taskName,
            (Text
"logStreamNamePrefix" 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
logStreamNamePrefix,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logGroupName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"from" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
from),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"to" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
to),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"destination" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destination)
          ]
      )

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

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

-- | /See:/ 'newCreateExportTaskResponse' smart constructor.
data CreateExportTaskResponse = CreateExportTaskResponse'
  { -- | The ID of the export task.
    CreateExportTaskResponse -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateExportTaskResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateExportTaskResponse -> CreateExportTaskResponse -> Bool
(CreateExportTaskResponse -> CreateExportTaskResponse -> Bool)
-> (CreateExportTaskResponse -> CreateExportTaskResponse -> Bool)
-> Eq CreateExportTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExportTaskResponse -> CreateExportTaskResponse -> Bool
$c/= :: CreateExportTaskResponse -> CreateExportTaskResponse -> Bool
== :: CreateExportTaskResponse -> CreateExportTaskResponse -> Bool
$c== :: CreateExportTaskResponse -> CreateExportTaskResponse -> Bool
Prelude.Eq, ReadPrec [CreateExportTaskResponse]
ReadPrec CreateExportTaskResponse
Int -> ReadS CreateExportTaskResponse
ReadS [CreateExportTaskResponse]
(Int -> ReadS CreateExportTaskResponse)
-> ReadS [CreateExportTaskResponse]
-> ReadPrec CreateExportTaskResponse
-> ReadPrec [CreateExportTaskResponse]
-> Read CreateExportTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExportTaskResponse]
$creadListPrec :: ReadPrec [CreateExportTaskResponse]
readPrec :: ReadPrec CreateExportTaskResponse
$creadPrec :: ReadPrec CreateExportTaskResponse
readList :: ReadS [CreateExportTaskResponse]
$creadList :: ReadS [CreateExportTaskResponse]
readsPrec :: Int -> ReadS CreateExportTaskResponse
$creadsPrec :: Int -> ReadS CreateExportTaskResponse
Prelude.Read, Int -> CreateExportTaskResponse -> ShowS
[CreateExportTaskResponse] -> ShowS
CreateExportTaskResponse -> String
(Int -> CreateExportTaskResponse -> ShowS)
-> (CreateExportTaskResponse -> String)
-> ([CreateExportTaskResponse] -> ShowS)
-> Show CreateExportTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExportTaskResponse] -> ShowS
$cshowList :: [CreateExportTaskResponse] -> ShowS
show :: CreateExportTaskResponse -> String
$cshow :: CreateExportTaskResponse -> String
showsPrec :: Int -> CreateExportTaskResponse -> ShowS
$cshowsPrec :: Int -> CreateExportTaskResponse -> ShowS
Prelude.Show, (forall x.
 CreateExportTaskResponse -> Rep CreateExportTaskResponse x)
-> (forall x.
    Rep CreateExportTaskResponse x -> CreateExportTaskResponse)
-> Generic CreateExportTaskResponse
forall x.
Rep CreateExportTaskResponse x -> CreateExportTaskResponse
forall x.
CreateExportTaskResponse -> Rep CreateExportTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateExportTaskResponse x -> CreateExportTaskResponse
$cfrom :: forall x.
CreateExportTaskResponse -> Rep CreateExportTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateExportTaskResponse' 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', 'createExportTaskResponse_taskId' - The ID of the export task.
--
-- 'httpStatus', 'createExportTaskResponse_httpStatus' - The response's http status code.
newCreateExportTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateExportTaskResponse
newCreateExportTaskResponse :: Int -> CreateExportTaskResponse
newCreateExportTaskResponse Int
pHttpStatus_ =
  CreateExportTaskResponse' :: Maybe Text -> Int -> CreateExportTaskResponse
CreateExportTaskResponse'
    { $sel:taskId:CreateExportTaskResponse' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateExportTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the export task.
createExportTaskResponse_taskId :: Lens.Lens' CreateExportTaskResponse (Prelude.Maybe Prelude.Text)
createExportTaskResponse_taskId :: (Maybe Text -> f (Maybe Text))
-> CreateExportTaskResponse -> f CreateExportTaskResponse
createExportTaskResponse_taskId = (CreateExportTaskResponse -> Maybe Text)
-> (CreateExportTaskResponse
    -> Maybe Text -> CreateExportTaskResponse)
-> Lens
     CreateExportTaskResponse
     CreateExportTaskResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExportTaskResponse' {Maybe Text
taskId :: Maybe Text
$sel:taskId:CreateExportTaskResponse' :: CreateExportTaskResponse -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: CreateExportTaskResponse
s@CreateExportTaskResponse' {} Maybe Text
a -> CreateExportTaskResponse
s {$sel:taskId:CreateExportTaskResponse' :: Maybe Text
taskId = Maybe Text
a} :: CreateExportTaskResponse)

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

instance Prelude.NFData CreateExportTaskResponse