{-# 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.DescribeScalingPlans
-- 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 one or more of your scaling plans.
--
-- This operation returns paginated results.
module Amazonka.AutoScalingPlans.DescribeScalingPlans
  ( -- * Creating a Request
    DescribeScalingPlans (..),
    newDescribeScalingPlans,

    -- * Request Lenses
    describeScalingPlans_applicationSources,
    describeScalingPlans_maxResults,
    describeScalingPlans_nextToken,
    describeScalingPlans_scalingPlanNames,
    describeScalingPlans_scalingPlanVersion,

    -- * Destructuring the Response
    DescribeScalingPlansResponse (..),
    newDescribeScalingPlansResponse,

    -- * Response Lenses
    describeScalingPlansResponse_nextToken,
    describeScalingPlansResponse_scalingPlans,
    describeScalingPlansResponse_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:/ 'newDescribeScalingPlans' smart constructor.
data DescribeScalingPlans = DescribeScalingPlans'
  { -- | The sources for the applications (up to 10). If you specify scaling plan
    -- names, you cannot specify application sources.
    DescribeScalingPlans -> Maybe [ApplicationSource]
applicationSources :: Prelude.Maybe [ApplicationSource],
    -- | The maximum number of scalable resources to return. This value can be
    -- between 1 and 50. The default value is 50.
    DescribeScalingPlans -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token for the next set of results.
    DescribeScalingPlans -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The names of the scaling plans (up to 10). If you specify application
    -- sources, you cannot specify scaling plan names.
    DescribeScalingPlans -> Maybe [Text]
scalingPlanNames :: Prelude.Maybe [Prelude.Text],
    -- | The version number of the scaling plan. Currently, the only valid value
    -- is @1@.
    --
    -- If you specify a scaling plan version, you must also specify a scaling
    -- plan name.
    DescribeScalingPlans -> Maybe Integer
scalingPlanVersion :: Prelude.Maybe Prelude.Integer
  }
  deriving (DescribeScalingPlans -> DescribeScalingPlans -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingPlans -> DescribeScalingPlans -> Bool
$c/= :: DescribeScalingPlans -> DescribeScalingPlans -> Bool
== :: DescribeScalingPlans -> DescribeScalingPlans -> Bool
$c== :: DescribeScalingPlans -> DescribeScalingPlans -> Bool
Prelude.Eq, ReadPrec [DescribeScalingPlans]
ReadPrec DescribeScalingPlans
Int -> ReadS DescribeScalingPlans
ReadS [DescribeScalingPlans]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingPlans]
$creadListPrec :: ReadPrec [DescribeScalingPlans]
readPrec :: ReadPrec DescribeScalingPlans
$creadPrec :: ReadPrec DescribeScalingPlans
readList :: ReadS [DescribeScalingPlans]
$creadList :: ReadS [DescribeScalingPlans]
readsPrec :: Int -> ReadS DescribeScalingPlans
$creadsPrec :: Int -> ReadS DescribeScalingPlans
Prelude.Read, Int -> DescribeScalingPlans -> ShowS
[DescribeScalingPlans] -> ShowS
DescribeScalingPlans -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingPlans] -> ShowS
$cshowList :: [DescribeScalingPlans] -> ShowS
show :: DescribeScalingPlans -> String
$cshow :: DescribeScalingPlans -> String
showsPrec :: Int -> DescribeScalingPlans -> ShowS
$cshowsPrec :: Int -> DescribeScalingPlans -> ShowS
Prelude.Show, forall x. Rep DescribeScalingPlans x -> DescribeScalingPlans
forall x. DescribeScalingPlans -> Rep DescribeScalingPlans x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeScalingPlans x -> DescribeScalingPlans
$cfrom :: forall x. DescribeScalingPlans -> Rep DescribeScalingPlans x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingPlans' 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:
--
-- 'applicationSources', 'describeScalingPlans_applicationSources' - The sources for the applications (up to 10). If you specify scaling plan
-- names, you cannot specify application sources.
--
-- 'maxResults', 'describeScalingPlans_maxResults' - The maximum number of scalable resources to return. This value can be
-- between 1 and 50. The default value is 50.
--
-- 'nextToken', 'describeScalingPlans_nextToken' - The token for the next set of results.
--
-- 'scalingPlanNames', 'describeScalingPlans_scalingPlanNames' - The names of the scaling plans (up to 10). If you specify application
-- sources, you cannot specify scaling plan names.
--
-- 'scalingPlanVersion', 'describeScalingPlans_scalingPlanVersion' - The version number of the scaling plan. Currently, the only valid value
-- is @1@.
--
-- If you specify a scaling plan version, you must also specify a scaling
-- plan name.
newDescribeScalingPlans ::
  DescribeScalingPlans
newDescribeScalingPlans :: DescribeScalingPlans
newDescribeScalingPlans =
  DescribeScalingPlans'
    { $sel:applicationSources:DescribeScalingPlans' :: Maybe [ApplicationSource]
applicationSources =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeScalingPlans' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeScalingPlans' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:scalingPlanNames:DescribeScalingPlans' :: Maybe [Text]
scalingPlanNames = forall a. Maybe a
Prelude.Nothing,
      $sel:scalingPlanVersion:DescribeScalingPlans' :: Maybe Integer
scalingPlanVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The sources for the applications (up to 10). If you specify scaling plan
-- names, you cannot specify application sources.
describeScalingPlans_applicationSources :: Lens.Lens' DescribeScalingPlans (Prelude.Maybe [ApplicationSource])
describeScalingPlans_applicationSources :: Lens' DescribeScalingPlans (Maybe [ApplicationSource])
describeScalingPlans_applicationSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlans' {Maybe [ApplicationSource]
applicationSources :: Maybe [ApplicationSource]
$sel:applicationSources:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [ApplicationSource]
applicationSources} -> Maybe [ApplicationSource]
applicationSources) (\s :: DescribeScalingPlans
s@DescribeScalingPlans' {} Maybe [ApplicationSource]
a -> DescribeScalingPlans
s {$sel:applicationSources:DescribeScalingPlans' :: Maybe [ApplicationSource]
applicationSources = Maybe [ApplicationSource]
a} :: DescribeScalingPlans) 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 maximum number of scalable resources to return. This value can be
-- between 1 and 50. The default value is 50.
describeScalingPlans_maxResults :: Lens.Lens' DescribeScalingPlans (Prelude.Maybe Prelude.Int)
describeScalingPlans_maxResults :: Lens' DescribeScalingPlans (Maybe Int)
describeScalingPlans_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlans' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeScalingPlans
s@DescribeScalingPlans' {} Maybe Int
a -> DescribeScalingPlans
s {$sel:maxResults:DescribeScalingPlans' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeScalingPlans)

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

-- | The names of the scaling plans (up to 10). If you specify application
-- sources, you cannot specify scaling plan names.
describeScalingPlans_scalingPlanNames :: Lens.Lens' DescribeScalingPlans (Prelude.Maybe [Prelude.Text])
describeScalingPlans_scalingPlanNames :: Lens' DescribeScalingPlans (Maybe [Text])
describeScalingPlans_scalingPlanNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlans' {Maybe [Text]
scalingPlanNames :: Maybe [Text]
$sel:scalingPlanNames:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [Text]
scalingPlanNames} -> Maybe [Text]
scalingPlanNames) (\s :: DescribeScalingPlans
s@DescribeScalingPlans' {} Maybe [Text]
a -> DescribeScalingPlans
s {$sel:scalingPlanNames:DescribeScalingPlans' :: Maybe [Text]
scalingPlanNames = Maybe [Text]
a} :: DescribeScalingPlans) 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 version number of the scaling plan. Currently, the only valid value
-- is @1@.
--
-- If you specify a scaling plan version, you must also specify a scaling
-- plan name.
describeScalingPlans_scalingPlanVersion :: Lens.Lens' DescribeScalingPlans (Prelude.Maybe Prelude.Integer)
describeScalingPlans_scalingPlanVersion :: Lens' DescribeScalingPlans (Maybe Integer)
describeScalingPlans_scalingPlanVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlans' {Maybe Integer
scalingPlanVersion :: Maybe Integer
$sel:scalingPlanVersion:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Integer
scalingPlanVersion} -> Maybe Integer
scalingPlanVersion) (\s :: DescribeScalingPlans
s@DescribeScalingPlans' {} Maybe Integer
a -> DescribeScalingPlans
s {$sel:scalingPlanVersion:DescribeScalingPlans' :: Maybe Integer
scalingPlanVersion = Maybe Integer
a} :: DescribeScalingPlans)

