{-# 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.GetSamplingTargets
-- 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)
--
-- Requests a sampling quota for rules that the service is using to sample
-- requests.
module Amazonka.XRay.GetSamplingTargets
  ( -- * Creating a Request
    GetSamplingTargets (..),
    newGetSamplingTargets,

    -- * Request Lenses
    getSamplingTargets_samplingStatisticsDocuments,

    -- * Destructuring the Response
    GetSamplingTargetsResponse (..),
    newGetSamplingTargetsResponse,

    -- * Response Lenses
    getSamplingTargetsResponse_unprocessedStatistics,
    getSamplingTargetsResponse_lastRuleModification,
    getSamplingTargetsResponse_samplingTargetDocuments,
    getSamplingTargetsResponse_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:/ 'newGetSamplingTargets' smart constructor.
data GetSamplingTargets = GetSamplingTargets'
  { -- | Information about rules that the service is using to sample requests.
    GetSamplingTargets -> [SamplingStatisticsDocument]
samplingStatisticsDocuments :: [SamplingStatisticsDocument]
  }
  deriving (GetSamplingTargets -> GetSamplingTargets -> Bool
(GetSamplingTargets -> GetSamplingTargets -> Bool)
-> (GetSamplingTargets -> GetSamplingTargets -> Bool)
-> Eq GetSamplingTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSamplingTargets -> GetSamplingTargets -> Bool
$c/= :: GetSamplingTargets -> GetSamplingTargets -> Bool
== :: GetSamplingTargets -> GetSamplingTargets -> Bool
$c== :: GetSamplingTargets -> GetSamplingTargets -> Bool
Prelude.Eq, ReadPrec [GetSamplingTargets]
ReadPrec GetSamplingTargets
Int -> ReadS GetSamplingTargets
ReadS [GetSamplingTargets]
(Int -> ReadS GetSamplingTargets)
-> ReadS [GetSamplingTargets]
-> ReadPrec GetSamplingTargets
-> ReadPrec [GetSamplingTargets]
-> Read GetSamplingTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSamplingTargets]
$creadListPrec :: ReadPrec [GetSamplingTargets]
readPrec :: ReadPrec GetSamplingTargets
$creadPrec :: ReadPrec GetSamplingTargets
readList :: ReadS [GetSamplingTargets]
$creadList :: ReadS [GetSamplingTargets]
readsPrec :: Int -> ReadS GetSamplingTargets
$creadsPrec :: Int -> ReadS GetSamplingTargets
Prelude.Read, Int -> GetSamplingTargets -> ShowS
[GetSamplingTargets] -> ShowS
GetSamplingTargets -> String
(Int -> GetSamplingTargets -> ShowS)
-> (GetSamplingTargets -> String)
-> ([GetSamplingTargets] -> ShowS)
-> Show GetSamplingTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSamplingTargets] -> ShowS
$cshowList :: [GetSamplingTargets] -> ShowS
show :: GetSamplingTargets -> String
$cshow :: GetSamplingTargets -> String
showsPrec :: Int -> GetSamplingTargets -> ShowS
$cshowsPrec :: Int -> GetSamplingTargets -> ShowS
Prelude.Show, (forall x. GetSamplingTargets -> Rep GetSamplingTargets x)
-> (forall x. Rep GetSamplingTargets x -> GetSamplingTargets)
-> Generic GetSamplingTargets
forall x. Rep GetSamplingTargets x -> GetSamplingTargets
forall x. GetSamplingTargets -> Rep GetSamplingTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSamplingTargets x -> GetSamplingTargets
$cfrom :: forall x. GetSamplingTargets -> Rep GetSamplingTargets x
Prelude.Generic)

-- |
-- Create a value of 'GetSamplingTargets' 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:
--
-- 'samplingStatisticsDocuments', 'getSamplingTargets_samplingStatisticsDocuments' - Information about rules that the service is using to sample requests.
newGetSamplingTargets ::
  GetSamplingTargets
newGetSamplingTargets :: GetSamplingTargets
newGetSamplingTargets =
  GetSamplingTargets' :: [SamplingStatisticsDocument] -> GetSamplingTargets
GetSamplingTargets'
    { $sel:samplingStatisticsDocuments:GetSamplingTargets' :: [SamplingStatisticsDocument]
samplingStatisticsDocuments =
        [SamplingStatisticsDocument]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Information about rules that the service is using to sample requests.
getSamplingTargets_samplingStatisticsDocuments :: Lens.Lens' GetSamplingTargets [SamplingStatisticsDocument]
getSamplingTargets_samplingStatisticsDocuments :: ([SamplingStatisticsDocument] -> f [SamplingStatisticsDocument])
-> GetSamplingTargets -> f GetSamplingTargets
getSamplingTargets_samplingStatisticsDocuments = (GetSamplingTargets -> [SamplingStatisticsDocument])
-> (GetSamplingTargets
    -> [SamplingStatisticsDocument] -> GetSamplingTargets)
-> Lens
     GetSamplingTargets
     GetSamplingTargets
     [SamplingStatisticsDocument]
     [SamplingStatisticsDocument]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSamplingTargets' {[SamplingStatisticsDocument]
samplingStatisticsDocuments :: [SamplingStatisticsDocument]
$sel:samplingStatisticsDocuments:GetSamplingTargets' :: GetSamplingTargets -> [SamplingStatisticsDocument]
samplingStatisticsDocuments} -> [SamplingStatisticsDocument]
samplingStatisticsDocuments) (\s :: GetSamplingTargets
s@GetSamplingTargets' {} [SamplingStatisticsDocument]
a -> GetSamplingTargets
s {$sel:samplingStatisticsDocuments:GetSamplingTargets' :: [SamplingStatisticsDocument]
samplingStatisticsDocuments = [SamplingStatisticsDocument]
a} :: GetSamplingTargets) (([SamplingStatisticsDocument] -> f [SamplingStatisticsDocument])
 -> GetSamplingTargets -> f GetSamplingTargets)
-> (([SamplingStatisticsDocument]
     -> f [SamplingStatisticsDocument])
    -> [SamplingStatisticsDocument] -> f [SamplingStatisticsDocument])
-> ([SamplingStatisticsDocument] -> f [SamplingStatisticsDocument])
-> GetSamplingTargets
-> f GetSamplingTargets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SamplingStatisticsDocument] -> f [SamplingStatisticsDocument])
-> [SamplingStatisticsDocument] -> f [SamplingStatisticsDocument]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetSamplingTargets

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

instance Core.ToJSON GetSamplingTargets where
  toJSON :: GetSamplingTargets -> Value
toJSON GetSamplingTargets' {[SamplingStatisticsDocument]
samplingStatisticsDocuments :: [SamplingStatisticsDocument]
$sel:samplingStatisticsDocuments:GetSamplingTargets' :: GetSamplingTargets -> [SamplingStatisticsDocument]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Key
"SamplingStatisticsDocuments"
                  Key -> [SamplingStatisticsDocument] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= [SamplingStatisticsDocument]
samplingStatisticsDocuments
              )
          ]
      )

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

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

