{-# 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.NetworkManager.Types.Relationship where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Relationship = Relationship'
{
Relationship -> Maybe Text
from :: Prelude.Maybe Prelude.Text,
Relationship -> Maybe Text
to :: Prelude.Maybe Prelude.Text
}
deriving (Relationship -> Relationship -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Relationship -> Relationship -> Bool
$c/= :: Relationship -> Relationship -> Bool
== :: Relationship -> Relationship -> Bool
$c== :: Relationship -> Relationship -> Bool
Prelude.Eq, ReadPrec [Relationship]
ReadPrec Relationship
Int -> ReadS Relationship
ReadS [Relationship]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Relationship]
$creadListPrec :: ReadPrec [Relationship]
readPrec :: ReadPrec Relationship
$creadPrec :: ReadPrec Relationship
readList :: ReadS [Relationship]
$creadList :: ReadS [Relationship]
readsPrec :: Int -> ReadS Relationship
$creadsPrec :: Int -> ReadS Relationship
Prelude.Read, Int -> Relationship -> ShowS
[Relationship] -> ShowS
Relationship -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Relationship] -> ShowS
$cshowList :: [Relationship] -> ShowS
show :: Relationship -> String
$cshow :: Relationship -> String
showsPrec :: Int -> Relationship -> ShowS
$cshowsPrec :: Int -> Relationship -> ShowS
Prelude.Show, forall x. Rep Relationship x -> Relationship
forall x. Relationship -> Rep Relationship x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Relationship x -> Relationship
$cfrom :: forall x. Relationship -> Rep Relationship x
Prelude.Generic)
newRelationship ::
Relationship
newRelationship :: Relationship
newRelationship =
Relationship'
{ $sel:from:Relationship' :: Maybe Text
from = forall a. Maybe a
Prelude.Nothing,
$sel:to:Relationship' :: Maybe Text
to = forall a. Maybe a
Prelude.Nothing
}
relationship_from :: Lens.Lens' Relationship (Prelude.Maybe Prelude.Text)
relationship_from :: Lens' Relationship (Maybe Text)
relationship_from = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Relationship' {Maybe Text
from :: Maybe Text
$sel:from:Relationship' :: Relationship -> Maybe Text
from} -> Maybe Text
from) (\s :: Relationship
s@Relationship' {} Maybe Text
a -> Relationship
s {$sel:from:Relationship' :: Maybe Text
from = Maybe Text
a} :: Relationship)
relationship_to :: Lens.Lens' Relationship (Prelude.Maybe Prelude.Text)
relationship_to :: Lens' Relationship (Maybe Text)
relationship_to = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Relationship' {Maybe Text
to :: Maybe Text
$sel:to:Relationship' :: Relationship -> Maybe Text
to} -> Maybe Text
to) (\s :: Relationship
s@Relationship' {} Maybe Text
a -> Relationship
s {$sel:to:Relationship' :: Maybe Text
to = Maybe Text
a} :: Relationship)
instance Data.FromJSON Relationship where
parseJSON :: Value -> Parser Relationship
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Relationship"
( \Object
x ->
Maybe Text -> Maybe Text -> Relationship
Relationship'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"From")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"To")
)
instance Prelude.Hashable Relationship where
hashWithSalt :: Int -> Relationship -> Int
hashWithSalt Int
_salt Relationship' {Maybe Text
to :: Maybe Text
from :: Maybe Text
$sel:to:Relationship' :: Relationship -> Maybe Text
$sel:from:Relationship' :: Relationship -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
from
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
to
instance Prelude.NFData Relationship where
rnf :: Relationship -> ()
rnf Relationship' {Maybe Text
to :: Maybe Text
from :: Maybe Text
$sel:to:Relationship' :: Relationship -> Maybe Text
$sel:from:Relationship' :: Relationship -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
from seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
to