{-# 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.EC2.Types.ReservedInstancesConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.InstanceType
import Amazonka.EC2.Types.Scope
import qualified Amazonka.Prelude as Prelude
data ReservedInstancesConfiguration = ReservedInstancesConfiguration'
{
ReservedInstancesConfiguration -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
ReservedInstancesConfiguration -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
ReservedInstancesConfiguration -> Maybe InstanceType
instanceType :: Prelude.Maybe InstanceType,
ReservedInstancesConfiguration -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
ReservedInstancesConfiguration -> Maybe Scope
scope :: Prelude.Maybe Scope
}
deriving (ReservedInstancesConfiguration
-> ReservedInstancesConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedInstancesConfiguration
-> ReservedInstancesConfiguration -> Bool
$c/= :: ReservedInstancesConfiguration
-> ReservedInstancesConfiguration -> Bool
== :: ReservedInstancesConfiguration
-> ReservedInstancesConfiguration -> Bool
$c== :: ReservedInstancesConfiguration
-> ReservedInstancesConfiguration -> Bool
Prelude.Eq, ReadPrec [ReservedInstancesConfiguration]
ReadPrec ReservedInstancesConfiguration
Int -> ReadS ReservedInstancesConfiguration
ReadS [ReservedInstancesConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedInstancesConfiguration]
$creadListPrec :: ReadPrec [ReservedInstancesConfiguration]
readPrec :: ReadPrec ReservedInstancesConfiguration
$creadPrec :: ReadPrec ReservedInstancesConfiguration
readList :: ReadS [ReservedInstancesConfiguration]
$creadList :: ReadS [ReservedInstancesConfiguration]
readsPrec :: Int -> ReadS ReservedInstancesConfiguration
$creadsPrec :: Int -> ReadS ReservedInstancesConfiguration
Prelude.Read, Int -> ReservedInstancesConfiguration -> ShowS
[ReservedInstancesConfiguration] -> ShowS
ReservedInstancesConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedInstancesConfiguration] -> ShowS
$cshowList :: [ReservedInstancesConfiguration] -> ShowS
show :: ReservedInstancesConfiguration -> String
$cshow :: ReservedInstancesConfiguration -> String
showsPrec :: Int -> ReservedInstancesConfiguration -> ShowS
$cshowsPrec :: Int -> ReservedInstancesConfiguration -> ShowS
Prelude.Show, forall x.
Rep ReservedInstancesConfiguration x
-> ReservedInstancesConfiguration
forall x.
ReservedInstancesConfiguration
-> Rep ReservedInstancesConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservedInstancesConfiguration x
-> ReservedInstancesConfiguration
$cfrom :: forall x.
ReservedInstancesConfiguration
-> Rep ReservedInstancesConfiguration x
Prelude.Generic)
newReservedInstancesConfiguration ::
ReservedInstancesConfiguration
newReservedInstancesConfiguration :: ReservedInstancesConfiguration
newReservedInstancesConfiguration =
ReservedInstancesConfiguration'
{ $sel:availabilityZone:ReservedInstancesConfiguration' :: Maybe Text
availabilityZone =
forall a. Maybe a
Prelude.Nothing,
$sel:instanceCount:ReservedInstancesConfiguration' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:ReservedInstancesConfiguration' :: Maybe InstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:platform:ReservedInstancesConfiguration' :: Maybe Text
platform = forall a. Maybe a
Prelude.Nothing,
$sel:scope:ReservedInstancesConfiguration' :: Maybe Scope
scope = forall a. Maybe a
Prelude.Nothing
}
reservedInstancesConfiguration_availabilityZone :: Lens.Lens' ReservedInstancesConfiguration (Prelude.Maybe Prelude.Text)
reservedInstancesConfiguration_availabilityZone :: Lens' ReservedInstancesConfiguration (Maybe Text)
reservedInstancesConfiguration_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstancesConfiguration' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: ReservedInstancesConfiguration
s@ReservedInstancesConfiguration' {} Maybe Text
a -> ReservedInstancesConfiguration
s {$sel:availabilityZone:ReservedInstancesConfiguration' :: Maybe Text
availabilityZone = Maybe Text
a} :: ReservedInstancesConfiguration)
reservedInstancesConfiguration_instanceCount :: Lens.Lens' ReservedInstancesConfiguration (Prelude.Maybe Prelude.Int)
reservedInstancesConfiguration_instanceCount :: Lens' ReservedInstancesConfiguration (Maybe Int)
reservedInstancesConfiguration_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstancesConfiguration' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ReservedInstancesConfiguration
s@ReservedInstancesConfiguration' {} Maybe Int
a -> ReservedInstancesConfiguration
s {$sel:instanceCount:ReservedInstancesConfiguration' :: Maybe Int
instanceCount = Maybe Int
a} :: ReservedInstancesConfiguration)
reservedInstancesConfiguration_instanceType :: Lens.Lens' ReservedInstancesConfiguration (Prelude.Maybe InstanceType)
reservedInstancesConfiguration_instanceType :: Lens' ReservedInstancesConfiguration (Maybe InstanceType)
reservedInstancesConfiguration_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstancesConfiguration' {Maybe InstanceType
instanceType :: Maybe InstanceType
$sel:instanceType:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe InstanceType
instanceType} -> Maybe InstanceType
instanceType) (\s :: ReservedInstancesConfiguration
s@ReservedInstancesConfiguration' {} Maybe InstanceType
a -> ReservedInstancesConfiguration
s {$sel:instanceType:ReservedInstancesConfiguration' :: Maybe InstanceType
instanceType = Maybe InstanceType
a} :: ReservedInstancesConfiguration)
reservedInstancesConfiguration_platform :: Lens.Lens' ReservedInstancesConfiguration (Prelude.Maybe Prelude.Text)
reservedInstancesConfiguration_platform :: Lens' ReservedInstancesConfiguration (Maybe Text)
reservedInstancesConfiguration_platform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstancesConfiguration' {Maybe Text
platform :: Maybe Text
$sel:platform:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
platform} -> Maybe Text
platform) (\s :: ReservedInstancesConfiguration
s@ReservedInstancesConfiguration' {} Maybe Text
a -> ReservedInstancesConfiguration
s {$sel:platform:ReservedInstancesConfiguration' :: Maybe Text
platform = Maybe Text
a} :: ReservedInstancesConfiguration)
reservedInstancesConfiguration_scope :: Lens.Lens' ReservedInstancesConfiguration (Prelude.Maybe Scope)
reservedInstancesConfiguration_scope :: Lens' ReservedInstancesConfiguration (Maybe Scope)
reservedInstancesConfiguration_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstancesConfiguration' {Maybe Scope
scope :: Maybe Scope
$sel:scope:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Scope
scope} -> Maybe Scope
scope) (\s :: ReservedInstancesConfiguration
s@ReservedInstancesConfiguration' {} Maybe Scope
a -> ReservedInstancesConfiguration
s {$sel:scope:ReservedInstancesConfiguration' :: Maybe Scope
scope = Maybe Scope
a} :: ReservedInstancesConfiguration)
instance Data.FromXML ReservedInstancesConfiguration where
parseXML :: [Node] -> Either String ReservedInstancesConfiguration
parseXML [Node]
x =
Maybe Text
-> Maybe Int
-> Maybe InstanceType
-> Maybe Text
-> Maybe Scope
-> ReservedInstancesConfiguration
ReservedInstancesConfiguration'
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
"availabilityZone")
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
"instanceCount")
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
"instanceType")
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
"platform")
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
"scope")
instance
Prelude.Hashable
ReservedInstancesConfiguration
where
hashWithSalt :: Int -> ReservedInstancesConfiguration -> Int
hashWithSalt
Int
_salt
ReservedInstancesConfiguration' {Maybe Int
Maybe Text
Maybe InstanceType
Maybe Scope
scope :: Maybe Scope
platform :: Maybe Text
instanceType :: Maybe InstanceType
instanceCount :: Maybe Int
availabilityZone :: Maybe Text
$sel:scope:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Scope
$sel:platform:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
$sel:instanceType:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe InstanceType
$sel:instanceCount:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Int
$sel:availabilityZone:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceType
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platform
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Scope
scope
instance
Prelude.NFData
ReservedInstancesConfiguration
where
rnf :: ReservedInstancesConfiguration -> ()
rnf ReservedInstancesConfiguration' {Maybe Int
Maybe Text
Maybe InstanceType
Maybe Scope
scope :: Maybe Scope
platform :: Maybe Text
instanceType :: Maybe InstanceType
instanceCount :: Maybe Int
availabilityZone :: Maybe Text
$sel:scope:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Scope
$sel:platform:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
$sel:instanceType:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe InstanceType
$sel:instanceCount:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Int
$sel:availabilityZone:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceType
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platform
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Scope
scope
instance Data.ToQuery ReservedInstancesConfiguration where
toQuery :: ReservedInstancesConfiguration -> QueryString
toQuery ReservedInstancesConfiguration' {Maybe Int
Maybe Text
Maybe InstanceType
Maybe Scope
scope :: Maybe Scope
platform :: Maybe Text
instanceType :: Maybe InstanceType
instanceCount :: Maybe Int
availabilityZone :: Maybe Text
$sel:scope:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Scope
$sel:platform:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
$sel:instanceType:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe InstanceType
$sel:instanceCount:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Int
$sel:availabilityZone:ReservedInstancesConfiguration' :: ReservedInstancesConfiguration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"AvailabilityZone" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
availabilityZone,
ByteString
"InstanceCount" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
instanceCount,
ByteString
"InstanceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe InstanceType
instanceType,
ByteString
"Platform" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
platform,
ByteString
"Scope" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Scope
scope
]