{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ScalingPlanResource = ScalingPlanResource'
{
ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
ScalingPlanResource -> Maybe Text
scalingStatusMessage :: Prelude.Maybe Prelude.Text,
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
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]
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
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. 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'
{ $sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies =
forall a. Maybe a
Prelude.Nothing,
$sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage = 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_scalingPolicies :: Lens.Lens' ScalingPlanResource (Prelude.Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies :: Lens' ScalingPlanResource (Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies = 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) 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
scalingPlanResource_scalingStatusMessage :: Lens.Lens' ScalingPlanResource (Prelude.Maybe Prelude.Text)
scalingPlanResource_scalingStatusMessage :: Lens' ScalingPlanResource (Maybe Text)
scalingPlanResource_scalingStatusMessage = 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_scalingPlanName :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_scalingPlanName :: Lens' ScalingPlanResource Text
scalingPlanResource_scalingPlanName = 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 :: Lens' ScalingPlanResource Integer
scalingPlanResource_scalingPlanVersion = 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 :: Lens' ScalingPlanResource ServiceNamespace
scalingPlanResource_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 :: Lens' ScalingPlanResource Text
scalingPlanResource_resourceId = 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 :: Lens' ScalingPlanResource ScalableDimension
scalingPlanResource_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 :: Lens' ScalingPlanResource ScalingStatusCode
scalingPlanResource_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 Data.FromJSON ScalingPlanResource where
parseJSON :: Value -> Parser ScalingPlanResource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ScalingPlanResource"
( \Object
x ->
Maybe [ScalingPolicy]
-> Maybe Text
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScalingPolicies"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScalingStatusMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingPlanName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingPlanVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ServiceNamespace")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalableDimension")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingStatusCode")
)
instance Prelude.Hashable ScalingPlanResource where
hashWithSalt :: Int -> ScalingPlanResource -> Int
hashWithSalt Int
_salt ScalingPlanResource' {Integer
Maybe [ScalingPolicy]
Maybe Text
Text
ScalableDimension
ScalingStatusCode
ServiceNamespace
scalingStatusCode :: ScalingStatusCode
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scalingPlanVersion :: Integer
scalingPlanName :: Text
scalingStatusMessage :: Maybe Text
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ScalingPolicy]
scalingPolicies
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scalingStatusMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scalingPlanName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
scalingPlanVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ServiceNamespace
serviceNamespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalableDimension
scalableDimension
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalingStatusCode
scalingStatusCode
instance Prelude.NFData ScalingPlanResource where
rnf :: ScalingPlanResource -> ()
rnf ScalingPlanResource' {Integer
Maybe [ScalingPolicy]
Maybe Text
Text
ScalableDimension
ScalingStatusCode
ServiceNamespace
scalingStatusCode :: ScalingStatusCode
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scalingPlanVersion :: Integer
scalingPlanName :: Text
scalingStatusMessage :: Maybe Text
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ScalingPolicy]
scalingPolicies
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scalingStatusMessage
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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ServiceNamespace
serviceNamespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalableDimension
scalableDimension
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalingStatusCode
scalingStatusCode