{-# 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.XRay.BatchGetTraces
-- 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)
--
-- Retrieves a list of traces specified by ID. Each trace is a collection
-- of segment documents that originates from a single request. Use
-- @GetTraceSummaries@ to get a list of trace IDs.
--
-- This operation returns paginated results.
module Amazonka.XRay.BatchGetTraces
  ( -- * Creating a Request
    BatchGetTraces (..),
    newBatchGetTraces,

    -- * Request Lenses
    batchGetTraces_nextToken,
    batchGetTraces_traceIds,

    -- * Destructuring the Response
    BatchGetTracesResponse (..),
    newBatchGetTracesResponse,

    -- * Response Lenses
    batchGetTracesResponse_nextToken,
    batchGetTracesResponse_traces,
    batchGetTracesResponse_unprocessedTraceIds,
    batchGetTracesResponse_httpStatus,
  )
where

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
import Amazonka.XRay.Types

-- | /See:/ 'newBatchGetTraces' smart constructor.
data BatchGetTraces = BatchGetTraces'
  { -- | Pagination token.
    BatchGetTraces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specify the trace IDs of requests for which to retrieve segments.
    BatchGetTraces -> [Text]
traceIds :: [Prelude.Text]
  }
  deriving (BatchGetTraces -> BatchGetTraces -> Bool
(BatchGetTraces -> BatchGetTraces -> Bool)
-> (BatchGetTraces -> BatchGetTraces -> Bool) -> Eq BatchGetTraces
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetTraces -> BatchGetTraces -> Bool
$c/= :: BatchGetTraces -> BatchGetTraces -> Bool
== :: BatchGetTraces -> BatchGetTraces -> Bool
$c== :: BatchGetTraces -> BatchGetTraces -> Bool
Prelude.Eq, ReadPrec [BatchGetTraces]
ReadPrec BatchGetTraces
Int -> ReadS BatchGetTraces
ReadS [BatchGetTraces]
(Int -> ReadS BatchGetTraces)
-> ReadS [BatchGetTraces]
-> ReadPrec BatchGetTraces
-> ReadPrec [BatchGetTraces]
-> Read BatchGetTraces
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetTraces]
$creadListPrec :: ReadPrec [BatchGetTraces]
readPrec :: ReadPrec BatchGetTraces
$creadPrec :: ReadPrec BatchGetTraces
readList :: ReadS [BatchGetTraces]
$creadList :: ReadS [BatchGetTraces]
readsPrec :: Int -> ReadS BatchGetTraces
$creadsPrec :: Int -> ReadS BatchGetTraces
Prelude.Read, Int -> BatchGetTraces -> ShowS
[BatchGetTraces] -> ShowS
BatchGetTraces -> String
(Int -> BatchGetTraces -> ShowS)
-> (BatchGetTraces -> String)
-> ([BatchGetTraces] -> ShowS)
-> Show BatchGetTraces
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetTraces] -> ShowS
$cshowList :: [BatchGetTraces] -> ShowS
show :: BatchGetTraces -> String
$cshow :: BatchGetTraces -> String
showsPrec :: Int -> BatchGetTraces -> ShowS
$cshowsPrec :: Int -> BatchGetTraces -> ShowS
Prelude.Show, (forall x. BatchGetTraces -> Rep BatchGetTraces x)
-> (forall x. Rep BatchGetTraces x -> BatchGetTraces)
-> Generic BatchGetTraces
forall x. Rep BatchGetTraces x -> BatchGetTraces
forall x. BatchGetTraces -> Rep BatchGetTraces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetTraces x -> BatchGetTraces
$cfrom :: forall x. BatchGetTraces -> Rep BatchGetTraces x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetTraces' 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', 'batchGetTraces_nextToken' - Pagination token.
--
-- 'traceIds', 'batchGetTraces_traceIds' - Specify the trace IDs of requests for which to retrieve segments.
newBatchGetTraces ::
  BatchGetTraces
newBatchGetTraces :: BatchGetTraces
newBatchGetTraces =
  BatchGetTraces' :: Maybe Text -> [Text] -> BatchGetTraces