instance Core.AWSPager DescribeScalingPlans where
  page :: DescribeScalingPlans
-> AWSResponse DescribeScalingPlans -> Maybe DescribeScalingPlans
page DescribeScalingPlans
rq AWSResponse DescribeScalingPlans
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScalingPlans
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScalingPlansResponse (Maybe Text)
describeScalingPlansResponse_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 DescribeScalingPlans
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScalingPlansResponse (Maybe [ScalingPlan])
describeScalingPlansResponse_scalingPlans
            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.$ DescribeScalingPlans
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeScalingPlans (Maybe Text)
describeScalingPlans_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeScalingPlans
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeScalingPlansResponse (Maybe Text)
describeScalingPlansResponse_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 DescribeScalingPlans where
  type
    AWSResponse DescribeScalingPlans =
      DescribeScalingPlansResponse
  request :: (Service -> Service)
-> DescribeScalingPlans -> Request DescribeScalingPlans
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 DescribeScalingPlans
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingPlans)))
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 [ScalingPlan] -> Int -> DescribeScalingPlansResponse
DescribeScalingPlansResponse'
            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
"ScalingPlans" 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 DescribeScalingPlans where
  hashWithSalt :: Int -> DescribeScalingPlans -> Int
hashWithSalt Int
_salt DescribeScalingPlans' {Maybe Int
Maybe Integer
Maybe [Text]
Maybe [ApplicationSource]
Maybe Text
scalingPlanVersion :: Maybe Integer
scalingPlanNames :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
applicationSources :: Maybe [ApplicationSource]
$sel:scalingPlanVersion:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Integer
$sel:scalingPlanNames:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [Text]
$sel:nextToken:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Text
$sel:maxResults:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Int
$sel:applicationSources:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [ApplicationSource]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ApplicationSource]
applicationSources
      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` Maybe [Text]
scalingPlanNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
scalingPlanVersion

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

instance Data.ToHeaders DescribeScalingPlans where
  toHeaders :: DescribeScalingPlans -> 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.DescribeScalingPlans" ::
                          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 DescribeScalingPlans where
  toJSON :: DescribeScalingPlans -> Value
toJSON DescribeScalingPlans' {Maybe Int
Maybe Integer
Maybe [Text]
Maybe [ApplicationSource]
Maybe Text
scalingPlanVersion :: Maybe Integer
scalingPlanNames :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
applicationSources :: Maybe [ApplicationSource]
$sel:scalingPlanVersion:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Integer
$sel:scalingPlanNames:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [Text]
$sel:nextToken:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Text
$sel:maxResults:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe Int
$sel:applicationSources:DescribeScalingPlans' :: DescribeScalingPlans -> Maybe [ApplicationSource]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ApplicationSources" 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 [ApplicationSource]
applicationSources,
            (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,
            (Key
"ScalingPlanNames" 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]
scalingPlanNames,
            (Key
"ScalingPlanVersion" 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 Integer
scalingPlanVersion
          ]
      )

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

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

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

-- |
-- Create a value of 'DescribeScalingPlansResponse' 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', 'describeScalingPlansResponse_nextToken' - The token required to get the next set of results. This value is @null@
-- if there are no more results to return.
--
-- 'scalingPlans', 'describeScalingPlansResponse_scalingPlans' - Information about the scaling plans.
--
-- 'httpStatus', 'describeScalingPlansResponse_httpStatus' - The response's http status code.
newDescribeScalingPlansResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeScalingPlansResponse
newDescribeScalingPlansResponse :: Int -> DescribeScalingPlansResponse
newDescribeScalingPlansResponse Int
pHttpStatus_ =
  DescribeScalingPlansResponse'
    { $sel:nextToken:DescribeScalingPlansResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:scalingPlans:DescribeScalingPlansResponse' :: Maybe [ScalingPlan]
scalingPlans = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeScalingPlansResponse' :: 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.
describeScalingPlansResponse_nextToken :: Lens.Lens' DescribeScalingPlansResponse (Prelude.Maybe Prelude.Text)
describeScalingPlansResponse_nextToken :: Lens' DescribeScalingPlansResponse (Maybe Text)
describeScalingPlansResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlansResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeScalingPlansResponse' :: DescribeScalingPlansResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeScalingPlansResponse
s@DescribeScalingPlansResponse' {} Maybe Text
a -> DescribeScalingPlansResponse
s {$sel:nextToken:DescribeScalingPlansResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeScalingPlansResponse)

-- | Information about the scaling plans.
describeScalingPlansResponse_scalingPlans :: Lens.Lens' DescribeScalingPlansResponse (Prelude.Maybe [ScalingPlan])
describeScalingPlansResponse_scalingPlans :: Lens' DescribeScalingPlansResponse (Maybe [ScalingPlan])
describeScalingPlansResponse_scalingPlans = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlansResponse' {Maybe [ScalingPlan]
scalingPlans :: Maybe [ScalingPlan]
$sel:scalingPlans:DescribeScalingPlansResponse' :: DescribeScalingPlansResponse -> Maybe [ScalingPlan]
scalingPlans} -> Maybe [ScalingPlan]
scalingPlans) (\s :: DescribeScalingPlansResponse
s@DescribeScalingPlansResponse' {} Maybe [ScalingPlan]
a -> DescribeScalingPlansResponse
s {$sel:scalingPlans:DescribeScalingPlansResponse' :: Maybe [ScalingPlan]
scalingPlans = Maybe [ScalingPlan]
a} :: DescribeScalingPlansResponse) 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.
describeScalingPlansResponse_httpStatus :: Lens.Lens' DescribeScalingPlansResponse Prelude.Int
describeScalingPlansResponse_httpStatus :: Lens' DescribeScalingPlansResponse Int
describeScalingPlansResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPlansResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeScalingPlansResponse' :: DescribeScalingPlansResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeScalingPlansResponse
s@DescribeScalingPlansResponse' {} Int
a -> DescribeScalingPlansResponse
s {$sel:httpStatus:DescribeScalingPlansResponse' :: Int
httpStatus = Int
a} :: DescribeScalingPlansResponse)

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