{-# 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.AutoScaling.DescribeTrafficSources
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- __Reserved for use with Amazon VPC Lattice, which is in preview and
-- subject to change. Do not use this API for production workloads. This
-- API is also subject to change.__
--
-- Gets information about the traffic sources for the specified Auto
-- Scaling group.
module Amazonka.AutoScaling.DescribeTrafficSources
  ( -- * Creating a Request
    DescribeTrafficSources (..),
    newDescribeTrafficSources,

    -- * Request Lenses
    describeTrafficSources_maxRecords,
    describeTrafficSources_nextToken,
    describeTrafficSources_autoScalingGroupName,
    describeTrafficSources_trafficSourceType,

    -- * Destructuring the Response
    DescribeTrafficSourcesResponse (..),
    newDescribeTrafficSourcesResponse,

    -- * Response Lenses
    describeTrafficSourcesResponse_nextToken,
    describeTrafficSourcesResponse_trafficSources,
    describeTrafficSourcesResponse_httpStatus,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeTrafficSources' smart constructor.
data DescribeTrafficSources = DescribeTrafficSources'
  { -- | The maximum number of items to return with this call. The maximum value
    -- is @50@.
    DescribeTrafficSources -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeTrafficSources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the Auto Scaling group.
    DescribeTrafficSources -> Text
autoScalingGroupName :: Prelude.Text,
    -- | The type of traffic source you are describing. Currently, the only valid
    -- value is @vpc-lattice@.
    DescribeTrafficSources -> Text
trafficSourceType :: Prelude.Text
  }
  deriving (DescribeTrafficSources -> DescribeTrafficSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrafficSources -> DescribeTrafficSources -> Bool
$c/= :: DescribeTrafficSources -> DescribeTrafficSources -> Bool
== :: DescribeTrafficSources -> DescribeTrafficSources -> Bool
$c== :: DescribeTrafficSources -> DescribeTrafficSources -> Bool
Prelude.Eq, ReadPrec [DescribeTrafficSources]
ReadPrec DescribeTrafficSources
Int -> ReadS DescribeTrafficSources
ReadS [DescribeTrafficSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrafficSources]
$creadListPrec :: ReadPrec [DescribeTrafficSources]
readPrec :: ReadPrec DescribeTrafficSources
$creadPrec :: ReadPrec DescribeTrafficSources
readList :: ReadS [DescribeTrafficSources]
$creadList :: ReadS [DescribeTrafficSources]
readsPrec :: Int -> ReadS DescribeTrafficSources
$creadsPrec :: Int -> ReadS DescribeTrafficSources
Prelude.Read, Int -> DescribeTrafficSources -> ShowS
[DescribeTrafficSources] -> ShowS
DescribeTrafficSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrafficSources] -> ShowS
$cshowList :: [DescribeTrafficSources] -> ShowS
show :: DescribeTrafficSources -> String
$cshow :: DescribeTrafficSources -> String
showsPrec :: Int -> DescribeTrafficSources -> ShowS
$cshowsPrec :: Int -> DescribeTrafficSources -> ShowS
Prelude.Show, forall x. Rep DescribeTrafficSources x -> DescribeTrafficSources
forall x. DescribeTrafficSources -> Rep DescribeTrafficSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTrafficSources x -> DescribeTrafficSources
$cfrom :: forall x. DescribeTrafficSources -> Rep DescribeTrafficSources x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTrafficSources' 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:
--
-- 'maxRecords', 'describeTrafficSources_maxRecords' - The maximum number of items to return with this call. The maximum value
-- is @50@.
--
-- 'nextToken', 'describeTrafficSources_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'autoScalingGroupName', 'describeTrafficSources_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'trafficSourceType', 'describeTrafficSources_trafficSourceType' - The type of traffic source you are describing. Currently, the only valid
-- value is @vpc-lattice@.
newDescribeTrafficSources ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'trafficSourceType'
  Prelude.Text ->
  DescribeTrafficSources
newDescribeTrafficSources :: Text -> Text -> DescribeTrafficSources
newDescribeTrafficSources
  Text
pAutoScalingGroupName_
  Text
pTrafficSourceType_ =
    DescribeTrafficSources'
      { $sel:maxRecords:DescribeTrafficSources' :: Maybe Int
maxRecords =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeTrafficSources' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:autoScalingGroupName:DescribeTrafficSources' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_,
        $sel:trafficSourceType:DescribeTrafficSources' :: Text
trafficSourceType = Text
pTrafficSourceType_
      }

-- | The maximum number of items to return with this call. The maximum value
-- is @50@.
describeTrafficSources_maxRecords :: Lens.Lens' DescribeTrafficSources (Prelude.Maybe Prelude.Int)
describeTrafficSources_maxRecords :: Lens' DescribeTrafficSources (Maybe Int)
describeTrafficSources_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSources' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeTrafficSources
s@DescribeTrafficSources' {} Maybe Int
a -> DescribeTrafficSources
s {$sel:maxRecords:DescribeTrafficSources' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeTrafficSources)

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeTrafficSources_nextToken :: Lens.Lens' DescribeTrafficSources (Prelude.Maybe Prelude.Text)
describeTrafficSources_nextToken :: Lens' DescribeTrafficSources (Maybe Text)
describeTrafficSources_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTrafficSources
s@DescribeTrafficSources' {} Maybe Text
a -> DescribeTrafficSources
s {$sel:nextToken:DescribeTrafficSources' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTrafficSources)

-- | The name of the Auto Scaling group.
describeTrafficSources_autoScalingGroupName :: Lens.Lens' DescribeTrafficSources Prelude.Text
describeTrafficSources_autoScalingGroupName :: Lens' DescribeTrafficSources Text
describeTrafficSources_autoScalingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSources' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DescribeTrafficSources' :: DescribeTrafficSources -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DescribeTrafficSources
s@DescribeTrafficSources' {} Text
a -> DescribeTrafficSources
s {$sel:autoScalingGroupName:DescribeTrafficSources' :: Text
autoScalingGroupName = Text
a} :: DescribeTrafficSources)

-- | The type of traffic source you are describing. Currently, the only valid
-- value is @vpc-lattice@.
describeTrafficSources_trafficSourceType :: Lens.Lens' DescribeTrafficSources Prelude.Text
describeTrafficSources_trafficSourceType :: Lens' DescribeTrafficSources Text
describeTrafficSources_trafficSourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSources' {Text
trafficSourceType :: Text
$sel:trafficSourceType:DescribeTrafficSources' :: DescribeTrafficSources -> Text
trafficSourceType} -> Text
trafficSourceType) (\s :: DescribeTrafficSources
s@DescribeTrafficSources' {} Text
a -> DescribeTrafficSources
s {$sel:trafficSourceType:DescribeTrafficSources' :: Text
trafficSourceType = Text
a} :: DescribeTrafficSources)

instance Core.AWSRequest DescribeTrafficSources where
  type
    AWSResponse DescribeTrafficSources =
      DescribeTrafficSourcesResponse
  request :: (Service -> Service)
-> DescribeTrafficSources -> Request DescribeTrafficSources
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeTrafficSources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeTrafficSources)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeTrafficSourcesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [TrafficSourceState]
-> Int
-> DescribeTrafficSourcesResponse
DescribeTrafficSourcesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TrafficSources"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeTrafficSources where
  hashWithSalt :: Int -> DescribeTrafficSources -> Int
