{-# 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.DestinationInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DestinationInfo = DestinationInfo'
{
DestinationInfo -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
DestinationInfo -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (DestinationInfo -> DestinationInfo -> Bool
(DestinationInfo -> DestinationInfo -> Bool)
-> (DestinationInfo -> DestinationInfo -> Bool)
-> Eq DestinationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationInfo -> DestinationInfo -> Bool
$c/= :: DestinationInfo -> DestinationInfo -> Bool
== :: DestinationInfo -> DestinationInfo -> Bool
$c== :: DestinationInfo -> DestinationInfo -> Bool
Prelude.Eq, ReadPrec [DestinationInfo]
ReadPrec DestinationInfo
Int -> ReadS DestinationInfo
ReadS [DestinationInfo]
(Int -> ReadS DestinationInfo)
-> ReadS [DestinationInfo]
-> ReadPrec DestinationInfo
-> ReadPrec [DestinationInfo]
-> Read DestinationInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationInfo]
$creadListPrec :: ReadPrec [DestinationInfo]
readPrec :: ReadPrec DestinationInfo
$creadPrec :: ReadPrec DestinationInfo
readList :: ReadS [DestinationInfo]
$creadList :: ReadS [DestinationInfo]
readsPrec :: Int -> ReadS DestinationInfo
$creadsPrec :: Int -> ReadS DestinationInfo
Prelude.Read, Int -> DestinationInfo -> ShowS
[DestinationInfo] -> ShowS
DestinationInfo -> String
(Int -> DestinationInfo -> ShowS)
-> (DestinationInfo -> String)
-> ([DestinationInfo] -> ShowS)
-> Show DestinationInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationInfo] -> ShowS
$cshowList :: [DestinationInfo] -> ShowS
show :: DestinationInfo -> String
$cshow :: DestinationInfo -> String
showsPrec :: Int -> DestinationInfo -> ShowS
$cshowsPrec :: Int -> DestinationInfo -> ShowS
Prelude.Show, (forall x. DestinationInfo -> Rep DestinationInfo x)
-> (forall x. Rep DestinationInfo x -> DestinationInfo)
-> Generic DestinationInfo
forall x. Rep DestinationInfo x -> DestinationInfo
forall x. DestinationInfo -> Rep DestinationInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DestinationInfo x -> DestinationInfo
$cfrom :: forall x. DestinationInfo -> Rep DestinationInfo x
Prelude.Generic)
newDestinationInfo ::
DestinationInfo
newDestinationInfo :: DestinationInfo
newDestinationInfo =
DestinationInfo' :: Maybe Text -> Maybe Text -> DestinationInfo
DestinationInfo'
{ $sel:service:DestinationInfo' :: Maybe Text
service = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DestinationInfo' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
destinationInfo_service :: Lens.Lens' DestinationInfo (Prelude.Maybe Prelude.Text)
destinationInfo_service :: (Maybe Text -> f (Maybe Text))
-> DestinationInfo -> f DestinationInfo
destinationInfo_service = (DestinationInfo -> Maybe Text)
-> (DestinationInfo -> Maybe Text -> DestinationInfo)
-> Lens DestinationInfo DestinationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationInfo' {Maybe Text
service :: Maybe Text
$sel:service:DestinationInfo' :: DestinationInfo -> Maybe Text
service} -> Maybe Text
service) (\s :: DestinationInfo
s@DestinationInfo' {} Maybe Text
a -> DestinationInfo
s {$sel:service:DestinationInfo' :: Maybe Text
service = Maybe Text
a} :: DestinationInfo)
destinationInfo_id :: Lens.Lens' DestinationInfo (Prelude.Maybe Prelude.Text)
destinationInfo_id :: (Maybe Text -> f (Maybe Text))
-> DestinationInfo -> f DestinationInfo
destinationInfo_id = (DestinationInfo -> Maybe Text)
-> (DestinationInfo -> Maybe Text -> DestinationInfo)
-> Lens DestinationInfo DestinationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationInfo' {Maybe Text
id :: Maybe Text
$sel:id:DestinationInfo' :: DestinationInfo -> Maybe Text
id} -> Maybe Text
id) (\s :: DestinationInfo
s@DestinationInfo' {} Maybe Text
a -> DestinationInfo
s {$sel:id:DestinationInfo' :: Maybe Text
id = Maybe Text
a} :: DestinationInfo)
instance Core.FromJSON DestinationInfo where
parseJSON :: Value -> Parser DestinationInfo
parseJSON =
String
-> (Object -> Parser DestinationInfo)
-> Value
-> Parser DestinationInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DestinationInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> DestinationInfo
DestinationInfo'
(Maybe Text -> Maybe Text -> DestinationInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DestinationInfo)
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
"service") Parser (Maybe Text -> DestinationInfo)
-> Parser (Maybe Text) -> Parser DestinationInfo
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
"id")
)
instance Prelude.Hashable DestinationInfo
instance Prelude.NFData DestinationInfo