{-# 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.KeyPair where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude
data KeyPair = KeyPair'
{
KeyPair -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
KeyPair -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
KeyPair -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
KeyPair -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
KeyPair -> Maybe Text
fingerprint :: Prelude.Maybe Prelude.Text,
KeyPair -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
KeyPair -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
KeyPair -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (KeyPair -> KeyPair -> Bool
(KeyPair -> KeyPair -> Bool)
-> (KeyPair -> KeyPair -> Bool) -> Eq KeyPair
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyPair -> KeyPair -> Bool
$c/= :: KeyPair -> KeyPair -> Bool
== :: KeyPair -> KeyPair -> Bool
$c== :: KeyPair -> KeyPair -> Bool
Prelude.Eq, ReadPrec [KeyPair]
ReadPrec KeyPair
Int -> ReadS KeyPair
ReadS [KeyPair]
(Int -> ReadS KeyPair)
-> ReadS [KeyPair]
-> ReadPrec KeyPair
-> ReadPrec [KeyPair]
-> Read KeyPair
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeyPair]
$creadListPrec :: ReadPrec [KeyPair]
readPrec :: ReadPrec KeyPair
$creadPrec :: ReadPrec KeyPair
readList :: ReadS [KeyPair]
$creadList :: ReadS [KeyPair]
readsPrec :: Int -> ReadS KeyPair
$creadsPrec :: Int -> ReadS KeyPair
Prelude.Read, Int -> KeyPair -> ShowS
[KeyPair] -> ShowS
KeyPair -> String
(Int -> KeyPair -> ShowS)
-> (KeyPair -> String) -> ([KeyPair] -> ShowS) -> Show KeyPair
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyPair] -> ShowS
$cshowList :: [KeyPair] -> ShowS
show :: KeyPair -> String
$cshow :: KeyPair -> String
showsPrec :: Int -> KeyPair -> ShowS
$cshowsPrec :: Int -> KeyPair -> ShowS
Prelude.Show, (forall x. KeyPair -> Rep KeyPair x)
-> (forall x. Rep KeyPair x -> KeyPair) -> Generic KeyPair
forall x. Rep KeyPair x -> KeyPair
forall x. KeyPair -> Rep KeyPair x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyPair x -> KeyPair
$cfrom :: forall x. KeyPair -> Rep KeyPair x
Prelude.Generic)
newKeyPair ::
KeyPair
newKeyPair :: KeyPair
newKeyPair =
KeyPair' :: Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair
KeyPair'
{ $sel:resourceType:KeyPair' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:KeyPair' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:KeyPair' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:KeyPair' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:fingerprint:KeyPair' :: Maybe Text
fingerprint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:KeyPair' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:KeyPair' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:KeyPair' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
keyPair_resourceType :: Lens.Lens' KeyPair (Prelude.Maybe ResourceType)
keyPair_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> KeyPair -> f KeyPair
keyPair_resourceType = (KeyPair -> Maybe ResourceType)
-> (KeyPair -> Maybe ResourceType -> KeyPair)
-> Lens KeyPair KeyPair (Maybe ResourceType) (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:KeyPair' :: KeyPair -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: KeyPair
s@KeyPair' {} Maybe ResourceType
a -> KeyPair
s {$sel:resourceType:KeyPair' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: KeyPair)
keyPair_arn :: Lens.Lens' KeyPair (Prelude.Maybe Prelude.Text)
keyPair_arn :: (Maybe Text -> f (Maybe Text)) -> KeyPair -> f KeyPair
keyPair_arn = (KeyPair -> Maybe Text)
-> (KeyPair -> Maybe Text -> KeyPair)
-> Lens KeyPair KeyPair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe Text
arn :: Maybe Text
$sel:arn:KeyPair' :: KeyPair -> Maybe Text
arn} -> Maybe Text
arn) (\s :: KeyPair
s@KeyPair' {} Maybe Text
a -> KeyPair
s {$sel:arn:KeyPair' :: Maybe Text
arn = Maybe Text
a} :: KeyPair)
keyPair_createdAt :: Lens.Lens' KeyPair (Prelude.Maybe Prelude.UTCTime)
keyPair_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> KeyPair -> f KeyPair
keyPair_createdAt = (KeyPair -> Maybe POSIX)
-> (KeyPair -> Maybe POSIX -> KeyPair)
-> Lens KeyPair KeyPair (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:KeyPair' :: KeyPair -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: KeyPair
s@KeyPair' {} Maybe POSIX
a -> KeyPair
s {$sel:createdAt:KeyPair' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: KeyPair) ((Maybe POSIX -> f (Maybe POSIX)) -> KeyPair -> f KeyPair)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyPair
-> f KeyPair
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
keyPair_location :: Lens.Lens' KeyPair (Prelude.Maybe ResourceLocation)
keyPair_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> KeyPair -> f KeyPair
keyPair_location = (KeyPair -> Maybe ResourceLocation)
-> (KeyPair -> Maybe ResourceLocation -> KeyPair)
-> Lens
KeyPair KeyPair (Maybe ResourceLocation) (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:KeyPair' :: KeyPair -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: KeyPair
s@KeyPair' {} Maybe ResourceLocation
a -> KeyPair
s {$sel:location:KeyPair' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: KeyPair)
keyPair_fingerprint :: Lens.Lens' KeyPair (Prelude.Maybe Prelude.Text)
keyPair_fingerprint :: (Maybe Text -> f (Maybe Text)) -> KeyPair -> f KeyPair
keyPair_fingerprint = (KeyPair -> Maybe Text)
-> (KeyPair -> Maybe Text -> KeyPair)
-> Lens KeyPair KeyPair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe Text
fingerprint :: Maybe Text
$sel:fingerprint:KeyPair' :: KeyPair -> Maybe Text
fingerprint} -> Maybe Text
fingerprint) (\s :: KeyPair
s@KeyPair' {} Maybe Text
a -> KeyPair
s {$sel:fingerprint:KeyPair' :: Maybe Text
fingerprint = Maybe Text
a} :: KeyPair)
keyPair_name :: Lens.Lens' KeyPair (Prelude.Maybe Prelude.Text)
keyPair_name :: (Maybe Text -> f (Maybe Text)) -> KeyPair -> f KeyPair
keyPair_name = (KeyPair -> Maybe Text)
-> (KeyPair -> Maybe Text -> KeyPair)
-> Lens KeyPair KeyPair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe Text
name :: Maybe Text
$sel:name:KeyPair' :: KeyPair -> Maybe Text
name} -> Maybe Text
name) (\s :: KeyPair
s@KeyPair' {} Maybe Text
a -> KeyPair
s {$sel:name:KeyPair' :: Maybe Text
name = Maybe Text
a} :: KeyPair)
keyPair_supportCode :: Lens.Lens' KeyPair (Prelude.Maybe Prelude.Text)
keyPair_supportCode :: (Maybe Text -> f (Maybe Text)) -> KeyPair -> f KeyPair
keyPair_supportCode = (KeyPair -> Maybe Text)
-> (KeyPair -> Maybe Text -> KeyPair)
-> Lens KeyPair KeyPair (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:KeyPair' :: KeyPair -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: KeyPair
s@KeyPair' {} Maybe Text
a -> KeyPair
s {$sel:supportCode:KeyPair' :: Maybe Text
supportCode = Maybe Text
a} :: KeyPair)
keyPair_tags :: Lens.Lens' KeyPair (Prelude.Maybe [Tag])
keyPair_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> KeyPair -> f KeyPair
keyPair_tags = (KeyPair -> Maybe [Tag])
-> (KeyPair -> Maybe [Tag] -> KeyPair)
-> Lens KeyPair KeyPair (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyPair' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:KeyPair' :: KeyPair -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: KeyPair
s@KeyPair' {} Maybe [Tag]
a -> KeyPair
s {$sel:tags:KeyPair' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: KeyPair) ((Maybe [Tag] -> f (Maybe [Tag])) -> KeyPair -> f KeyPair)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> KeyPair
-> f KeyPair
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON KeyPair where
parseJSON :: Value -> Parser KeyPair
parseJSON =
String -> (Object -> Parser KeyPair) -> Value -> Parser KeyPair
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"KeyPair"
( \Object
x ->
Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair
KeyPair'
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
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
"arn")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> KeyPair)
-> Parser (Maybe ResourceLocation)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> KeyPair)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> KeyPair)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> KeyPair)
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
"fingerprint")
Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> KeyPair)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> KeyPair)
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
"name")
Parser (Maybe Text -> Maybe [Tag] -> KeyPair)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> KeyPair)
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
"supportCode")
Parser (Maybe [Tag] -> KeyPair)
-> Parser (Maybe [Tag]) -> Parser KeyPair
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable KeyPair
instance Prelude.NFData KeyPair