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