-- | /See:/ 'newGetSamplingTargetsResponse' smart constructor.
data GetSamplingTargetsResponse = GetSamplingTargetsResponse'
  { -- | Information about
    -- <https://docs.aws.amazon.com/xray/latest/api/API_SamplingStatisticsDocument.html SamplingStatisticsDocument>
    -- that X-Ray could not process.
    GetSamplingTargetsResponse -> Maybe [UnprocessedStatistics]
unprocessedStatistics :: Prelude.Maybe [UnprocessedStatistics],
    -- | The last time a user changed the sampling rule configuration. If the
    -- sampling rule configuration changed since the service last retrieved it,
    -- the service should call
    -- <https://docs.aws.amazon.com/xray/latest/api/API_GetSamplingRules.html GetSamplingRules>
    -- to get the latest version.
    GetSamplingTargetsResponse -> Maybe POSIX
lastRuleModification :: Prelude.Maybe Core.POSIX,
    -- | Updated rules that the service should use to sample requests.
    GetSamplingTargetsResponse -> Maybe [SamplingTargetDocument]
samplingTargetDocuments :: Prelude.Maybe [SamplingTargetDocument],
    -- | The response's http status code.
    GetSamplingTargetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool
(GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool)
-> (GetSamplingTargetsResponse
    -> GetSamplingTargetsResponse -> Bool)
-> Eq GetSamplingTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool
$c/= :: GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool
== :: GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool
$c== :: GetSamplingTargetsResponse -> GetSamplingTargetsResponse -> Bool
Prelude.Eq, ReadPrec [GetSamplingTargetsResponse]
ReadPrec GetSamplingTargetsResponse
Int -> ReadS GetSamplingTargetsResponse
ReadS [GetSamplingTargetsResponse]
(Int -> ReadS GetSamplingTargetsResponse)
-> ReadS [GetSamplingTargetsResponse]
-> ReadPrec GetSamplingTargetsResponse
-> ReadPrec [GetSamplingTargetsResponse]
-> Read GetSamplingTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSamplingTargetsResponse]
$creadListPrec :: ReadPrec [GetSamplingTargetsResponse]
readPrec :: ReadPrec GetSamplingTargetsResponse
$creadPrec :: ReadPrec GetSamplingTargetsResponse
readList :: ReadS [GetSamplingTargetsResponse]
$creadList :: ReadS [GetSamplingTargetsResponse]
readsPrec :: Int -> ReadS GetSamplingTargetsResponse
$creadsPrec :: Int -> ReadS GetSamplingTargetsResponse
Prelude.Read, Int -> GetSamplingTargetsResponse -> ShowS
[GetSamplingTargetsResponse] -> ShowS
GetSamplingTargetsResponse -> String
(Int -> GetSamplingTargetsResponse -> ShowS)
-> (GetSamplingTargetsResponse -> String)
-> ([GetSamplingTargetsResponse] -> ShowS)
-> Show GetSamplingTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSamplingTargetsResponse] -> ShowS
$cshowList :: [GetSamplingTargetsResponse] -> ShowS
show :: GetSamplingTargetsResponse -> String
$cshow :: GetSamplingTargetsResponse -> String
showsPrec :: Int -> GetSamplingTargetsResponse -> ShowS
$cshowsPrec :: Int -> GetSamplingTargetsResponse -> ShowS
Prelude.Show, (forall x.
 GetSamplingTargetsResponse -> Rep GetSamplingTargetsResponse x)
-> (forall x.
    Rep GetSamplingTargetsResponse x -> GetSamplingTargetsResponse)
-> Generic GetSamplingTargetsResponse
forall x.
Rep GetSamplingTargetsResponse x -> GetSamplingTargetsResponse
forall x.
GetSamplingTargetsResponse -> Rep GetSamplingTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSamplingTargetsResponse x -> GetSamplingTargetsResponse
$cfrom :: forall x.
GetSamplingTargetsResponse -> Rep GetSamplingTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSamplingTargetsResponse' 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:
--
-- 'unprocessedStatistics', 'getSamplingTargetsResponse_unprocessedStatistics' - Information about
-- <https://docs.aws.amazon.com/xray/latest/api/API_SamplingStatisticsDocument.html SamplingStatisticsDocument>
-- that X-Ray could not process.
--
-- 'lastRuleModification', 'getSamplingTargetsResponse_lastRuleModification' - The last time a user changed the sampling rule configuration. If the
-- sampling rule configuration changed since the service last retrieved it,
-- the service should call
-- <https://docs.aws.amazon.com/xray/latest/api/API_GetSamplingRules.html GetSamplingRules>
-- to get the latest version.
--
-- 'samplingTargetDocuments', 'getSamplingTargetsResponse_samplingTargetDocuments' - Updated rules that the service should use to sample requests.
--
-- 'httpStatus', 'getSamplingTargetsResponse_httpStatus' - The response's http status code.
newGetSamplingTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSamplingTargetsResponse
newGetSamplingTargetsResponse :: Int -> GetSamplingTargetsResponse
newGetSamplingTargetsResponse Int
pHttpStatus_ =
  GetSamplingTargetsResponse' :: Maybe [UnprocessedStatistics]
