{-# 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.OpsWorks.Types.ElasticIp where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ElasticIp = ElasticIp'
{
ElasticIp -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
ElasticIp -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
ElasticIp -> Maybe Text
ip :: Prelude.Maybe Prelude.Text,
ElasticIp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ElasticIp -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (ElasticIp -> ElasticIp -> Bool
(ElasticIp -> ElasticIp -> Bool)
-> (ElasticIp -> ElasticIp -> Bool) -> Eq ElasticIp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticIp -> ElasticIp -> Bool
$c/= :: ElasticIp -> ElasticIp -> Bool
== :: ElasticIp -> ElasticIp -> Bool
$c== :: ElasticIp -> ElasticIp -> Bool
Prelude.Eq, ReadPrec [ElasticIp]
ReadPrec ElasticIp
Int -> ReadS ElasticIp
ReadS [ElasticIp]
(Int -> ReadS ElasticIp)
-> ReadS [ElasticIp]
-> ReadPrec ElasticIp
-> ReadPrec [ElasticIp]
-> Read ElasticIp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticIp]
$creadListPrec :: ReadPrec [ElasticIp]
readPrec :: ReadPrec ElasticIp
$creadPrec :: ReadPrec ElasticIp
readList :: ReadS [ElasticIp]
$creadList :: ReadS [ElasticIp]
readsPrec :: Int -> ReadS ElasticIp
$creadsPrec :: Int -> ReadS ElasticIp
Prelude.Read, Int -> ElasticIp -> ShowS
[ElasticIp] -> ShowS
ElasticIp -> String
(Int -> ElasticIp -> ShowS)
-> (ElasticIp -> String)
-> ([ElasticIp] -> ShowS)
-> Show ElasticIp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticIp] -> ShowS
$cshowList :: [ElasticIp] -> ShowS
show :: ElasticIp -> String
$cshow :: ElasticIp -> String
showsPrec :: Int -> ElasticIp -> ShowS
$cshowsPrec :: Int -> ElasticIp -> ShowS
Prelude.Show, (forall x. ElasticIp -> Rep ElasticIp x)
-> (forall x. Rep ElasticIp x -> ElasticIp) -> Generic ElasticIp
forall x. Rep ElasticIp x -> ElasticIp
forall x. ElasticIp -> Rep ElasticIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ElasticIp x -> ElasticIp
$cfrom :: forall x. ElasticIp -> Rep ElasticIp x
Prelude.Generic)
newElasticIp ::
ElasticIp
newElasticIp :: ElasticIp
newElasticIp =
ElasticIp' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ElasticIp
ElasticIp'
{ $sel:instanceId:ElasticIp' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:ElasticIp' :: Maybe Text
domain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ip:ElasticIp' :: Maybe Text
ip = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ElasticIp' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:ElasticIp' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
elasticIp_instanceId :: Lens.Lens' ElasticIp (Prelude.Maybe Prelude.Text)
elasticIp_instanceId :: (Maybe Text -> f (Maybe Text)) -> ElasticIp -> f ElasticIp
elasticIp_instanceId = (ElasticIp -> Maybe Text)
-> (ElasticIp -> Maybe Text -> ElasticIp)
-> Lens ElasticIp ElasticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticIp' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:ElasticIp' :: ElasticIp -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: ElasticIp
s@ElasticIp' {} Maybe Text
a -> ElasticIp
s {$sel:instanceId:ElasticIp' :: Maybe Text
instanceId = Maybe Text
a} :: ElasticIp)
elasticIp_domain :: Lens.Lens' ElasticIp (Prelude.Maybe Prelude.Text)
elasticIp_domain :: (Maybe Text -> f (Maybe Text)) -> ElasticIp -> f ElasticIp
elasticIp_domain = (ElasticIp -> Maybe Text)
-> (ElasticIp -> Maybe Text -> ElasticIp)
-> Lens ElasticIp ElasticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticIp' {Maybe Text
domain :: Maybe Text
$sel:domain:ElasticIp' :: ElasticIp -> Maybe Text
domain} -> Maybe Text
domain) (\s :: ElasticIp
s@ElasticIp' {} Maybe Text
a -> ElasticIp
s {$sel:domain:ElasticIp' :: Maybe Text
domain = Maybe Text
a} :: ElasticIp)
elasticIp_ip :: Lens.Lens' ElasticIp (Prelude.Maybe Prelude.Text)
elasticIp_ip :: (Maybe Text -> f (Maybe Text)) -> ElasticIp -> f ElasticIp
elasticIp_ip = (ElasticIp -> Maybe Text)
-> (ElasticIp -> Maybe Text -> ElasticIp)
-> Lens ElasticIp ElasticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticIp' {Maybe Text
ip :: Maybe Text
$sel:ip:ElasticIp' :: ElasticIp -> Maybe Text
ip} -> Maybe Text
ip) (\s :: ElasticIp
s@ElasticIp' {} Maybe Text
a -> ElasticIp
s {$sel:ip:ElasticIp' :: Maybe Text
ip = Maybe Text
a} :: ElasticIp)
elasticIp_name :: Lens.Lens' ElasticIp (Prelude.Maybe Prelude.Text)
elasticIp_name :: (Maybe Text -> f (Maybe Text)) -> ElasticIp -> f ElasticIp
elasticIp_name = (ElasticIp -> Maybe Text)
-> (ElasticIp -> Maybe Text -> ElasticIp)
-> Lens ElasticIp ElasticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticIp' {Maybe Text
name :: Maybe Text
$sel:name:ElasticIp' :: ElasticIp -> Maybe Text
name} -> Maybe Text
name) (\s :: ElasticIp
s@ElasticIp' {} Maybe Text
a -> ElasticIp
s {$sel:name:ElasticIp' :: Maybe Text
name = Maybe Text
a} :: ElasticIp)
elasticIp_region :: Lens.Lens' ElasticIp (Prelude.Maybe Prelude.Text)
elasticIp_region :: (Maybe Text -> f (Maybe Text)) -> ElasticIp -> f ElasticIp
elasticIp_region = (ElasticIp -> Maybe Text)
-> (ElasticIp -> Maybe Text -> ElasticIp)
-> Lens ElasticIp ElasticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticIp' {Maybe Text
region :: Maybe Text
$sel:region:ElasticIp' :: ElasticIp -> Maybe Text
region} -> Maybe Text
region) (\s :: ElasticIp
s@ElasticIp' {} Maybe Text
a -> ElasticIp
s {$sel:region:ElasticIp' :: Maybe Text
region = Maybe Text
a} :: ElasticIp)
instance Core.FromJSON ElasticIp where
parseJSON :: Value -> Parser ElasticIp
parseJSON =
String -> (Object -> Parser ElasticIp) -> Value -> Parser ElasticIp
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ElasticIp"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ElasticIp
ElasticIp'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ElasticIp)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> ElasticIp)
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
"InstanceId")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> ElasticIp)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> ElasticIp)
forall (f :: * -> *) a b. Applicative f => 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
"Domain")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ElasticIp)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ElasticIp)
forall (f :: * -> *) a b. Applicative f => 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
"Ip")
Parser (Maybe Text -> Maybe Text -> ElasticIp)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ElasticIp)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
Parser (Maybe Text -> ElasticIp)
-> Parser (Maybe Text) -> Parser ElasticIp
forall (f :: * -> *) a b. Applicative f => 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
"Region")
)
instance Prelude.Hashable ElasticIp
instance Prelude.NFData ElasticIp