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