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