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