{-# 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.AutoScalingPlans.Types.ScalingPlanResource where
import Amazonka.AutoScalingPlans.Types.ScalableDimension
import Amazonka.AutoScalingPlans.Types.ScalingPolicy
import Amazonka.AutoScalingPlans.Types.ScalingStatusCode
import Amazonka.AutoScalingPlans.Types.ServiceNamespace
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ScalingPlanResource = ScalingPlanResource'
{
ScalingPlanResource -> Maybe Text
scalingStatusMessage :: Prelude.Maybe Prelude.Text,
ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
ScalingPlanResource -> Text
scalingPlanName :: Prelude.Text,
ScalingPlanResource -> Integer
scalingPlanVersion :: Prelude.Integer,
ScalingPlanResource -> ServiceNamespace
serviceNamespace :: ServiceNamespace,
ScalingPlanResource -> Text
resourceId :: Prelude.Text,
ScalingPlanResource -> ScalableDimension
scalableDimension :: ScalableDimension,
ScalingPlanResource -> ScalingStatusCode
scalingStatusCode :: ScalingStatusCode
}
deriving (ScalingPlanResource -> ScalingPlanResource -> Bool
(ScalingPlanResource -> ScalingPlanResource -> Bool)
-> (ScalingPlanResource -> ScalingPlanResource -> Bool)
-> Eq ScalingPlanResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingPlanResource -> ScalingPlanResource -> Bool
$c/= :: ScalingPlanResource -> ScalingPlanResource -> Bool
== :: ScalingPlanResource -> ScalingPlanResource -> Bool
$c== :: ScalingPlanResource -> ScalingPlanResource -> Bool
Prelude.Eq, ReadPrec [ScalingPlanResource]
ReadPrec ScalingPlanResource
Int -> ReadS ScalingPlanResource
ReadS [ScalingPlanResource]
(Int -> ReadS ScalingPlanResource)
-> ReadS [ScalingPlanResource]
-> ReadPrec ScalingPlanResource
-> ReadPrec [ScalingPlanResource]
-> Read ScalingPlanResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingPlanResource]
$creadListPrec :: ReadPrec [ScalingPlanResource]
readPrec :: ReadPrec ScalingPlanResource
$creadPrec :: ReadPrec ScalingPlanResource
readList :: ReadS [ScalingPlanResource]
$creadList :: ReadS [ScalingPlanResource]
readsPrec :: Int -> ReadS ScalingPlanResource
$creadsPrec :: Int -> ReadS ScalingPlanResource
Prelude.Read, Int -> ScalingPlanResource -> ShowS
[ScalingPlanResource] -> ShowS
ScalingPlanResource -> String
(Int -> ScalingPlanResource -> ShowS)
-> (ScalingPlanResource -> String)
-> ([ScalingPlanResource] -> ShowS)
-> Show ScalingPlanResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingPlanResource] -> ShowS
$cshowList :: [ScalingPlanResource] -> ShowS
show :: ScalingPlanResource -> String
$cshow :: ScalingPlanResource -> String
showsPrec :: Int -> ScalingPlanResource -> ShowS
$cshowsPrec :: Int -> ScalingPlanResource -> ShowS
Prelude.Show, (forall x. ScalingPlanResource -> Rep ScalingPlanResource x)
-> (forall x. Rep ScalingPlanResource x -> ScalingPlanResource)
-> Generic ScalingPlanResource
forall x. Rep ScalingPlanResource x -> ScalingPlanResource
forall x. ScalingPlanResource -> Rep ScalingPlanResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingPlanResource x -> ScalingPlanResource
$cfrom :: forall x. ScalingPlanResource -> Rep ScalingPlanResource x
Prelude.Generic)
newScalingPlanResource ::
Prelude.Text ->
Prelude.Integer ->
ServiceNamespace ->
Prelude.Text ->
ScalableDimension ->
ScalingStatusCode ->
ScalingPlanResource
newScalingPlanResource :: Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
newScalingPlanResource
Text
pScalingPlanName_
Integer
pScalingPlanVersion_
ServiceNamespace
pServiceNamespace_
Text
pResourceId_
ScalableDimension
pScalableDimension_
ScalingStatusCode
pScalingStatusCode_ =
ScalingPlanResource' :: Maybe Text
-> Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
{ $sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
forall a. Maybe a
Prelude.Nothing,
$sel:scalingPlanName:ScalingPlanResource' :: Text
scalingPlanName = Text
pScalingPlanName_,
$sel:scalingPlanVersion:ScalingPlanResource' :: Integer
scalingPlanVersion = Integer
pScalingPlanVersion_,
$sel:serviceNamespace:ScalingPlanResource' :: ServiceNamespace
serviceNamespace = ServiceNamespace
pServiceNamespace_,
$sel:resourceId:ScalingPlanResource' :: Text
resourceId = Text
pResourceId_,
$sel:scalableDimension:ScalingPlanResource' :: ScalableDimension
scalableDimension = ScalableDimension
pScalableDimension_,
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingStatusCode
scalingStatusCode = ScalingStatusCode
pScalingStatusCode_
}
scalingPlanResource_scalingStatusMessage :: Lens.Lens' ScalingPlanResource (Prelude.Maybe Prelude.Text)
scalingPlanResource_scalingStatusMessage :: (Maybe Text -> f (Maybe Text))
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingStatusMessage = (ScalingPlanResource -> Maybe Text)
-> (ScalingPlanResource -> Maybe Text -> ScalingPlanResource)
-> Lens
ScalingPlanResource ScalingPlanResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Maybe Text
scalingStatusMessage :: Maybe Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
scalingStatusMessage} -> Maybe Text
scalingStatusMessage) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Maybe Text
a -> ScalingPlanResource
s {$sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage = Maybe Text
a} :: ScalingPlanResource)
scalingPlanResource_scalingPolicies :: Lens.Lens' ScalingPlanResource (Prelude.Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies :: (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPolicies = (ScalingPlanResource -> Maybe [ScalingPolicy])
-> (ScalingPlanResource
-> Maybe [ScalingPolicy] -> ScalingPlanResource)
-> Lens
ScalingPlanResource
ScalingPlanResource
(Maybe [ScalingPolicy])
(Maybe [ScalingPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Maybe [ScalingPolicy]
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies} -> Maybe [ScalingPolicy]
scalingPolicies) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Maybe [ScalingPolicy]
a -> ScalingPlanResource
s {$sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
a} :: ScalingPlanResource) ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> ScalingPlanResource -> f ScalingPlanResource)
-> ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> ScalingPlanResource
-> f ScalingPlanResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ScalingPolicy] [ScalingPolicy] [ScalingPolicy] [ScalingPolicy]
-> Iso
(Maybe [ScalingPolicy])
(Maybe [ScalingPolicy])
(Maybe [ScalingPolicy])
(Maybe [ScalingPolicy])
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 AnIso
[ScalingPolicy] [ScalingPolicy] [ScalingPolicy] [ScalingPolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
scalingPlanResource_scalingPlanName :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_scalingPlanName :: (Text -> f Text) -> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPlanName = (ScalingPlanResource -> Text)
-> (ScalingPlanResource -> Text -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Text
scalingPlanName :: Text
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
scalingPlanName} -> Text
scalingPlanName) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Text
a -> ScalingPlanResource
s {$sel:scalingPlanName:ScalingPlanResource' :: Text
scalingPlanName = Text
a} :: ScalingPlanResource)
scalingPlanResource_scalingPlanVersion :: Lens.Lens' ScalingPlanResource Prelude.Integer
scalingPlanResource_scalingPlanVersion :: (Integer -> f Integer)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPlanVersion = (ScalingPlanResource -> Integer)
-> (ScalingPlanResource -> Integer -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Integer
scalingPlanVersion :: Integer
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
scalingPlanVersion} -> Integer
scalingPlanVersion) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Integer
a -> ScalingPlanResource
s {$sel:scalingPlanVersion:ScalingPlanResource' :: Integer
scalingPlanVersion = Integer
a} :: ScalingPlanResource)
scalingPlanResource_serviceNamespace :: Lens.Lens' ScalingPlanResource ServiceNamespace
scalingPlanResource_serviceNamespace :: (ServiceNamespace -> f ServiceNamespace)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_serviceNamespace = (ScalingPlanResource -> ServiceNamespace)
-> (ScalingPlanResource -> ServiceNamespace -> ScalingPlanResource)
-> Lens
ScalingPlanResource
ScalingPlanResource
ServiceNamespace
ServiceNamespace
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ServiceNamespace
serviceNamespace :: ServiceNamespace
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
serviceNamespace} -> ServiceNamespace
serviceNamespace) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ServiceNamespace
a -> ScalingPlanResource
s {$sel:serviceNamespace:ScalingPlanResource' :: ServiceNamespace
serviceNamespace = ServiceNamespace
a} :: ScalingPlanResource)
scalingPlanResource_resourceId :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_resourceId :: (Text -> f Text) -> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_resourceId = (ScalingPlanResource -> Text)
-> (ScalingPlanResource -> Text -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Text
resourceId :: Text
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
resourceId} -> Text
resourceId) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Text
a -> ScalingPlanResource
s {$sel:resourceId:ScalingPlanResource' :: Text
resourceId = Text
a} :: ScalingPlanResource)
scalingPlanResource_scalableDimension :: Lens.Lens' ScalingPlanResource ScalableDimension
scalingPlanResource_scalableDimension :: (ScalableDimension -> f ScalableDimension)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalableDimension = (ScalingPlanResource -> ScalableDimension)
-> (ScalingPlanResource
-> ScalableDimension -> ScalingPlanResource)
-> Lens
ScalingPlanResource
ScalingPlanResource
ScalableDimension
ScalableDimension
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ScalableDimension
scalableDimension :: ScalableDimension
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
scalableDimension} -> ScalableDimension
scalableDimension) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ScalableDimension
a -> ScalingPlanResource
s {$sel:scalableDimension:ScalingPlanResource' :: ScalableDimension
scalableDimension = ScalableDimension
a} :: ScalingPlanResource)
scalingPlanResource_scalingStatusCode :: Lens.Lens' ScalingPlanResource ScalingStatusCode
scalingPlanResource_scalingStatusCode :: (ScalingStatusCode -> f ScalingStatusCode)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingStatusCode = (ScalingPlanResource -> ScalingStatusCode)
-> (ScalingPlanResource
-> ScalingStatusCode -> ScalingPlanResource)
-> Lens
ScalingPlanResource
ScalingPlanResource
ScalingStatusCode
ScalingStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ScalingStatusCode
scalingStatusCode :: ScalingStatusCode
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
scalingStatusCode} -> ScalingStatusCode
scalingStatusCode) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ScalingStatusCode
a -> ScalingPlanResource
s {$sel:scalingStatusCode:ScalingPlanResource' :: ScalingStatusCode
scalingStatusCode = ScalingStatusCode
a} :: ScalingPlanResource)
instance Core.FromJSON ScalingPlanResource where
parseJSON :: Value -> Parser ScalingPlanResource
parseJSON =
String
-> (Object -> Parser ScalingPlanResource)
-> Value
-> Parser ScalingPlanResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ScalingPlanResource"
( \Object
x ->
Maybe Text
-> Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
(Maybe Text
-> Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
-> Parser (Maybe Text)
-> Parser
(Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScalingStatusMessage")
Parser
(Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
-> Parser (Maybe [ScalingPolicy])
-> Parser
(Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ScalingPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScalingPolicies"
Parser (Maybe (Maybe [ScalingPolicy]))
-> Maybe [ScalingPolicy] -> Parser (Maybe [ScalingPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ScalingPolicy]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
-> Parser Text
-> Parser
(Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingPlanName")
Parser
(Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
-> Parser Integer
-> Parser
(ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingPlanVersion")
Parser
(ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource)
-> Parser ServiceNamespace
-> Parser
(Text
-> ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ServiceNamespace
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceNamespace")
Parser
(Text
-> ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
-> Parser Text
-> Parser
(ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceId")
Parser
(ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
-> Parser ScalableDimension
-> Parser (ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalableDimension
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalableDimension")
Parser (ScalingStatusCode -> ScalingPlanResource)
-> Parser ScalingStatusCode -> Parser ScalingPlanResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalingStatusCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingStatusCode")
)
instance Prelude.Hashable ScalingPlanResource
instance Prelude.NFData ScalingPlanResource