BatchGetTraces'
    { $sel:nextToken:BatchGetTraces' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:traceIds:BatchGetTraces' :: [Text]
traceIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Pagination token.
batchGetTraces_nextToken :: Lens.Lens' BatchGetTraces (Prelude.Maybe Prelude.Text)
batchGetTraces_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchGetTraces -> f BatchGetTraces
batchGetTraces_nextToken = (BatchGetTraces -> Maybe Text)
-> (BatchGetTraces -> Maybe Text -> BatchGetTraces)
-> Lens BatchGetTraces BatchGetTraces (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTraces' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchGetTraces' :: BatchGetTraces -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchGetTraces
s@BatchGetTraces' {} Maybe Text
a -> BatchGetTraces
s {$sel:nextToken:BatchGetTraces' :: Maybe Text
nextToken = Maybe Text
a} :: BatchGetTraces)

-- | Specify the trace IDs of requests for which to retrieve segments.
batchGetTraces_traceIds :: Lens.Lens' BatchGetTraces [Prelude.Text]
batchGetTraces_traceIds :: ([Text] -> f [Text]) -> BatchGetTraces -> f BatchGetTraces
batchGetTraces_traceIds = (BatchGetTraces -> [Text])
-> (BatchGetTraces -> [Text] -> BatchGetTraces)
-> Lens BatchGetTraces BatchGetTraces [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTraces' {[Text]
traceIds :: [Text]
$sel:traceIds:BatchGetTraces' :: BatchGetTraces -> [Text]
traceIds} -> [Text]
traceIds) (\s :: BatchGetTraces
s@BatchGetTraces' {} [Text]
a -> BatchGetTraces
s {$sel:traceIds:BatchGetTraces' :: [Text]
traceIds = [Text]
a} :: BatchGetTraces) (([Text] -> f [Text]) -> BatchGetTraces -> f BatchGetTraces)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchGetTraces
-> f BatchGetTraces
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager BatchGetTraces where
  page :: BatchGetTraces
-> AWSResponse BatchGetTraces -> Maybe BatchGetTraces
page BatchGetTraces
rq AWSResponse BatchGetTraces
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse BatchGetTraces
BatchGetTracesResponse
rs
            BatchGetTracesResponse
-> Getting (First Text) BatchGetTracesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> BatchGetTracesResponse
-> Const (First Text) BatchGetTracesResponse
Lens' BatchGetTracesResponse (Maybe Text)
batchGetTracesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> BatchGetTracesResponse
 -> Const (First Text) BatchGetTracesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) BatchGetTracesResponse 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 BatchGetTraces
forall a. Maybe a
Prelude.Nothing
    | Maybe [Trace] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse BatchGetTraces
BatchGetTracesResponse
rs
            BatchGetTracesResponse
-> Getting (First [Trace]) BatchGetTracesResponse [Trace]
-> Maybe [Trace]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Trace] -> Const (First [Trace]) (Maybe [Trace]))
-> BatchGetTracesResponse
-> Const (First [Trace]) BatchGetTracesResponse
Lens' BatchGetTracesResponse (Maybe [Trace])
batchGetTracesResponse_traces ((Maybe [Trace] -> Const (First [Trace]) (Maybe [Trace]))
 -> BatchGetTracesResponse
 -> Const (First [Trace]) BatchGetTracesResponse)
-> (([Trace] -> Const (First [Trace]) [Trace])
    -> Maybe [Trace] -> Const (First [Trace]) (Maybe [Trace]))
-> Getting (First [Trace]) BatchGetTracesResponse [Trace]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Trace] -> Const (First [Trace]) [Trace])
-> Maybe [Trace] -> Const (First [Trace]) (Maybe [Trace])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe BatchGetTraces
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      BatchGetTraces -> Maybe BatchGetTraces
forall a. a -> Maybe a
Prelude.Just (BatchGetTraces -> Maybe BatchGetTraces)
-> BatchGetTraces -> Maybe BatchGetTraces
forall a b. (a -> b) -> a -> b
Prelude.$
        BatchGetTraces
rq
          BatchGetTraces
-> (BatchGetTraces -> BatchGetTraces) -> BatchGetTraces
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> BatchGetTraces -> Identity BatchGetTraces
Lens BatchGetTraces BatchGetTraces (Maybe Text) (Maybe Text)
batchGetTraces_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> BatchGetTraces -> Identity BatchGetTraces)
-> Maybe Text -> BatchGetTraces -> BatchGetTraces
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse BatchGetTraces
BatchGetTracesResponse
rs
          BatchGetTracesResponse
-> Getting (First Text) BatchGetTracesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> BatchGetTracesResponse
-> Const (First Text) BatchGetTracesResponse
Lens' BatchGetTracesResponse (Maybe Text)
batchGetTracesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> BatchGetTracesResponse
 -> Const (First Text) BatchGetTracesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) BatchGetTracesResponse 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 BatchGetTraces where
  type
    AWSResponse BatchGetTraces =
      BatchGetTracesResponse
  request :: BatchGetTraces -> Request BatchGetTraces
request = Service -> BatchGetTraces -> Request BatchGetTraces
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchGetTraces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchGetTraces)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchGetTraces))
-> Logger
-> Service
-> Proxy BatchGetTraces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchGetTraces)))
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 [Trace] -> Maybe [Text] -> Int -> BatchGetTracesResponse
BatchGetTracesResponse'
            (Maybe Text
 -> Maybe [Trace] -> Maybe [Text] -> Int -> BatchGetTracesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Trace] -> Maybe [Text] -> Int -> BatchGetTracesResponse)
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 [Trace] -> Maybe [Text] -> Int -> BatchGetTracesResponse)
-> Either String (Maybe [Trace])
-> Either String (Maybe [Text] -> Int -> BatchGetTracesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Trace]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Traces" Either String (Maybe (Maybe [Trace]))
-> Maybe [Trace] -> Either String (Maybe [Trace])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Trace]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe [Text] -> Int -> BatchGetTracesResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> BatchGetTracesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UnprocessedTraceIds"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> BatchGetTracesResponse)
-> Either String Int -> Either String BatchGetTracesResponse
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 BatchGetTraces

instance Prelude.NFData BatchGetTraces

instance Core.ToHeaders BatchGetTraces where
  toHeaders :: BatchGetTraces -> ResponseHeaders
toHeaders = ResponseHeaders -> BatchGetTraces -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON BatchGetTraces where
  toJSON :: BatchGetTraces -> Value
toJSON BatchGetTraces' {[Text]
Maybe Text
traceIds :: [Text]
nextToken :: Maybe Text
$sel:traceIds:BatchGetTraces' :: BatchGetTraces -> [Text]
$sel:nextToken:BatchGetTraces' :: BatchGetTraces -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TraceIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
traceIds)
          ]
      )

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

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