-> Maybe POSIX
-> Maybe [SamplingTargetDocument]
-> Int
-> GetSamplingTargetsResponse
GetSamplingTargetsResponse'
    { $sel:unprocessedStatistics:GetSamplingTargetsResponse' :: Maybe [UnprocessedStatistics]
unprocessedStatistics =
        Maybe [UnprocessedStatistics]
forall a. Maybe a
Prelude.Nothing,
      $sel:lastRuleModification:GetSamplingTargetsResponse' :: Maybe POSIX
lastRuleModification = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:samplingTargetDocuments:GetSamplingTargetsResponse' :: Maybe [SamplingTargetDocument]
samplingTargetDocuments = Maybe [SamplingTargetDocument]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSamplingTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about
-- <https://docs.aws.amazon.com/xray/latest/api/API_SamplingStatisticsDocument.html SamplingStatisticsDocument>
-- that X-Ray could not process.
getSamplingTargetsResponse_unprocessedStatistics :: Lens.Lens' GetSamplingTargetsResponse (Prelude.Maybe [UnprocessedStatistics])
getSamplingTargetsResponse_unprocessedStatistics :: (Maybe [UnprocessedStatistics]
 -> f (Maybe [UnprocessedStatistics]))
-> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse
getSamplingTargetsResponse_unprocessedStatistics = (GetSamplingTargetsResponse -> Maybe [UnprocessedStatistics])
-> (GetSamplingTargetsResponse
    -> Maybe [UnprocessedStatistics] -> GetSamplingTargetsResponse)
-> Lens
     GetSamplingTargetsResponse
     GetSamplingTargetsResponse
     (Maybe [UnprocessedStatistics])
     (Maybe [UnprocessedStatistics])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSamplingTargetsResponse' {Maybe [UnprocessedStatistics]
unprocessedStatistics :: Maybe [UnprocessedStatistics]
$sel:unprocessedStatistics:GetSamplingTargetsResponse' :: GetSamplingTargetsResponse -> Maybe [UnprocessedStatistics]
unprocessedStatistics} -> Maybe [UnprocessedStatistics]
unprocessedStatistics) (\s :: GetSamplingTargetsResponse
s@GetSamplingTargetsResponse' {} Maybe [UnprocessedStatistics]
a -> GetSamplingTargetsResponse
s {$sel:unprocessedStatistics:GetSamplingTargetsResponse' :: Maybe [UnprocessedStatistics]
unprocessedStatistics = Maybe [UnprocessedStatistics]
a} :: GetSamplingTargetsResponse) ((Maybe [UnprocessedStatistics]
  -> f (Maybe [UnprocessedStatistics]))
 -> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse)
-> ((Maybe [UnprocessedStatistics]
     -> f (Maybe [UnprocessedStatistics]))
    -> Maybe [UnprocessedStatistics]
    -> f (Maybe [UnprocessedStatistics]))
-> (Maybe [UnprocessedStatistics]
    -> f (Maybe [UnprocessedStatistics]))
-> GetSamplingTargetsResponse
-> f GetSamplingTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UnprocessedStatistics]
  [UnprocessedStatistics]
  [UnprocessedStatistics]
  [UnprocessedStatistics]
-> Iso
     (Maybe [UnprocessedStatistics])
     (Maybe [UnprocessedStatistics])
     (Maybe [UnprocessedStatistics])
     (Maybe [UnprocessedStatistics])
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
  [UnprocessedStatistics]
  [UnprocessedStatistics]
  [UnprocessedStatistics]
  [UnprocessedStatistics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time a user changed the sampling rule configuration. If the
-- sampling rule configuration changed since the service last retrieved it,
-- the service should call
-- <https://docs.aws.amazon.com/xray/latest/api/API_GetSamplingRules.html GetSamplingRules>
-- to get the latest version.
getSamplingTargetsResponse_lastRuleModification :: Lens.Lens' GetSamplingTargetsResponse (Prelude.Maybe Prelude.UTCTime)
getSamplingTargetsResponse_lastRuleModification :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse
getSamplingTargetsResponse_lastRuleModification = (GetSamplingTargetsResponse -> Maybe POSIX)
-> (GetSamplingTargetsResponse
    -> Maybe POSIX -> GetSamplingTargetsResponse)
-> Lens
     GetSamplingTargetsResponse
     GetSamplingTargetsResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSamplingTargetsResponse' {Maybe POSIX
lastRuleModification :: Maybe POSIX
$sel:lastRuleModification:GetSamplingTargetsResponse' :: GetSamplingTargetsResponse -> Maybe POSIX
lastRuleModification} -> Maybe POSIX
lastRuleModification) (\s :: GetSamplingTargetsResponse
s@GetSamplingTargetsResponse' {} Maybe POSIX
a -> GetSamplingTargetsResponse
s {$sel:lastRuleModification:GetSamplingTargetsResponse' :: Maybe POSIX
lastRuleModification = Maybe POSIX
a} :: GetSamplingTargetsResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetSamplingTargetsResponse
-> f GetSamplingTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Updated rules that the service should use to sample requests.
getSamplingTargetsResponse_samplingTargetDocuments :: Lens.Lens' GetSamplingTargetsResponse (Prelude.Maybe [SamplingTargetDocument])
getSamplingTargetsResponse_samplingTargetDocuments :: (Maybe [SamplingTargetDocument]
 -> f (Maybe [SamplingTargetDocument]))
-> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse
getSamplingTargetsResponse_samplingTargetDocuments = (GetSamplingTargetsResponse -> Maybe [SamplingTargetDocument])
-> (GetSamplingTargetsResponse
    -> Maybe [SamplingTargetDocument] -> GetSamplingTargetsResponse)
-> Lens
     GetSamplingTargetsResponse
     GetSamplingTargetsResponse
     (Maybe [SamplingTargetDocument])
     (Maybe [SamplingTargetDocument])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSamplingTargetsResponse' {Maybe [SamplingTargetDocument]
samplingTargetDocuments :: Maybe [SamplingTargetDocument]
$sel:samplingTargetDocuments:GetSamplingTargetsResponse' :: GetSamplingTargetsResponse -> Maybe [SamplingTargetDocument]
samplingTargetDocuments} -> Maybe [SamplingTargetDocument]
samplingTargetDocuments) (\s :: GetSamplingTargetsResponse
s@GetSamplingTargetsResponse' {} Maybe [SamplingTargetDocument]
a -> GetSamplingTargetsResponse
s {$sel:samplingTargetDocuments:GetSamplingTargetsResponse' :: Maybe [SamplingTargetDocument]
samplingTargetDocuments = Maybe [SamplingTargetDocument]
a} :: GetSamplingTargetsResponse) ((Maybe [SamplingTargetDocument]
  -> f (Maybe [SamplingTargetDocument]))
 -> GetSamplingTargetsResponse -> f GetSamplingTargetsResponse)
-> ((Maybe [SamplingTargetDocument]
     -> f (Maybe [SamplingTargetDocument]))
    -> Maybe [SamplingTargetDocument]
    -> f (Maybe [SamplingTargetDocument]))
-> (Maybe [SamplingTargetDocument]
    -> f (Maybe [SamplingTargetDocument]))
-> GetSamplingTargetsResponse
-> f GetSamplingTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SamplingTargetDocument]
  [SamplingTargetDocument]
  [SamplingTargetDocument]
  [SamplingTargetDocument]
-> Iso
     (Maybe [SamplingTargetDocument])
     (Maybe [SamplingTargetDocument])
     (Maybe [SamplingTargetDocument])
     (Maybe [SamplingTargetDocument])
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
  [SamplingTargetDocument]
  [SamplingTargetDocument]
  [SamplingTargetDocument]
  [SamplingTargetDocument]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetSamplingTargetsResponse