{-# 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.GetSamplingStatisticSummaries
-- 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 information about recent sampling results for all sampling
-- rules.
--
-- This operation returns paginated results.
module Amazonka.XRay.GetSamplingStatisticSummaries
  ( -- * Creating a Request
    GetSamplingStatisticSummaries (..),
    newGetSamplingStatisticSummaries,

    -- * Request Lenses
    getSamplingStatisticSummaries_nextToken,

    -- * Destructuring the Response
    GetSamplingStatisticSummariesResponse (..),
    newGetSamplingStatisticSummariesResponse,

    -- * Response Lenses
    getSamplingStatisticSummariesResponse_samplingStatisticSummaries,
    getSamplingStatisticSummariesResponse_nextToken,
    getSamplingStatisticSummariesResponse_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:/ 'newGetSamplingStatisticSummaries' smart constructor.
data GetSamplingStatisticSummaries = GetSamplingStatisticSummaries'
  { -- | Pagination token.
    GetSamplingStatisticSummaries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetSamplingStatisticSummaries
-> GetSamplingStatisticSummaries -> Bool
(GetSamplingStatisticSummaries
 -> GetSamplingStatisticSummaries -> Bool)
-> (GetSamplingStatisticSummaries
    -> GetSamplingStatisticSummaries -> Bool)
-> Eq GetSamplingStatisticSummaries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSamplingStatisticSummaries
-> GetSamplingStatisticSummaries -> Bool
$c/= :: GetSamplingStatisticSummaries
-> GetSamplingStatisticSummaries -> Bool
== :: GetSamplingStatisticSummaries
-> GetSamplingStatisticSummaries -> Bool
$c== :: GetSamplingStatisticSummaries
-> GetSamplingStatisticSummaries -> Bool
Prelude.Eq, ReadPrec [GetSamplingStatisticSummaries]
ReadPrec GetSamplingStatisticSummaries
Int -> ReadS GetSamplingStatisticSummaries
ReadS [GetSamplingStatisticSummaries]
(Int -> ReadS GetSamplingStatisticSummaries)
-> ReadS [GetSamplingStatisticSummaries]
-> ReadPrec GetSamplingStatisticSummaries
-> ReadPrec [GetSamplingStatisticSummaries]
-> Read GetSamplingStatisticSummaries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSamplingStatisticSummaries]
$creadListPrec :: ReadPrec [GetSamplingStatisticSummaries]
readPrec :: ReadPrec GetSamplingStatisticSummaries
$creadPrec :: ReadPrec GetSamplingStatisticSummaries
readList :: ReadS [GetSamplingStatisticSummaries]
$creadList :: ReadS [GetSamplingStatisticSummaries]
readsPrec :: Int -> ReadS GetSamplingStatisticSummaries
$creadsPrec :: Int -> ReadS GetSamplingStatisticSummaries
Prelude.Read, Int -> GetSamplingStatisticSummaries -> ShowS
[GetSamplingStatisticSummaries] -> ShowS
GetSamplingStatisticSummaries -> String
(Int -> GetSamplingStatisticSummaries -> ShowS)
-> (GetSamplingStatisticSummaries -> String)
-> ([GetSamplingStatisticSummaries] -> ShowS)
-> Show GetSamplingStatisticSummaries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSamplingStatisticSummaries] -> ShowS
$cshowList :: [GetSamplingStatisticSummaries] -> ShowS
show :: GetSamplingStatisticSummaries -> String
$cshow :: GetSamplingStatisticSummaries -> String
showsPrec :: Int -> GetSamplingStatisticSummaries -> ShowS
$cshowsPrec :: Int -> GetSamplingStatisticSummaries -> ShowS
Prelude.Show, (forall x.
 GetSamplingStatisticSummaries
 -> Rep GetSamplingStatisticSummaries x)
-> (forall x.
    Rep GetSamplingStatisticSummaries x
    -> GetSamplingStatisticSummaries)
-> Generic GetSamplingStatisticSummaries
forall x.
Rep GetSamplingStatisticSummaries x
-> GetSamplingStatisticSummaries
forall x.
GetSamplingStatisticSummaries
-> Rep GetSamplingStatisticSummaries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSamplingStatisticSummaries x
-> GetSamplingStatisticSummaries
$cfrom :: forall x.
GetSamplingStatisticSummaries
-> Rep GetSamplingStatisticSummaries x
Prelude.Generic)

-- |
-- Create a value of 'GetSamplingStatisticSummaries' 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', 'getSamplingStatisticSummaries_nextToken' - Pagination token.
newGetSamplingStatisticSummaries ::
  GetSamplingStatisticSummaries