hashWithSalt Int
_salt DescribeTrafficSources' {Maybe Int
Maybe Text
Text
trafficSourceType :: Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:trafficSourceType:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:autoScalingGroupName:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:nextToken:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Text
$sel:maxRecords:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoScalingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
trafficSourceType

instance Prelude.NFData DescribeTrafficSources where
  rnf :: DescribeTrafficSources -> ()
rnf DescribeTrafficSources' {Maybe Int
Maybe Text
Text
trafficSourceType :: Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:trafficSourceType:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:autoScalingGroupName:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:nextToken:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Text
$sel:maxRecords:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
autoScalingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
trafficSourceType

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

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

instance Data.ToQuery DescribeTrafficSources where
  toQuery :: DescribeTrafficSources -> QueryString
toQuery DescribeTrafficSources' {Maybe Int
Maybe Text
Text
trafficSourceType :: Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:trafficSourceType:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:autoScalingGroupName:DescribeTrafficSources' :: DescribeTrafficSources -> Text
$sel:nextToken:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Text
$sel:maxRecords:DescribeTrafficSources' :: DescribeTrafficSources -> Maybe Int
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeTrafficSources" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"AutoScalingGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
autoScalingGroupName,
        ByteString
"TrafficSourceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
trafficSourceType
      ]

-- | /See:/ 'newDescribeTrafficSourcesResponse' smart constructor.
data DescribeTrafficSourcesResponse = DescribeTrafficSourcesResponse'
  { -- | This string indicates that the response contains more items than can be
    -- returned in a single response. To receive additional items, specify this
    -- string for the @NextToken@ value when requesting the next set of items.
    -- This value is null when there are no more items to return.
    DescribeTrafficSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the traffic sources.
    DescribeTrafficSourcesResponse -> Maybe [TrafficSourceState]
trafficSources :: Prelude.Maybe [TrafficSourceState],
    -- | The response's http status code.
    DescribeTrafficSourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTrafficSourcesResponse
-> DescribeTrafficSourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTrafficSourcesResponse
-> DescribeTrafficSourcesResponse -> Bool
$c/= :: DescribeTrafficSourcesResponse
-> DescribeTrafficSourcesResponse -> Bool
== :: DescribeTrafficSourcesResponse
-> DescribeTrafficSourcesResponse -> Bool
$c== :: DescribeTrafficSourcesResponse
-> DescribeTrafficSourcesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTrafficSourcesResponse]
ReadPrec DescribeTrafficSourcesResponse
Int -> ReadS DescribeTrafficSourcesResponse
ReadS [DescribeTrafficSourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTrafficSourcesResponse]
$creadListPrec :: ReadPrec [DescribeTrafficSourcesResponse]
readPrec :: ReadPrec DescribeTrafficSourcesResponse
$creadPrec :: ReadPrec DescribeTrafficSourcesResponse
readList :: ReadS [DescribeTrafficSourcesResponse]
$creadList :: ReadS [DescribeTrafficSourcesResponse]
readsPrec :: Int -> ReadS DescribeTrafficSourcesResponse
$creadsPrec :: Int -> ReadS DescribeTrafficSourcesResponse
Prelude.Read, Int -> DescribeTrafficSourcesResponse -> ShowS
[DescribeTrafficSourcesResponse] -> ShowS
DescribeTrafficSourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTrafficSourcesResponse] -> ShowS
$cshowList :: [DescribeTrafficSourcesResponse] -> ShowS
show :: DescribeTrafficSourcesResponse -> String
$cshow :: DescribeTrafficSourcesResponse -> String
showsPrec :: Int -> DescribeTrafficSourcesResponse -> ShowS
$cshowsPrec :: Int -> DescribeTrafficSourcesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeTrafficSourcesResponse x
-> DescribeTrafficSourcesResponse
forall x.
DescribeTrafficSourcesResponse
-> Rep DescribeTrafficSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTrafficSourcesResponse x
-> DescribeTrafficSourcesResponse
$cfrom :: forall x.
DescribeTrafficSourcesResponse
-> Rep DescribeTrafficSourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTrafficSourcesResponse' 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', 'describeTrafficSourcesResponse_nextToken' - This string indicates that the response contains more items than can be
-- returned in a single response. To receive additional items, specify this
-- string for the @NextToken@ value when requesting the next set of items.
-- This value is null when there are no more items to return.
--
-- 'trafficSources', 'describeTrafficSourcesResponse_trafficSources' - Information about the traffic sources.
--
-- 'httpStatus', 'describeTrafficSourcesResponse_httpStatus' - The response's http status code.
newDescribeTrafficSourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTrafficSourcesResponse
newDescribeTrafficSourcesResponse :: Int -> DescribeTrafficSourcesResponse
newDescribeTrafficSourcesResponse Int
pHttpStatus_ =
  DescribeTrafficSourcesResponse'
    { $sel:nextToken:DescribeTrafficSourcesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:trafficSources:DescribeTrafficSourcesResponse' :: Maybe [TrafficSourceState]
trafficSources = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTrafficSourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | This string indicates that the response contains more items than can be
-- returned in a single response. To receive additional items, specify this
-- string for the @NextToken@ value when requesting the next set of items.
-- This value is null when there are no more items to return.
describeTrafficSourcesResponse_nextToken :: Lens.Lens' DescribeTrafficSourcesResponse (Prelude.Maybe Prelude.Text)
describeTrafficSourcesResponse_nextToken :: Lens' DescribeTrafficSourcesResponse (Maybe Text)
describeTrafficSourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTrafficSourcesResponse' :: DescribeTrafficSourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTrafficSourcesResponse
s@DescribeTrafficSourcesResponse' {} Maybe Text
a -> DescribeTrafficSourcesResponse
s {$sel:nextToken:DescribeTrafficSourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTrafficSourcesResponse)

-- | Information about the traffic sources.
describeTrafficSourcesResponse_trafficSources :: Lens.Lens' DescribeTrafficSourcesResponse (Prelude.Maybe [TrafficSourceState])
describeTrafficSourcesResponse_trafficSources :: Lens' DescribeTrafficSourcesResponse (Maybe [TrafficSourceState])
describeTrafficSourcesResponse_trafficSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTrafficSourcesResponse' {Maybe [TrafficSourceState]
trafficSources :: Maybe [TrafficSourceState]
$sel:trafficSources:DescribeTrafficSourcesResponse' :: DescribeTrafficSourcesResponse -> Maybe [TrafficSourceState]
trafficSources} -> Maybe [TrafficSourceState]
trafficSources) (\s :: DescribeTrafficSourcesResponse
s@DescribeTrafficSourcesResponse' {} Maybe [TrafficSourceState]
a -> DescribeTrafficSourcesResponse
s {$sel:trafficSources:DescribeTrafficSourcesResponse' :: Maybe [TrafficSourceState]
trafficSources = Maybe [TrafficSourceState]
a} :: DescribeTrafficSourcesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeTrafficSourcesResponse
  where
  rnf :: DescribeTrafficSourcesResponse -> ()
rnf DescribeTrafficSourcesResponse' {Int
Maybe [TrafficSourceState]
Maybe Text
httpStatus :: Int
trafficSources :: Maybe [TrafficSourceState]
nextToken :: Maybe Text
$sel:httpStatus:DescribeTrafficSourcesResponse' :: DescribeTrafficSourcesResponse -> Int
$sel:trafficSources:DescribeTrafficSourcesResponse' :: DescribeTrafficSourcesResponse -> Maybe [TrafficSourceState]
$sel:nextToken:DescribeTrafficSourcesResponse' :: DescribeTrafficSourcesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TrafficSourceState]
trafficSources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus