{-# 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.CloudSearch.DescribeScalingParameters
-- 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)
--
-- Gets the scaling parameters configured for a domain. A domain\'s scaling
-- parameters specify the desired search instance type and replication
-- count. For more information, see
-- <http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-scaling-options.html Configuring Scaling Options>
-- in the /Amazon CloudSearch Developer Guide/.
module Amazonka.CloudSearch.DescribeScalingParameters
  ( -- * Creating a Request
    DescribeScalingParameters (..),
    newDescribeScalingParameters,

    -- * Request Lenses
    describeScalingParameters_domainName,

    -- * Destructuring the Response
    DescribeScalingParametersResponse (..),
    newDescribeScalingParametersResponse,

    -- * Response Lenses
    describeScalingParametersResponse_httpStatus,
    describeScalingParametersResponse_scalingParameters,
  )
where

import Amazonka.CloudSearch.Types
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

-- | Container for the parameters to the @DescribeScalingParameters@
-- operation. Specifies the name of the domain you want to describe.
--
-- /See:/ 'newDescribeScalingParameters' smart constructor.
data DescribeScalingParameters = DescribeScalingParameters'
  { DescribeScalingParameters -> Text
domainName :: Prelude.Text
  }
  deriving (DescribeScalingParameters -> DescribeScalingParameters -> Bool
(DescribeScalingParameters -> DescribeScalingParameters -> Bool)
-> (DescribeScalingParameters -> DescribeScalingParameters -> Bool)
-> Eq DescribeScalingParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingParameters -> DescribeScalingParameters -> Bool
$c/= :: DescribeScalingParameters -> DescribeScalingParameters -> Bool
== :: DescribeScalingParameters -> DescribeScalingParameters -> Bool
$c== :: DescribeScalingParameters -> DescribeScalingParameters -> Bool
Prelude.Eq, ReadPrec [DescribeScalingParameters]
ReadPrec DescribeScalingParameters
Int -> ReadS DescribeScalingParameters
ReadS [DescribeScalingParameters]
(Int -> ReadS DescribeScalingParameters)
-> ReadS [DescribeScalingParameters]
-> ReadPrec DescribeScalingParameters
-> ReadPrec [DescribeScalingParameters]
-> Read DescribeScalingParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingParameters]
$creadListPrec :: ReadPrec [DescribeScalingParameters]
readPrec :: ReadPrec DescribeScalingParameters
$creadPrec :: ReadPrec DescribeScalingParameters
readList :: ReadS [DescribeScalingParameters]
$creadList :: ReadS [DescribeScalingParameters]
readsPrec :: Int -> ReadS DescribeScalingParameters
$creadsPrec :: Int -> ReadS DescribeScalingParameters
Prelude.Read, Int -> DescribeScalingParameters -> ShowS
[DescribeScalingParameters] -> ShowS
DescribeScalingParameters -> String
(Int -> DescribeScalingParameters -> ShowS)
-> (DescribeScalingParameters -> String)
-> ([DescribeScalingParameters] -> ShowS)
-> Show DescribeScalingParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingParameters] -> ShowS
$cshowList :: [DescribeScalingParameters] -> ShowS
show :: DescribeScalingParameters -> String
$cshow :: DescribeScalingParameters -> String
showsPrec :: Int -> DescribeScalingParameters -> ShowS
$cshowsPrec :: Int -> DescribeScalingParameters -> ShowS
Prelude.Show, (forall x.
 DescribeScalingParameters -> Rep DescribeScalingParameters x)
-> (forall x.
    Rep DescribeScalingParameters x -> DescribeScalingParameters)
-> Generic DescribeScalingParameters
forall x.
Rep DescribeScalingParameters x -> DescribeScalingParameters
forall x.
DescribeScalingParameters -> Rep DescribeScalingParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScalingParameters x -> DescribeScalingParameters
$cfrom :: forall x.
DescribeScalingParameters -> Rep DescribeScalingParameters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingParameters' 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:
--
-- 'domainName', 'describeScalingParameters_domainName' - Undocumented member.
newDescribeScalingParameters ::
  -- | 'domainName'
  Prelude.Text ->
  DescribeScalingParameters
newDescribeScalingParameters :: Text -> DescribeScalingParameters
newDescribeScalingParameters Text
pDomainName_ =
  DescribeScalingParameters' :: Text -> DescribeScalingParameters
DescribeScalingParameters'
    { $sel:domainName:DescribeScalingParameters' :: Text
domainName =
        Text
pDomainName_
    }

-- | Undocumented member.
describeScalingParameters_domainName :: Lens.Lens' DescribeScalingParameters Prelude.Text
describeScalingParameters_domainName :: (Text -> f Text)
-> DescribeScalingParameters -> f DescribeScalingParameters
describeScalingParameters_domainName = (DescribeScalingParameters -> Text)
-> (DescribeScalingParameters -> Text -> DescribeScalingParameters)
-> Lens
     DescribeScalingParameters DescribeScalingParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingParameters' {Text
domainName :: Text
$sel:domainName:DescribeScalingParameters' :: DescribeScalingParameters -> Text
domainName} -> Text
domainName) (\s :: DescribeScalingParameters
s@DescribeScalingParameters' {} Text
a -> DescribeScalingParameters
s {$sel:domainName:DescribeScalingParameters' :: Text
domainName = Text
a} :: DescribeScalingParameters)

instance Core.AWSRequest DescribeScalingParameters where
  type
    AWSResponse DescribeScalingParameters =
      DescribeScalingParametersResponse
  request :: DescribeScalingParameters -> Request DescribeScalingParameters
request = Service
-> DescribeScalingParameters -> Request DescribeScalingParameters
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeScalingParameters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingParameters)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeScalingParameters))
-> Logger
-> Service
-> Proxy DescribeScalingParameters
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingParameters)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeScalingParametersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> ScalingParametersStatus -> DescribeScalingParametersResponse
DescribeScalingParametersResponse'
            (Int
 -> ScalingParametersStatus -> DescribeScalingParametersResponse)
-> Either String Int
-> Either
     String
     (ScalingParametersStatus -> DescribeScalingParametersResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String
  (ScalingParametersStatus -> DescribeScalingParametersResponse)
-> Either String ScalingParametersStatus
-> Either String DescribeScalingParametersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ScalingParametersStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ScalingParameters")
      )

instance Prelude.Hashable DescribeScalingParameters

instance Prelude.NFData DescribeScalingParameters

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

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

instance Core.ToQuery DescribeScalingParameters where
  toQuery :: DescribeScalingParameters -> QueryString
toQuery DescribeScalingParameters' {Text
domainName :: Text
$sel:domainName:DescribeScalingParameters' :: DescribeScalingParameters -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeScalingParameters" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2013-01-01" :: Prelude.ByteString),
        ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName
      ]

-- | The result of a @DescribeScalingParameters@ request. Contains the
-- scaling parameters configured for the domain specified in the request.
--
-- /See:/ 'newDescribeScalingParametersResponse' smart constructor.
data DescribeScalingParametersResponse = DescribeScalingParametersResponse'
  { -- | The response's http status code.
    DescribeScalingParametersResponse -> Int
httpStatus :: Prelude.Int,
    DescribeScalingParametersResponse -> ScalingParametersStatus
scalingParameters :: ScalingParametersStatus
  }
  deriving (DescribeScalingParametersResponse
-> DescribeScalingParametersResponse -> Bool
(DescribeScalingParametersResponse
 -> DescribeScalingParametersResponse -> Bool)
-> (DescribeScalingParametersResponse
    -> DescribeScalingParametersResponse -> Bool)
-> Eq DescribeScalingParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingParametersResponse
-> DescribeScalingParametersResponse -> Bool
$c/= :: DescribeScalingParametersResponse
-> DescribeScalingParametersResponse -> Bool
== :: DescribeScalingParametersResponse
-> DescribeScalingParametersResponse -> Bool
$c== :: DescribeScalingParametersResponse
-> DescribeScalingParametersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeScalingParametersResponse]
ReadPrec DescribeScalingParametersResponse
Int -> ReadS DescribeScalingParametersResponse
ReadS [DescribeScalingParametersResponse]
(Int -> ReadS DescribeScalingParametersResponse)
-> ReadS [DescribeScalingParametersResponse]
-> ReadPrec DescribeScalingParametersResponse
-> ReadPrec [DescribeScalingParametersResponse]
-> Read DescribeScalingParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingParametersResponse]
$creadListPrec :: ReadPrec [DescribeScalingParametersResponse]
readPrec :: ReadPrec DescribeScalingParametersResponse
$creadPrec :: ReadPrec DescribeScalingParametersResponse
readList :: ReadS [DescribeScalingParametersResponse]
$creadList :: ReadS [DescribeScalingParametersResponse]
readsPrec :: Int -> ReadS DescribeScalingParametersResponse
$creadsPrec :: Int -> ReadS DescribeScalingParametersResponse
Prelude.Read, Int -> DescribeScalingParametersResponse -> ShowS
[DescribeScalingParametersResponse] -> ShowS
DescribeScalingParametersResponse -> String
(Int -> DescribeScalingParametersResponse -> ShowS)
-> (DescribeScalingParametersResponse -> String)
-> ([DescribeScalingParametersResponse] -> ShowS)
-> Show DescribeScalingParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingParametersResponse] -> ShowS
$cshowList :: [DescribeScalingParametersResponse] -> ShowS
show :: DescribeScalingParametersResponse -> String
$cshow :: DescribeScalingParametersResponse -> String
showsPrec :: Int -> DescribeScalingParametersResponse -> ShowS
$cshowsPrec :: Int -> DescribeScalingParametersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeScalingParametersResponse
 -> Rep DescribeScalingParametersResponse x)
-> (forall x.
    Rep DescribeScalingParametersResponse x
    -> DescribeScalingParametersResponse)
-> Generic DescribeScalingParametersResponse
forall x.
Rep DescribeScalingParametersResponse x
-> DescribeScalingParametersResponse
forall x.
DescribeScalingParametersResponse
-> Rep DescribeScalingParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScalingParametersResponse x
-> DescribeScalingParametersResponse
$cfrom :: forall x.
DescribeScalingParametersResponse
-> Rep DescribeScalingParametersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingParametersResponse' 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:
--
-- 'httpStatus', 'describeScalingParametersResponse_httpStatus' - The response's http status code.
--
-- 'scalingParameters', 'describeScalingParametersResponse_scalingParameters' - Undocumented member.
newDescribeScalingParametersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'scalingParameters'
  ScalingParametersStatus ->
  DescribeScalingParametersResponse
newDescribeScalingParametersResponse :: Int -> ScalingParametersStatus -> DescribeScalingParametersResponse
newDescribeScalingParametersResponse
  Int
pHttpStatus_
  ScalingParametersStatus
pScalingParameters_ =
    DescribeScalingParametersResponse' :: Int -> ScalingParametersStatus -> DescribeScalingParametersResponse
DescribeScalingParametersResponse'
      { $sel:httpStatus:DescribeScalingParametersResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:scalingParameters:DescribeScalingParametersResponse' :: ScalingParametersStatus
scalingParameters = ScalingParametersStatus
pScalingParameters_
      }

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

-- | Undocumented member.
describeScalingParametersResponse_scalingParameters :: Lens.Lens' DescribeScalingParametersResponse ScalingParametersStatus
describeScalingParametersResponse_scalingParameters :: (ScalingParametersStatus -> f ScalingParametersStatus)
-> DescribeScalingParametersResponse
-> f DescribeScalingParametersResponse
describeScalingParametersResponse_scalingParameters = (DescribeScalingParametersResponse -> ScalingParametersStatus)
-> (DescribeScalingParametersResponse
    -> ScalingParametersStatus -> DescribeScalingParametersResponse)
-> Lens
     DescribeScalingParametersResponse
     DescribeScalingParametersResponse
     ScalingParametersStatus
     ScalingParametersStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingParametersResponse' {ScalingParametersStatus
scalingParameters :: ScalingParametersStatus
$sel:scalingParameters:DescribeScalingParametersResponse' :: DescribeScalingParametersResponse -> ScalingParametersStatus
scalingParameters} -> ScalingParametersStatus
scalingParameters) (\s :: DescribeScalingParametersResponse
s@DescribeScalingParametersResponse' {} ScalingParametersStatus
a -> DescribeScalingParametersResponse
s {$sel:scalingParameters:DescribeScalingParametersResponse' :: ScalingParametersStatus
scalingParameters = ScalingParametersStatus
a} :: DescribeScalingParametersResponse)

instance
  Prelude.NFData
    DescribeScalingParametersResponse