newGetSamplingStatisticSummaries :: GetSamplingStatisticSummaries
newGetSamplingStatisticSummaries =
  GetSamplingStatisticSummaries' :: Maybe Text -> GetSamplingStatisticSummaries
GetSamplingStatisticSummaries'
    { $sel:nextToken:GetSamplingStatisticSummaries' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Prelude.NFData GetSamplingStatisticSummaries

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

instance Core.ToJSON GetSamplingStatisticSummaries where
  toJSON :: GetSamplingStatisticSummaries -> Value
toJSON GetSamplingStatisticSummaries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSamplingStatisticSummaries' :: GetSamplingStatisticSummaries -> 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]
      )

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

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

-- | /See:/ 'newGetSamplingStatisticSummariesResponse' smart constructor.
data GetSamplingStatisticSummariesResponse = GetSamplingStatisticSummariesResponse'
  { -- | Information about the number of requests instrumented for each sampling
    -- rule.
    GetSamplingStatisticSummariesResponse
-> Maybe [SamplingStatisticSummary]
samplingStatisticSummaries :: Prelude.Maybe [SamplingStatisticSummary],
    -- | Pagination token.
    GetSamplingStatisticSummariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSamplingStatisticSummariesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSamplingStatisticSummariesResponse
-> GetSamplingStatisticSummariesResponse -> Bool
(GetSamplingStatisticSummariesResponse
 -> GetSamplingStatisticSummariesResponse -> Bool)
-> (GetSamplingStatisticSummariesResponse
    -> GetSamplingStatisticSummariesResponse -> Bool)
-> Eq GetSamplingStatisticSummariesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSamplingStatisticSummariesResponse
-> GetSamplingStatisticSummariesResponse -> Bool
$c/= :: GetSamplingStatisticSummariesResponse
-> GetSamplingStatisticSummariesResponse -> Bool
== :: GetSamplingStatisticSummariesResponse
-> GetSamplingStatisticSummariesResponse -> Bool
$c== :: GetSamplingStatisticSummariesResponse
-> GetSamplingStatisticSummariesResponse -> Bool
Prelude.Eq, ReadPrec [GetSamplingStatisticSummariesResponse]
ReadPrec GetSamplingStatisticSummariesResponse
Int -> ReadS GetSamplingStatisticSummariesResponse
ReadS [GetSamplingStatisticSummariesResponse]
(Int -> ReadS GetSamplingStatisticSummariesResponse)
-> ReadS [GetSamplingStatisticSummariesResponse]
-> ReadPrec GetSamplingStatisticSummariesResponse
-> ReadPrec [GetSamplingStatisticSummariesResponse]
-> Read GetSamplingStatisticSummariesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSamplingStatisticSummariesResponse]
$creadListPrec :: ReadPrec [GetSamplingStatisticSummariesResponse]
readPrec :: ReadPrec GetSamplingStatisticSummariesResponse
$creadPrec :: ReadPrec GetSamplingStatisticSummariesResponse
readList :: ReadS [GetSamplingStatisticSummariesResponse]
$creadList :: ReadS [GetSamplingStatisticSummariesResponse]
readsPrec :: Int -> ReadS GetSamplingStatisticSummariesResponse
$creadsPrec :: Int -> ReadS GetSamplingStatisticSummariesResponse
Prelude.Read, Int -> GetSamplingStatisticSummariesResponse -> ShowS
[GetSamplingStatisticSummariesResponse] -> ShowS
GetSamplingStatisticSummariesResponse -> String
(Int -> GetSamplingStatisticSummariesResponse -> ShowS)
-> (GetSamplingStatisticSummariesResponse -> String)
-> ([GetSamplingStatisticSummariesResponse] -> ShowS)
-> Show GetSamplingStatisticSummariesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSamplingStatisticSummariesResponse] -> ShowS
$cshowList :: [GetSamplingStatisticSummariesResponse] -> ShowS
show :: GetSamplingStatisticSummariesResponse -> String
$cshow :: GetSamplingStatisticSummariesResponse -> String
showsPrec :: Int -> GetSamplingStatisticSummariesResponse -> ShowS
$cshowsPrec :: Int -> GetSamplingStatisticSummariesResponse -> ShowS
Prelude.Show, (forall x.
 GetSamplingStatisticSummariesResponse
 -> Rep GetSamplingStatisticSummariesResponse x)
-> (forall x.
    Rep GetSamplingStatisticSummariesResponse x
    -> GetSamplingStatisticSummariesResponse)
-> Generic GetSamplingStatisticSummariesResponse
forall x.
Rep GetSamplingStatisticSummariesResponse x
-> GetSamplingStatisticSummariesResponse
forall x.
GetSamplingStatisticSummariesResponse
-> Rep GetSamplingStatisticSummariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSamplingStatisticSummariesResponse x
-> GetSamplingStatisticSummariesResponse
$cfrom :: forall x.
GetSamplingStatisticSummariesResponse
-> Rep GetSamplingStatisticSummariesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSamplingStatisticSummariesResponse' 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:
--
-- 'samplingStatisticSummaries', 'getSamplingStatisticSummariesResponse_samplingStatisticSummaries' - Information about the number of requests instrumented for each sampling
-- rule.
--
-- 'nextToken', 'getSamplingStatisticSummariesResponse_nextToken' - Pagination token.
--
-- 'httpStatus', 'getSamplingStatisticSummariesResponse_httpStatus' - The response's http status code.
newGetSamplingStatisticSummariesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSamplingStatisticSummariesResponse
newGetSamplingStatisticSummariesResponse :: Int -> GetSamplingStatisticSummariesResponse
newGetSamplingStatisticSummariesResponse Int
pHttpStatus_ =
  GetSamplingStatisticSummariesResponse' :: Maybe [SamplingStatisticSummary]
-> Maybe Text -> Int -> GetSamplingStatisticSummariesResponse
GetSamplingStatisticSummariesResponse'
    { $sel:samplingStatisticSummaries:GetSamplingStatisticSummariesResponse' :: Maybe [SamplingStatisticSummary]
samplingStatisticSummaries =
        Maybe [SamplingStatisticSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetSamplingStatisticSummariesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSamplingStatisticSummariesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the number of requests instrumented for each sampling
-- rule.
getSamplingStatisticSummariesResponse_samplingStatisticSummaries :: Lens.Lens' GetSamplingStatisticSummariesResponse (Prelude.Maybe [SamplingStatisticSummary])
getSamplingStatisticSummariesResponse_samplingStatisticSummaries :: (Maybe [SamplingStatisticSummary]
 -> f (Maybe [SamplingStatisticSummary]))
-> GetSamplingStatisticSummariesResponse
-> f GetSamplingStatisticSummariesResponse
getSamplingStatisticSummariesResponse_samplingStatisticSummaries = (GetSamplingStatisticSummariesResponse
 -> Maybe [SamplingStatisticSummary])
-> (GetSamplingStatisticSummariesResponse
    -> Maybe [SamplingStatisticSummary]
    -> GetSamplingStatisticSummariesResponse)
-> Lens'
     GetSamplingStatisticSummariesResponse
     (Maybe [SamplingStatisticSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSamplingStatisticSummariesResponse' {Maybe [SamplingStatisticSummary]
samplingStatisticSummaries :: Maybe [SamplingStatisticSummary]
$sel:samplingStatisticSummaries:GetSamplingStatisticSummariesResponse' :: GetSamplingStatisticSummariesResponse
-> Maybe [SamplingStatisticSummary]
samplingStatisticSummaries} -> Maybe [SamplingStatisticSummary]
samplingStatisticSummaries) (\s :: GetSamplingStatisticSummariesResponse
s@GetSamplingStatisticSummariesResponse' {} Maybe [SamplingStatisticSummary]
a -> GetSamplingStatisticSummariesResponse
s {$sel:samplingStatisticSummaries:GetSamplingStatisticSummariesResponse' :: Maybe [SamplingStatisticSummary]
samplingStatisticSummaries = Maybe [SamplingStatisticSummary]
a} :: GetSamplingStatisticSummariesResponse) ((Maybe [SamplingStatisticSummary]
  -> f (Maybe [SamplingStatisticSummary]))
 -> GetSamplingStatisticSummariesResponse
 -> f GetSamplingStatisticSummariesResponse)
-> ((Maybe [SamplingStatisticSummary]
     -> f (Maybe [SamplingStatisticSummary]))
    -> Maybe [SamplingStatisticSummary]
    -> f (Maybe [SamplingStatisticSummary]))
-> (Maybe [SamplingStatisticSummary]
    -> f (Maybe [SamplingStatisticSummary]))
-> GetSamplingStatisticSummariesResponse
-> f GetSamplingStatisticSummariesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
-> Iso
     (Maybe [SamplingStatisticSummary])
     (Maybe [SamplingStatisticSummary])
     (Maybe [SamplingStatisticSummary])
     (Maybe [SamplingStatisticSummary])
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
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
  [SamplingStatisticSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    GetSamplingStatisticSummariesResponse