-- | /See:/ 'newBatchGetTracesResponse' smart constructor.
data BatchGetTracesResponse = BatchGetTracesResponse'
  { -- | Pagination token.
    BatchGetTracesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Full traces for the specified requests.
    BatchGetTracesResponse -> Maybe [Trace]
traces :: Prelude.Maybe [Trace],
    -- | Trace IDs of requests that haven\'t been processed.
    BatchGetTracesResponse -> Maybe [Text]
unprocessedTraceIds :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    BatchGetTracesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchGetTracesResponse -> BatchGetTracesResponse -> Bool
(BatchGetTracesResponse -> BatchGetTracesResponse -> Bool)
-> (BatchGetTracesResponse -> BatchGetTracesResponse -> Bool)
-> Eq BatchGetTracesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetTracesResponse -> BatchGetTracesResponse -> Bool
$c/= :: BatchGetTracesResponse -> BatchGetTracesResponse -> Bool
== :: BatchGetTracesResponse -> BatchGetTracesResponse -> Bool
$c== :: BatchGetTracesResponse -> BatchGetTracesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetTracesResponse]
ReadPrec BatchGetTracesResponse
Int -> ReadS BatchGetTracesResponse
ReadS [BatchGetTracesResponse]
(Int -> ReadS BatchGetTracesResponse)
-> ReadS [BatchGetTracesResponse]
-> ReadPrec BatchGetTracesResponse
-> ReadPrec [BatchGetTracesResponse]
-> Read BatchGetTracesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetTracesResponse]
$creadListPrec :: ReadPrec [BatchGetTracesResponse]
readPrec :: ReadPrec BatchGetTracesResponse
$creadPrec :: ReadPrec BatchGetTracesResponse
readList :: ReadS [BatchGetTracesResponse]
$creadList :: ReadS [BatchGetTracesResponse]
readsPrec :: Int -> ReadS BatchGetTracesResponse
$creadsPrec :: Int -> ReadS BatchGetTracesResponse
Prelude.Read, Int -> BatchGetTracesResponse -> ShowS
[BatchGetTracesResponse] -> ShowS
BatchGetTracesResponse -> String
(Int -> BatchGetTracesResponse -> ShowS)
-> (BatchGetTracesResponse -> String)
-> ([BatchGetTracesResponse] -> ShowS)
-> Show BatchGetTracesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetTracesResponse] -> ShowS
$cshowList :: [BatchGetTracesResponse] -> ShowS
show :: BatchGetTracesResponse -> String
$cshow :: BatchGetTracesResponse -> String
showsPrec :: Int -> BatchGetTracesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetTracesResponse -> ShowS
Prelude.Show, (forall x. BatchGetTracesResponse -> Rep BatchGetTracesResponse x)
-> (forall x.
    Rep BatchGetTracesResponse x -> BatchGetTracesResponse)
-> Generic BatchGetTracesResponse
forall x. Rep BatchGetTracesResponse x -> BatchGetTracesResponse
forall x. BatchGetTracesResponse -> Rep BatchGetTracesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetTracesResponse x -> BatchGetTracesResponse
$cfrom :: forall x. BatchGetTracesResponse -> Rep BatchGetTracesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetTracesResponse' 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', 'batchGetTracesResponse_nextToken' - Pagination token.
--
-- 'traces', 'batchGetTracesResponse_traces' - Full traces for the specified requests.
--
-- 'unprocessedTraceIds', 'batchGetTracesResponse_unprocessedTraceIds' - Trace IDs of requests that haven\'t been processed.
--
-- 'httpStatus', 'batchGetTracesResponse_httpStatus' - The response's http status code.
newBatchGetTracesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchGetTracesResponse
newBatchGetTracesResponse :: Int -> BatchGetTracesResponse
newBatchGetTracesResponse Int
pHttpStatus_ =
  BatchGetTracesResponse' :: Maybe Text
-> Maybe [Trace] -> Maybe [Text] -> Int -> BatchGetTracesResponse
BatchGetTracesResponse'
    { $sel:nextToken:BatchGetTracesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:traces:BatchGetTracesResponse' :: Maybe [Trace]
traces = Maybe [Trace]
forall a. Maybe a
Prelude.Nothing,
      $sel:unprocessedTraceIds:BatchGetTracesResponse' :: Maybe [Text]
unprocessedTraceIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchGetTracesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Pagination token.
batchGetTracesResponse_nextToken :: Lens.Lens' BatchGetTracesResponse (Prelude.Maybe Prelude.Text)
batchGetTracesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchGetTracesResponse -> f BatchGetTracesResponse
batchGetTracesResponse_nextToken = (BatchGetTracesResponse -> Maybe Text)
-> (BatchGetTracesResponse -> Maybe Text -> BatchGetTracesResponse)
-> Lens' BatchGetTracesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTracesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchGetTracesResponse' :: BatchGetTracesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchGetTracesResponse
s@BatchGetTracesResponse' {} Maybe Text
a -> BatchGetTracesResponse
s {$sel:nextToken:BatchGetTracesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: BatchGetTracesResponse)

-- | Full traces for the specified requests.
batchGetTracesResponse_traces :: Lens.Lens' BatchGetTracesResponse (Prelude.Maybe [Trace])
batchGetTracesResponse_traces :: (Maybe [Trace] -> f (Maybe [Trace]))
-> BatchGetTracesResponse -> f BatchGetTracesResponse
batchGetTracesResponse_traces = (BatchGetTracesResponse -> Maybe [Trace])
-> (BatchGetTracesResponse
    -> Maybe [Trace] -> BatchGetTracesResponse)
-> Lens' BatchGetTracesResponse (Maybe [Trace])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTracesResponse' {Maybe [Trace]
traces :: Maybe [Trace]
$sel:traces:BatchGetTracesResponse' :: BatchGetTracesResponse -> Maybe [Trace]
traces} -> Maybe [Trace]
traces) (\s :: BatchGetTracesResponse
s@BatchGetTracesResponse' {} Maybe [Trace]
a -> BatchGetTracesResponse
s {$sel:traces:BatchGetTracesResponse' :: Maybe [Trace]
traces = Maybe [Trace]
a} :: BatchGetTracesResponse) ((Maybe [Trace] -> f (Maybe [Trace]))
 -> BatchGetTracesResponse -> f BatchGetTracesResponse)
-> ((Maybe [Trace] -> f (Maybe [Trace]))
    -> Maybe [Trace] -> f (Maybe [Trace]))
-> (Maybe [Trace] -> f (Maybe [Trace]))
-> BatchGetTracesResponse
-> f BatchGetTracesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Trace] [Trace] [Trace] [Trace]
-> Iso
     (Maybe [Trace]) (Maybe [Trace]) (Maybe [Trace]) (Maybe [Trace])
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 [Trace] [Trace] [Trace] [Trace]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Trace IDs of requests that haven\'t been processed.
batchGetTracesResponse_unprocessedTraceIds :: Lens.Lens' BatchGetTracesResponse (Prelude.Maybe [Prelude.Text])
batchGetTracesResponse_unprocessedTraceIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchGetTracesResponse -> f BatchGetTracesResponse
batchGetTracesResponse_unprocessedTraceIds = (BatchGetTracesResponse -> Maybe [Text])
-> (BatchGetTracesResponse
    -> Maybe [Text] -> BatchGetTracesResponse)
-> Lens
     BatchGetTracesResponse
     BatchGetTracesResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTracesResponse' {Maybe [Text]
unprocessedTraceIds :: Maybe [Text]
$sel:unprocessedTraceIds:BatchGetTracesResponse' :: BatchGetTracesResponse -> Maybe [Text]
unprocessedTraceIds} -> Maybe [Text]
unprocessedTraceIds) (\s :: BatchGetTracesResponse
s@BatchGetTracesResponse' {} Maybe [Text]
a -> BatchGetTracesResponse
s {$sel:unprocessedTraceIds:BatchGetTracesResponse' :: Maybe [Text]
unprocessedTraceIds = Maybe [Text]
a} :: BatchGetTracesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchGetTracesResponse -> f BatchGetTracesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchGetTracesResponse
-> f BatchGetTracesResponse
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 response's http status code.
batchGetTracesResponse_httpStatus :: Lens.Lens' BatchGetTracesResponse Prelude.Int
batchGetTracesResponse_httpStatus :: (Int -> f Int)
-> BatchGetTracesResponse -> f BatchGetTracesResponse
batchGetTracesResponse_httpStatus = (BatchGetTracesResponse -> Int)
-> (BatchGetTracesResponse -> Int -> BatchGetTracesResponse)
-> Lens BatchGetTracesResponse BatchGetTracesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetTracesResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetTracesResponse' :: BatchGetTracesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetTracesResponse
s@BatchGetTracesResponse' {} Int
a -> BatchGetTracesResponse
s {$sel:httpStatus:BatchGetTracesResponse' :: Int
httpStatus = Int
a} :: BatchGetTracesResponse)

instance Prelude.NFData BatchGetTracesResponse