{-# 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.AutoScalingPlans.DescribeScalingPlanResources
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the scalable resources in the specified scaling plan.
--
-- This operation returns paginated results.
module Amazonka.AutoScalingPlans.DescribeScalingPlanResources
  ( -- * Creating a Request
    DescribeScalingPlanResources (..),
    newDescribeScalingPlanResources,

    -- * Request Lenses
    describeScalingPlanResources_maxResults,
    describeScalingPlanResources_nextToken,
    describeScalingPlanResources_scalingPlanName,
    describeScalingPlanResources_scalingPlanVersion,

    -- * Destructuring the Response
    DescribeScalingPlanResourcesResponse (..),
    newDescribeScalingPlanResourcesResponse,

    -- * Response Lenses
    describeScalingPlanResourcesResponse_nextToken,
    describeScalingPlanResourcesResponse_scalingPlanResources,
    describeScalingPlanResourcesResponse_httpStatus,
  )
where

import Amazonka.AutoScalingPlans.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:/ 'newDescribeScalingPlanResources' smart constructor.
data DescribeScalingPlanResources = DescribeScalingPlanResources'
  { -- | The maximum number of scalable resources to return. The value must be
    -- between 1 and 50. The default value is 50.
    DescribeScalingPlanResources -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token for the next set of results.
    DescribeScalingPlanResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the scaling plan.
    DescribeScalingPlanResources -> Text
scalingPlanName :: Prelude.Text,
    -- | The version number of the scaling plan. Currently, the only valid value
    -- is @1@.
    DescribeScalingPlanResources -> Integer
scalingPlanVersion :: Prelude.Integer
  }
  deriving (DescribeScalingPlanResources
-> DescribeScalingPlanResources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingPlanResources
-> DescribeScalingPlanResources -> Bool
$c/= :: DescribeScalingPlanResources
-> DescribeScalingPlanResources -> Bool
== :: DescribeScalingPlanResources
-> DescribeScalingPlanResources -> Bool
$c== :: DescribeScalingPlanResources
-> DescribeScalingPlanResources -> Bool
Prelude.Eq, ReadPrec [DescribeScalingPlanResources]
ReadPrec DescribeScalingPlanResources
Int -> ReadS DescribeScalingPlanResources
ReadS [DescribeScalingPlanResources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingPlanResources]
$creadListPrec :: ReadPrec [DescribeScalingPlanResources]
readPrec :: ReadPrec DescribeScalingPlanResources
$creadPrec :: ReadPrec DescribeScalingPlanResources
readList :: ReadS [DescribeScalingPlanResources]
$creadList :: ReadS [DescribeScalingPlanResources]
readsPrec :: Int -> ReadS DescribeScalingPlanResources
$creadsPrec :: Int -> ReadS DescribeScalingPlanResources
Prelude.Read, Int -> DescribeScalingPlanResources -> ShowS
[DescribeScalingPlanResources] -> ShowS
DescribeScalingPlanResources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingPlanResources] -> ShowS
$cshowList :: [DescribeScalingPlanResources] -> ShowS
show :: DescribeScalingPlanResources -> String
$cshow :: DescribeScalingPlanResources -> String
showsPrec :: Int -> DescribeScalingPlanResources -> ShowS
$cshowsPrec :: Int -> DescribeScalingPlanResources -> ShowS
Prelude.Show, forall x.
Rep DescribeScalingPlanResources x -> DescribeScalingPlanResources
forall x.
DescribeScalingPlanResources -> Rep DescribeScalingPlanResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScalingPlanResources x -> DescribeScalingPlanResources
$cfrom :: forall x.
DescribeScalingPlanResources -> Rep DescribeScalingPlanResources x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingPlanResources' 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:
--
-- 'maxResults', 'describeScalingPlanResources_maxResults' - The maximum number of scalable resources to return. The value must be
-- between 1 and 50. The default value is 50.
--
-- 'nextToken', 'describeScalingPlanResources_nextToken' - The token for the next set of results.
--
-- 'scalingPlanName', 'describeScalingPlanResources_scalingPlanName' - The name of the scaling plan.
--
-- 'scalingPlanVersion', 'describeScalingPlanResources_scalingPlanVersion' - The version number of the scaling plan. Currently, the only valid value
-- is @1@.
newDescribeScalingPlanResources ::
  -- | 'scalingPlanName'
  Prelude.Text ->
  -- | 'scalingPlanVersion'
  Prelude.Integer ->
  DescribeScalingPlanResources
newDescribeScalingPlanResources :: Text -> Integer -> DescribeScalingPlanResources
newDescribeScalingPlanResources
  Text
pScalingPlanName_
  Integer
pScalingPlanVersion_ =
    DescribeScalingPlanResources'
      { $sel:maxResults:DescribeScalingPlanResources' :: Maybe Int
maxResults =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeScalingPlanResources' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:scalingPlanName:DescribeScalingPlanResources' :: Text
scalingPlanName = Text
pScalingPlanName_,
        $sel:scalingPlanVersion:DescribeScalingPlanResources' :: Integer
scalingPlanVersion = Integer
pScalingPlanVersion_
      }

-- | The maximum number of scalable resources to return. The value must be
-- between 1 and 50. The default value is 50.
describeScalingPlanResources_maxResults :: Lens.Lens' DescribeScalingPlanResources (Prelude.Maybe Prelude.Int)
describeScalingPlanResources_maxResults :: Lens' DescribeScalingPlanResources (Maybe Int)
describeScalingPlanResources_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResources' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeScalingPlanResources
s@DescribeScalingPlanResources' {} Maybe Int
a -> DescribeScalingPlanResources
s {$sel:maxResults:DescribeScalingPlanResources' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeScalingPlanResources)

-- | The token for the next set of results.
describeScalingPlanResources_nextToken :: Lens.Lens' DescribeScalingPlanResources (Prelude.Maybe Prelude.Text)
describeScalingPlanResources_nextToken :: Lens' DescribeScalingPlanResources (Maybe Text)
describeScalingPlanResources_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeScalingPlanResources
s@DescribeScalingPlanResources' {} Maybe Text
a -> DescribeScalingPlanResources
s {$sel:nextToken:DescribeScalingPlanResources' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeScalingPlanResources)

-- | The name of the scaling plan.
describeScalingPlanResources_scalingPlanName :: Lens.Lens' DescribeScalingPlanResources Prelude.Text
describeScalingPlanResources_scalingPlanName :: Lens' DescribeScalingPlanResources Text
describeScalingPlanResources_scalingPlanName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResources' {Text
scalingPlanName :: Text
$sel:scalingPlanName:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Text
scalingPlanName} -> Text
scalingPlanName) (\s :: DescribeScalingPlanResources
s@DescribeScalingPlanResources' {} Text
a -> DescribeScalingPlanResources
s {$sel:scalingPlanName:DescribeScalingPlanResources' :: Text
scalingPlanName = Text
a} :: DescribeScalingPlanResources)

-- | The version number of the scaling plan. Currently, the only valid value
-- is @1@.
describeScalingPlanResources_scalingPlanVersion :: Lens.Lens' DescribeScalingPlanResources Prelude.Integer
describeScalingPlanResources_scalingPlanVersion :: Lens' DescribeScalingPlanResources Integer
describeScalingPlanResources_scalingPlanVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResources' {Integer
scalingPlanVersion :: Integer
$sel:scalingPlanVersion:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Integer
scalingPlanVersion} -> Integer
scalingPlanVersion) (\s :: DescribeScalingPlanResources
s@DescribeScalingPlanResources' {} Integer
a -> DescribeScalingPlanResources
s {$sel:scalingPlanVersion:DescribeScalingPlanResources' :: Integer
scalingPlanVersion = Integer
a} :: DescribeScalingPlanResources)

instance Core.AWSPager DescribeScalingPlanResources where
  page :: DescribeScalingPlanResources
-> AWSResponse DescribeScalingPlanResources
-> Maybe DescribeScalingPlanResources
page DescribeScalingPlanResources
rq AWSResponse DescribeScalingPlanResources
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScalingPlanResources
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScalingPlanResourcesResponse (Maybe Text)
describeScalingPlanResourcesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScalingPlanResources
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeScalingPlanResourcesResponse (Maybe [ScalingPlanResource])
describeScalingPlanResourcesResponse_scalingPlanResources
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeScalingPlanResources
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeScalingPlanResources (Maybe Text)
describeScalingPlanResources_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeScalingPlanResources
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScalingPlanResourcesResponse (Maybe Text)
describeScalingPlanResourcesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeScalingPlanResources where
  type
    AWSResponse DescribeScalingPlanResources =
      DescribeScalingPlanResourcesResponse
  request :: (Service -> Service)
-> DescribeScalingPlanResources
-> Request DescribeScalingPlanResources
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeScalingPlanResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingPlanResources)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ScalingPlanResource]
-> Int
-> DescribeScalingPlanResourcesResponse
DescribeScalingPlanResourcesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ScalingPlanResources"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
    DescribeScalingPlanResources
  where
  hashWithSalt :: Int -> DescribeScalingPlanResources -> Int
hashWithSalt Int
_salt DescribeScalingPlanResources' {Integer
Maybe Int
Maybe Text
Text
scalingPlanVersion :: Integer
scalingPlanName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:scalingPlanVersion:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Integer
$sel:scalingPlanName:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Text
$sel:nextToken:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Text
$sel:maxResults:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scalingPlanName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
scalingPlanVersion

instance Prelude.NFData DescribeScalingPlanResources where
  rnf :: DescribeScalingPlanResources -> ()
rnf DescribeScalingPlanResources' {Integer
Maybe Int
Maybe Text
Text
scalingPlanVersion :: Integer
scalingPlanName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:scalingPlanVersion:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Integer
$sel:scalingPlanName:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Text
$sel:nextToken:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Text
$sel:maxResults:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      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
scalingPlanName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
scalingPlanVersion

instance Data.ToHeaders DescribeScalingPlanResources where
  toHeaders :: DescribeScalingPlanResources -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeScalingPlanResources where
  toJSON :: DescribeScalingPlanResources -> Value
toJSON DescribeScalingPlanResources' {Integer
Maybe Int
Maybe Text
Text
scalingPlanVersion :: Integer
scalingPlanName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:scalingPlanVersion:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Integer
$sel:scalingPlanName:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Text
$sel:nextToken:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Text
$sel:maxResults:DescribeScalingPlanResources' :: DescribeScalingPlanResources -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ScalingPlanName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
scalingPlanName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ScalingPlanVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
scalingPlanVersion)
          ]
      )

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

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

-- | /See:/ 'newDescribeScalingPlanResourcesResponse' smart constructor.
data DescribeScalingPlanResourcesResponse = DescribeScalingPlanResourcesResponse'
  { -- | The token required to get the next set of results. This value is @null@
    -- if there are no more results to return.
    DescribeScalingPlanResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the scalable resources.
    DescribeScalingPlanResourcesResponse -> Maybe [ScalingPlanResource]
scalingPlanResources :: Prelude.Maybe [ScalingPlanResource],
    -- | The response's http status code.
    DescribeScalingPlanResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeScalingPlanResourcesResponse
-> DescribeScalingPlanResourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingPlanResourcesResponse
-> DescribeScalingPlanResourcesResponse -> Bool
$c/= :: DescribeScalingPlanResourcesResponse
-> DescribeScalingPlanResourcesResponse -> Bool
== :: DescribeScalingPlanResourcesResponse
-> DescribeScalingPlanResourcesResponse -> Bool
$c== :: DescribeScalingPlanResourcesResponse
-> DescribeScalingPlanResourcesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeScalingPlanResourcesResponse]
ReadPrec DescribeScalingPlanResourcesResponse
Int -> ReadS DescribeScalingPlanResourcesResponse
ReadS [DescribeScalingPlanResourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingPlanResourcesResponse]
$creadListPrec :: ReadPrec [DescribeScalingPlanResourcesResponse]
readPrec :: ReadPrec DescribeScalingPlanResourcesResponse
$creadPrec :: ReadPrec DescribeScalingPlanResourcesResponse
readList :: ReadS [DescribeScalingPlanResourcesResponse]
$creadList :: ReadS [DescribeScalingPlanResourcesResponse]
readsPrec :: Int -> ReadS DescribeScalingPlanResourcesResponse
$creadsPrec :: Int -> ReadS DescribeScalingPlanResourcesResponse
Prelude.Read, Int -> DescribeScalingPlanResourcesResponse -> ShowS
[DescribeScalingPlanResourcesResponse] -> ShowS
DescribeScalingPlanResourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingPlanResourcesResponse] -> ShowS
$cshowList :: [DescribeScalingPlanResourcesResponse] -> ShowS
show :: DescribeScalingPlanResourcesResponse -> String
$cshow :: DescribeScalingPlanResourcesResponse -> String
showsPrec :: Int -> DescribeScalingPlanResourcesResponse -> ShowS
$cshowsPrec :: Int -> DescribeScalingPlanResourcesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeScalingPlanResourcesResponse x
-> DescribeScalingPlanResourcesResponse
forall x.
DescribeScalingPlanResourcesResponse
-> Rep DescribeScalingPlanResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScalingPlanResourcesResponse x
-> DescribeScalingPlanResourcesResponse
$cfrom :: forall x.
DescribeScalingPlanResourcesResponse
-> Rep DescribeScalingPlanResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingPlanResourcesResponse' 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', 'describeScalingPlanResourcesResponse_nextToken' - The token required to get the next set of results. This value is @null@
-- if there are no more results to return.
--
-- 'scalingPlanResources', 'describeScalingPlanResourcesResponse_scalingPlanResources' - Information about the scalable resources.
--
-- 'httpStatus', 'describeScalingPlanResourcesResponse_httpStatus' - The response's http status code.
newDescribeScalingPlanResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeScalingPlanResourcesResponse
newDescribeScalingPlanResourcesResponse :: Int -> DescribeScalingPlanResourcesResponse
newDescribeScalingPlanResourcesResponse Int
pHttpStatus_ =
  DescribeScalingPlanResourcesResponse'
    { $sel:nextToken:DescribeScalingPlanResourcesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:scalingPlanResources:DescribeScalingPlanResourcesResponse' :: Maybe [ScalingPlanResource]
scalingPlanResources =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeScalingPlanResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token required to get the next set of results. This value is @null@
-- if there are no more results to return.
describeScalingPlanResourcesResponse_nextToken :: Lens.Lens' DescribeScalingPlanResourcesResponse (Prelude.Maybe Prelude.Text)
describeScalingPlanResourcesResponse_nextToken :: Lens' DescribeScalingPlanResourcesResponse (Maybe Text)
describeScalingPlanResourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeScalingPlanResourcesResponse
s@DescribeScalingPlanResourcesResponse' {} Maybe Text
a -> DescribeScalingPlanResourcesResponse
s {$sel:nextToken:DescribeScalingPlanResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeScalingPlanResourcesResponse)

-- | Information about the scalable resources.
describeScalingPlanResourcesResponse_scalingPlanResources :: Lens.Lens' DescribeScalingPlanResourcesResponse (Prelude.Maybe [ScalingPlanResource])
describeScalingPlanResourcesResponse_scalingPlanResources :: Lens'
  DescribeScalingPlanResourcesResponse (Maybe [ScalingPlanResource])
describeScalingPlanResourcesResponse_scalingPlanResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResourcesResponse' {Maybe [ScalingPlanResource]
scalingPlanResources :: Maybe [ScalingPlanResource]
$sel:scalingPlanResources:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> Maybe [ScalingPlanResource]
scalingPlanResources} -> Maybe [ScalingPlanResource]
scalingPlanResources) (\s :: DescribeScalingPlanResourcesResponse
s@DescribeScalingPlanResourcesResponse' {} Maybe [ScalingPlanResource]
a -> DescribeScalingPlanResourcesResponse
s {$sel:scalingPlanResources:DescribeScalingPlanResourcesResponse' :: Maybe [ScalingPlanResource]
scalingPlanResources = Maybe [ScalingPlanResource]
a} :: DescribeScalingPlanResourcesResponse) 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.
describeScalingPlanResourcesResponse_httpStatus :: Lens.Lens' DescribeScalingPlanResourcesResponse Prelude.Int
describeScalingPlanResourcesResponse_httpStatus :: Lens' DescribeScalingPlanResourcesResponse Int
describeScalingPlanResourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlanResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeScalingPlanResourcesResponse
s@DescribeScalingPlanResourcesResponse' {} Int
a -> DescribeScalingPlanResourcesResponse
s {$sel:httpStatus:DescribeScalingPlanResourcesResponse' :: Int
httpStatus = Int
a} :: DescribeScalingPlanResourcesResponse)

instance
  Prelude.NFData
    DescribeScalingPlanResourcesResponse
  where
  rnf :: DescribeScalingPlanResourcesResponse -> ()
rnf DescribeScalingPlanResourcesResponse' {Int
Maybe [ScalingPlanResource]
Maybe Text
httpStatus :: Int
scalingPlanResources :: Maybe [ScalingPlanResource]
nextToken :: Maybe Text
$sel:httpStatus:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> Int
$sel:scalingPlanResources:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> Maybe [ScalingPlanResource]
$sel:nextToken:DescribeScalingPlanResourcesResponse' :: DescribeScalingPlanResourcesResponse -> 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 [ScalingPlanResource]
scalingPlanResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus