{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudSearch.Types.ScalingParameters where
import Amazonka.CloudSearch.Types.PartitionInstanceType
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
data ScalingParameters = ScalingParameters'
{
ScalingParameters -> Maybe PartitionInstanceType
desiredInstanceType :: Prelude.Maybe PartitionInstanceType,
ScalingParameters -> Maybe Natural
desiredPartitionCount :: Prelude.Maybe Prelude.Natural,
ScalingParameters -> Maybe Natural
desiredReplicationCount :: Prelude.Maybe Prelude.Natural
}
deriving (ScalingParameters -> ScalingParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingParameters -> ScalingParameters -> Bool
$c/= :: ScalingParameters -> ScalingParameters -> Bool
== :: ScalingParameters -> ScalingParameters -> Bool
$c== :: ScalingParameters -> ScalingParameters -> Bool
Prelude.Eq, ReadPrec [ScalingParameters]
ReadPrec ScalingParameters
Int -> ReadS ScalingParameters
ReadS [ScalingParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingParameters]
$creadListPrec :: ReadPrec [ScalingParameters]
readPrec :: ReadPrec ScalingParameters
$creadPrec :: ReadPrec ScalingParameters
readList :: ReadS [ScalingParameters]
$creadList :: ReadS [ScalingParameters]
readsPrec :: Int -> ReadS ScalingParameters
$creadsPrec :: Int -> ReadS ScalingParameters
Prelude.Read, Int -> ScalingParameters -> ShowS
[ScalingParameters] -> ShowS
ScalingParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingParameters] -> ShowS
$cshowList :: [ScalingParameters] -> ShowS
show :: ScalingParameters -> String
$cshow :: ScalingParameters -> String
showsPrec :: Int -> ScalingParameters -> ShowS
$cshowsPrec :: Int -> ScalingParameters -> ShowS
Prelude.Show, forall x. Rep ScalingParameters x -> ScalingParameters
forall x. ScalingParameters -> Rep ScalingParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingParameters x -> ScalingParameters
$cfrom :: forall x. ScalingParameters -> Rep ScalingParameters x
Prelude.Generic)
newScalingParameters ::
ScalingParameters
newScalingParameters :: ScalingParameters
newScalingParameters =
ScalingParameters'
{ $sel:desiredInstanceType:ScalingParameters' :: Maybe PartitionInstanceType
desiredInstanceType =
forall a. Maybe a
Prelude.Nothing,
$sel:desiredPartitionCount:ScalingParameters' :: Maybe Natural
desiredPartitionCount = forall a. Maybe a
Prelude.Nothing,
$sel:desiredReplicationCount:ScalingParameters' :: Maybe Natural
desiredReplicationCount = forall a. Maybe a
Prelude.Nothing
}
scalingParameters_desiredInstanceType :: Lens.Lens' ScalingParameters (Prelude.Maybe PartitionInstanceType)
scalingParameters_desiredInstanceType :: Lens' ScalingParameters (Maybe PartitionInstanceType)
scalingParameters_desiredInstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingParameters' {Maybe PartitionInstanceType
desiredInstanceType :: Maybe PartitionInstanceType
$sel:desiredInstanceType:ScalingParameters' :: ScalingParameters -> Maybe PartitionInstanceType
desiredInstanceType} -> Maybe PartitionInstanceType
desiredInstanceType) (\s :: ScalingParameters
s@ScalingParameters' {} Maybe PartitionInstanceType
a -> ScalingParameters
s {$sel:desiredInstanceType:ScalingParameters' :: Maybe PartitionInstanceType
desiredInstanceType = Maybe PartitionInstanceType
a} :: ScalingParameters)
scalingParameters_desiredPartitionCount :: Lens.Lens' ScalingParameters (Prelude.Maybe Prelude.Natural)
scalingParameters_desiredPartitionCount :: Lens' ScalingParameters (Maybe Natural)
scalingParameters_desiredPartitionCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingParameters' {Maybe Natural
desiredPartitionCount :: Maybe Natural
$sel:desiredPartitionCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
desiredPartitionCount} -> Maybe Natural
desiredPartitionCount) (\s :: ScalingParameters
s@ScalingParameters' {} Maybe Natural
a -> ScalingParameters
s {$sel:desiredPartitionCount:ScalingParameters' :: Maybe Natural
desiredPartitionCount = Maybe Natural
a} :: ScalingParameters)
scalingParameters_desiredReplicationCount :: Lens.Lens' ScalingParameters (Prelude.Maybe Prelude.Natural)
scalingParameters_desiredReplicationCount :: Lens' ScalingParameters (Maybe Natural)
scalingParameters_desiredReplicationCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingParameters' {Maybe Natural
desiredReplicationCount :: Maybe Natural
$sel:desiredReplicationCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
desiredReplicationCount} -> Maybe Natural
desiredReplicationCount) (\s :: ScalingParameters
s@ScalingParameters' {} Maybe Natural
a -> ScalingParameters
s {$sel:desiredReplicationCount:ScalingParameters' :: Maybe Natural
desiredReplicationCount = Maybe Natural
a} :: ScalingParameters)
instance Data.FromXML ScalingParameters where
parseXML :: [Node] -> Either String ScalingParameters
parseXML [Node]
x =
Maybe PartitionInstanceType
-> Maybe Natural -> Maybe Natural -> ScalingParameters
ScalingParameters'
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
"DesiredInstanceType")
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
"DesiredPartitionCount")
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
"DesiredReplicationCount")
instance Prelude.Hashable ScalingParameters where
hashWithSalt :: Int -> ScalingParameters -> Int
hashWithSalt Int
_salt ScalingParameters' {Maybe Natural
Maybe PartitionInstanceType
desiredReplicationCount :: Maybe Natural
desiredPartitionCount :: Maybe Natural
desiredInstanceType :: Maybe PartitionInstanceType
$sel:desiredReplicationCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredPartitionCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredInstanceType:ScalingParameters' :: ScalingParameters -> Maybe PartitionInstanceType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PartitionInstanceType
desiredInstanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
desiredPartitionCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
desiredReplicationCount
instance Prelude.NFData ScalingParameters where
rnf :: ScalingParameters -> ()
rnf ScalingParameters' {Maybe Natural
Maybe PartitionInstanceType
desiredReplicationCount :: Maybe Natural
desiredPartitionCount :: Maybe Natural
desiredInstanceType :: Maybe PartitionInstanceType
$sel:desiredReplicationCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredPartitionCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredInstanceType:ScalingParameters' :: ScalingParameters -> Maybe PartitionInstanceType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe PartitionInstanceType
desiredInstanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
desiredPartitionCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
desiredReplicationCount
instance Data.ToQuery ScalingParameters where
toQuery :: ScalingParameters -> QueryString
toQuery ScalingParameters' {Maybe Natural
Maybe PartitionInstanceType
desiredReplicationCount :: Maybe Natural
desiredPartitionCount :: Maybe Natural
desiredInstanceType :: Maybe PartitionInstanceType
$sel:desiredReplicationCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredPartitionCount:ScalingParameters' :: ScalingParameters -> Maybe Natural
$sel:desiredInstanceType:ScalingParameters' :: ScalingParameters -> Maybe PartitionInstanceType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DesiredInstanceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe PartitionInstanceType
desiredInstanceType,
ByteString
"DesiredPartitionCount"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
desiredPartitionCount,
ByteString
"DesiredReplicationCount"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
desiredReplicationCount
]