{-# 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.Lightsail.Types.StaticIp where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data StaticIp = StaticIp'
{
StaticIp -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
StaticIp -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
StaticIp -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
StaticIp -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
StaticIp -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
StaticIp -> Maybe Bool
isAttached :: Prelude.Maybe Prelude.Bool,
StaticIp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
StaticIp -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
StaticIp -> Maybe Text
attachedTo :: Prelude.Maybe Prelude.Text
}
deriving (StaticIp -> StaticIp -> Bool
(StaticIp -> StaticIp -> Bool)
-> (StaticIp -> StaticIp -> Bool) -> Eq StaticIp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StaticIp -> StaticIp -> Bool
$c/= :: StaticIp -> StaticIp -> Bool
== :: StaticIp -> StaticIp -> Bool
$c== :: StaticIp -> StaticIp -> Bool
Prelude.Eq, ReadPrec [StaticIp]
ReadPrec StaticIp
Int -> ReadS StaticIp
ReadS [StaticIp]
(Int -> ReadS StaticIp)
-> ReadS [StaticIp]
-> ReadPrec StaticIp
-> ReadPrec [StaticIp]
-> Read StaticIp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StaticIp]
$creadListPrec :: ReadPrec [StaticIp]
readPrec :: ReadPrec StaticIp
$creadPrec :: ReadPrec StaticIp
readList :: ReadS [StaticIp]
$creadList :: ReadS [StaticIp]
readsPrec :: Int -> ReadS StaticIp
$creadsPrec :: Int -> ReadS StaticIp
Prelude.Read, Int -> StaticIp -> ShowS
[StaticIp] -> ShowS
StaticIp -> String
(Int -> StaticIp -> ShowS)
-> (StaticIp -> String) -> ([StaticIp] -> ShowS) -> Show StaticIp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StaticIp] -> ShowS
$cshowList :: [StaticIp] -> ShowS
show :: StaticIp -> String
$cshow :: StaticIp -> String
showsPrec :: Int -> StaticIp -> ShowS
$cshowsPrec :: Int -> StaticIp -> ShowS
Prelude.Show, (forall x. StaticIp -> Rep StaticIp x)
-> (forall x. Rep StaticIp x -> StaticIp) -> Generic StaticIp
forall x. Rep StaticIp x -> StaticIp
forall x. StaticIp -> Rep StaticIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StaticIp x -> StaticIp
$cfrom :: forall x. StaticIp -> Rep StaticIp x
Prelude.Generic)
newStaticIp ::
StaticIp
newStaticIp :: StaticIp
newStaticIp =
StaticIp' :: Maybe Text
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp
StaticIp'
{ $sel:ipAddress:StaticIp' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:StaticIp' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:StaticIp' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:StaticIp' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:StaticIp' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:isAttached:StaticIp' :: Maybe Bool
isAttached = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:StaticIp' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:StaticIp' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attachedTo:StaticIp' :: Maybe Text
attachedTo = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
staticIp_ipAddress :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Text)
staticIp_ipAddress :: (Maybe Text -> f (Maybe Text)) -> StaticIp -> f StaticIp
staticIp_ipAddress = (StaticIp -> Maybe Text)
-> (StaticIp -> Maybe Text -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:StaticIp' :: StaticIp -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: StaticIp
s@StaticIp' {} Maybe Text
a -> StaticIp
s {$sel:ipAddress:StaticIp' :: Maybe Text
ipAddress = Maybe Text
a} :: StaticIp)
staticIp_resourceType :: Lens.Lens' StaticIp (Prelude.Maybe ResourceType)
staticIp_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> StaticIp -> f StaticIp
staticIp_resourceType = (StaticIp -> Maybe ResourceType)
-> (StaticIp -> Maybe ResourceType -> StaticIp)
-> Lens StaticIp StaticIp (Maybe ResourceType) (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:StaticIp' :: StaticIp -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: StaticIp
s@StaticIp' {} Maybe ResourceType
a -> StaticIp
s {$sel:resourceType:StaticIp' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: StaticIp)
staticIp_arn :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Text)
staticIp_arn :: (Maybe Text -> f (Maybe Text)) -> StaticIp -> f StaticIp
staticIp_arn = (StaticIp -> Maybe Text)
-> (StaticIp -> Maybe Text -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Text
arn :: Maybe Text
$sel:arn:StaticIp' :: StaticIp -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StaticIp
s@StaticIp' {} Maybe Text
a -> StaticIp
s {$sel:arn:StaticIp' :: Maybe Text
arn = Maybe Text
a} :: StaticIp)
staticIp_createdAt :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.UTCTime)
staticIp_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> StaticIp -> f StaticIp
staticIp_createdAt = (StaticIp -> Maybe POSIX)
-> (StaticIp -> Maybe POSIX -> StaticIp)
-> Lens StaticIp StaticIp (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:StaticIp' :: StaticIp -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: StaticIp
s@StaticIp' {} Maybe POSIX
a -> StaticIp
s {$sel:createdAt:StaticIp' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: StaticIp) ((Maybe POSIX -> f (Maybe POSIX)) -> StaticIp -> f StaticIp)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StaticIp
-> f StaticIp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
staticIp_location :: Lens.Lens' StaticIp (Prelude.Maybe ResourceLocation)
staticIp_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> StaticIp -> f StaticIp
staticIp_location = (StaticIp -> Maybe ResourceLocation)
-> (StaticIp -> Maybe ResourceLocation -> StaticIp)
-> Lens
StaticIp StaticIp (Maybe ResourceLocation) (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:StaticIp' :: StaticIp -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: StaticIp
s@StaticIp' {} Maybe ResourceLocation
a -> StaticIp
s {$sel:location:StaticIp' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: StaticIp)
staticIp_isAttached :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Bool)
staticIp_isAttached :: (Maybe Bool -> f (Maybe Bool)) -> StaticIp -> f StaticIp
staticIp_isAttached = (StaticIp -> Maybe Bool)
-> (StaticIp -> Maybe Bool -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Bool
isAttached :: Maybe Bool
$sel:isAttached:StaticIp' :: StaticIp -> Maybe Bool
isAttached} -> Maybe Bool
isAttached) (\s :: StaticIp
s@StaticIp' {} Maybe Bool
a -> StaticIp
s {$sel:isAttached:StaticIp' :: Maybe Bool
isAttached = Maybe Bool
a} :: StaticIp)
staticIp_name :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Text)
staticIp_name :: (Maybe Text -> f (Maybe Text)) -> StaticIp -> f StaticIp
staticIp_name = (StaticIp -> Maybe Text)
-> (StaticIp -> Maybe Text -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Text
name :: Maybe Text
$sel:name:StaticIp' :: StaticIp -> Maybe Text
name} -> Maybe Text
name) (\s :: StaticIp
s@StaticIp' {} Maybe Text
a -> StaticIp
s {$sel:name:StaticIp' :: Maybe Text
name = Maybe Text
a} :: StaticIp)
staticIp_supportCode :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Text)
staticIp_supportCode :: (Maybe Text -> f (Maybe Text)) -> StaticIp -> f StaticIp
staticIp_supportCode = (StaticIp -> Maybe Text)
-> (StaticIp -> Maybe Text -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:StaticIp' :: StaticIp -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: StaticIp
s@StaticIp' {} Maybe Text
a -> StaticIp
s {$sel:supportCode:StaticIp' :: Maybe Text
supportCode = Maybe Text
a} :: StaticIp)
staticIp_attachedTo :: Lens.Lens' StaticIp (Prelude.Maybe Prelude.Text)
staticIp_attachedTo :: (Maybe Text -> f (Maybe Text)) -> StaticIp -> f StaticIp
staticIp_attachedTo = (StaticIp -> Maybe Text)
-> (StaticIp -> Maybe Text -> StaticIp)
-> Lens StaticIp StaticIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticIp' {Maybe Text
attachedTo :: Maybe Text
$sel:attachedTo:StaticIp' :: StaticIp -> Maybe Text
attachedTo} -> Maybe Text
attachedTo) (\s :: StaticIp
s@StaticIp' {} Maybe Text
a -> StaticIp
s {$sel:attachedTo:StaticIp' :: Maybe Text
attachedTo = Maybe Text
a} :: StaticIp)
instance Core.FromJSON StaticIp where
parseJSON :: Value -> Parser StaticIp
parseJSON =
String -> (Object -> Parser StaticIp) -> Value -> Parser StaticIp
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StaticIp"
( \Object
x ->
Maybe Text
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp
StaticIp'
(Maybe Text
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
-> Parser (Maybe Text)
-> Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
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
"ipAddress")
Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
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
"arn")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> StaticIp)
-> Parser (Maybe ResourceLocation)
-> Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> StaticIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> StaticIp)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> StaticIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isAttached")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> StaticIp)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> StaticIp)
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 -> Maybe Text -> StaticIp)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StaticIp)
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
"supportCode")
Parser (Maybe Text -> StaticIp)
-> Parser (Maybe Text) -> Parser StaticIp
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
"attachedTo")
)
instance Prelude.Hashable StaticIp
instance Prelude.NFData StaticIp