{-# 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.InstanceTypeOffering 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.LocationType
import qualified Amazonka.Prelude as Prelude
data InstanceTypeOffering = InstanceTypeOffering'
{
InstanceTypeOffering -> Maybe InstanceType
instanceType :: Prelude.Maybe InstanceType,
InstanceTypeOffering -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
InstanceTypeOffering -> Maybe LocationType
locationType :: Prelude.Maybe LocationType
}
deriving (InstanceTypeOffering -> InstanceTypeOffering -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceTypeOffering -> InstanceTypeOffering -> Bool
$c/= :: InstanceTypeOffering -> InstanceTypeOffering -> Bool
== :: InstanceTypeOffering -> InstanceTypeOffering -> Bool
$c== :: InstanceTypeOffering -> InstanceTypeOffering -> Bool
Prelude.Eq, ReadPrec [InstanceTypeOffering]
ReadPrec InstanceTypeOffering
Int -> ReadS InstanceTypeOffering
ReadS [InstanceTypeOffering]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceTypeOffering]
$creadListPrec :: ReadPrec [InstanceTypeOffering]
readPrec :: ReadPrec InstanceTypeOffering
$creadPrec :: ReadPrec InstanceTypeOffering
readList :: ReadS [InstanceTypeOffering]
$creadList :: ReadS [InstanceTypeOffering]
readsPrec :: Int -> ReadS InstanceTypeOffering
$creadsPrec :: Int -> ReadS InstanceTypeOffering
Prelude.Read, Int -> InstanceTypeOffering -> ShowS
[InstanceTypeOffering] -> ShowS
InstanceTypeOffering -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceTypeOffering] -> ShowS
$cshowList :: [InstanceTypeOffering] -> ShowS
show :: InstanceTypeOffering -> String
$cshow :: InstanceTypeOffering -> String
showsPrec :: Int -> InstanceTypeOffering -> ShowS
$cshowsPrec :: Int -> InstanceTypeOffering -> ShowS
Prelude.Show, forall x. Rep InstanceTypeOffering x -> InstanceTypeOffering
forall x. InstanceTypeOffering -> Rep InstanceTypeOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceTypeOffering x -> InstanceTypeOffering
$cfrom :: forall x. InstanceTypeOffering -> Rep InstanceTypeOffering x
Prelude.Generic)
newInstanceTypeOffering ::
InstanceTypeOffering
newInstanceTypeOffering :: InstanceTypeOffering
newInstanceTypeOffering =
InstanceTypeOffering'
{ $sel:instanceType:InstanceTypeOffering' :: Maybe InstanceType
instanceType =
forall a. Maybe a
Prelude.Nothing,
$sel:location:InstanceTypeOffering' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
$sel:locationType:InstanceTypeOffering' :: Maybe LocationType
locationType = forall a. Maybe a
Prelude.Nothing
}
instanceTypeOffering_instanceType :: Lens.Lens' InstanceTypeOffering (Prelude.Maybe InstanceType)
instanceTypeOffering_instanceType :: Lens' InstanceTypeOffering (Maybe InstanceType)
instanceTypeOffering_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeOffering' {Maybe InstanceType
instanceType :: Maybe InstanceType
$sel:instanceType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe InstanceType
instanceType} -> Maybe InstanceType
instanceType) (\s :: InstanceTypeOffering
s@InstanceTypeOffering' {} Maybe InstanceType
a -> InstanceTypeOffering
s {$sel:instanceType:InstanceTypeOffering' :: Maybe InstanceType
instanceType = Maybe InstanceType
a} :: InstanceTypeOffering)
instanceTypeOffering_location :: Lens.Lens' InstanceTypeOffering (Prelude.Maybe Prelude.Text)
instanceTypeOffering_location :: Lens' InstanceTypeOffering (Maybe Text)
instanceTypeOffering_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeOffering' {Maybe Text
location :: Maybe Text
$sel:location:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe Text
location} -> Maybe Text
location) (\s :: InstanceTypeOffering
s@InstanceTypeOffering' {} Maybe Text
a -> InstanceTypeOffering
s {$sel:location:InstanceTypeOffering' :: Maybe Text
location = Maybe Text
a} :: InstanceTypeOffering)
instanceTypeOffering_locationType :: Lens.Lens' InstanceTypeOffering (Prelude.Maybe LocationType)
instanceTypeOffering_locationType :: Lens' InstanceTypeOffering (Maybe LocationType)
instanceTypeOffering_locationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeOffering' {Maybe LocationType
locationType :: Maybe LocationType
$sel:locationType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe LocationType
locationType} -> Maybe LocationType
locationType) (\s :: InstanceTypeOffering
s@InstanceTypeOffering' {} Maybe LocationType
a -> InstanceTypeOffering
s {$sel:locationType:InstanceTypeOffering' :: Maybe LocationType
locationType = Maybe LocationType
a} :: InstanceTypeOffering)
instance Data.FromXML InstanceTypeOffering where
parseXML :: [Node] -> Either String InstanceTypeOffering
parseXML [Node]
x =
Maybe InstanceType
-> Maybe Text -> Maybe LocationType -> InstanceTypeOffering
InstanceTypeOffering'
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
"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
"location")
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
"locationType")
instance Prelude.Hashable InstanceTypeOffering where
hashWithSalt :: Int -> InstanceTypeOffering -> Int
hashWithSalt Int
_salt InstanceTypeOffering' {Maybe Text
Maybe InstanceType
Maybe LocationType
locationType :: Maybe LocationType
location :: Maybe Text
instanceType :: Maybe InstanceType
$sel:locationType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe LocationType
$sel:location:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe Text
$sel:instanceType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe InstanceType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceType
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LocationType
locationType
instance Prelude.NFData InstanceTypeOffering where
rnf :: InstanceTypeOffering -> ()
rnf InstanceTypeOffering' {Maybe Text
Maybe InstanceType
Maybe LocationType
locationType :: Maybe LocationType
location :: Maybe Text
instanceType :: Maybe InstanceType
$sel:locationType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe LocationType
$sel:location:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe Text
$sel:instanceType:InstanceTypeOffering' :: InstanceTypeOffering -> Maybe InstanceType
..} =
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
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LocationType
locationType