{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Lightsail.DownloadDefaultKeyPair
(
DownloadDefaultKeyPair (..),
newDownloadDefaultKeyPair,
DownloadDefaultKeyPairResponse (..),
newDownloadDefaultKeyPairResponse,
downloadDefaultKeyPairResponse_createdAt,
downloadDefaultKeyPairResponse_privateKeyBase64,
downloadDefaultKeyPairResponse_publicKeyBase64,
downloadDefaultKeyPairResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DownloadDefaultKeyPair = DownloadDefaultKeyPair'
{
}
deriving (DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool
$c/= :: DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool
== :: DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool
$c== :: DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool
Prelude.Eq, ReadPrec [DownloadDefaultKeyPair]
ReadPrec DownloadDefaultKeyPair
Int -> ReadS DownloadDefaultKeyPair
ReadS [DownloadDefaultKeyPair]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DownloadDefaultKeyPair]
$creadListPrec :: ReadPrec [DownloadDefaultKeyPair]
readPrec :: ReadPrec DownloadDefaultKeyPair
$creadPrec :: ReadPrec DownloadDefaultKeyPair
readList :: ReadS [DownloadDefaultKeyPair]
$creadList :: ReadS [DownloadDefaultKeyPair]
readsPrec :: Int -> ReadS DownloadDefaultKeyPair
$creadsPrec :: Int -> ReadS DownloadDefaultKeyPair
Prelude.Read, Int -> DownloadDefaultKeyPair -> ShowS
[DownloadDefaultKeyPair] -> ShowS
DownloadDefaultKeyPair -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DownloadDefaultKeyPair] -> ShowS
$cshowList :: [DownloadDefaultKeyPair] -> ShowS
show :: DownloadDefaultKeyPair -> String
$cshow :: DownloadDefaultKeyPair -> String
showsPrec :: Int -> DownloadDefaultKeyPair -> ShowS
$cshowsPrec :: Int -> DownloadDefaultKeyPair -> ShowS
Prelude.Show, forall x. Rep DownloadDefaultKeyPair x -> DownloadDefaultKeyPair
forall x. DownloadDefaultKeyPair -> Rep DownloadDefaultKeyPair x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DownloadDefaultKeyPair x -> DownloadDefaultKeyPair
$cfrom :: forall x. DownloadDefaultKeyPair -> Rep DownloadDefaultKeyPair x
Prelude.Generic)
newDownloadDefaultKeyPair ::
DownloadDefaultKeyPair
newDownloadDefaultKeyPair :: DownloadDefaultKeyPair
newDownloadDefaultKeyPair = DownloadDefaultKeyPair
DownloadDefaultKeyPair'
instance Core.AWSRequest DownloadDefaultKeyPair where
type
AWSResponse DownloadDefaultKeyPair =
DownloadDefaultKeyPairResponse
request :: (Service -> Service)
-> DownloadDefaultKeyPair -> Request DownloadDefaultKeyPair
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DownloadDefaultKeyPair
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DownloadDefaultKeyPair)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"privateKeyBase64")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"publicKeyBase64")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DownloadDefaultKeyPair where
hashWithSalt :: Int -> DownloadDefaultKeyPair -> Int
hashWithSalt Int
_salt DownloadDefaultKeyPair
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData DownloadDefaultKeyPair where
rnf :: DownloadDefaultKeyPair -> ()
rnf DownloadDefaultKeyPair
_ = ()
instance Data.ToHeaders DownloadDefaultKeyPair where
toHeaders :: DownloadDefaultKeyPair -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.DownloadDefaultKeyPair" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DownloadDefaultKeyPair where
toJSON :: DownloadDefaultKeyPair -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath DownloadDefaultKeyPair where
toPath :: DownloadDefaultKeyPair -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DownloadDefaultKeyPair where
toQuery :: DownloadDefaultKeyPair -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DownloadDefaultKeyPairResponse = DownloadDefaultKeyPairResponse'
{
DownloadDefaultKeyPairResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
DownloadDefaultKeyPairResponse -> Maybe Text
privateKeyBase64 :: Prelude.Maybe Prelude.Text,
DownloadDefaultKeyPairResponse -> Maybe Text
publicKeyBase64 :: Prelude.Maybe Prelude.Text,
DownloadDefaultKeyPairResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
$c/= :: DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
== :: DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
$c== :: DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
Prelude.Eq, ReadPrec [DownloadDefaultKeyPairResponse]
ReadPrec DownloadDefaultKeyPairResponse
Int -> ReadS DownloadDefaultKeyPairResponse
ReadS [DownloadDefaultKeyPairResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DownloadDefaultKeyPairResponse]
$creadListPrec :: ReadPrec [DownloadDefaultKeyPairResponse]
readPrec :: ReadPrec DownloadDefaultKeyPairResponse
$creadPrec :: ReadPrec DownloadDefaultKeyPairResponse
readList :: ReadS [DownloadDefaultKeyPairResponse]
$creadList :: ReadS [DownloadDefaultKeyPairResponse]
readsPrec :: Int -> ReadS DownloadDefaultKeyPairResponse
$creadsPrec :: Int -> ReadS DownloadDefaultKeyPairResponse
Prelude.Read, Int -> DownloadDefaultKeyPairResponse -> ShowS
[DownloadDefaultKeyPairResponse] -> ShowS
DownloadDefaultKeyPairResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DownloadDefaultKeyPairResponse] -> ShowS
$cshowList :: [DownloadDefaultKeyPairResponse] -> ShowS
show :: DownloadDefaultKeyPairResponse -> String
$cshow :: DownloadDefaultKeyPairResponse -> String
showsPrec :: Int -> DownloadDefaultKeyPairResponse -> ShowS
$cshowsPrec :: Int -> DownloadDefaultKeyPairResponse -> ShowS
Prelude.Show, forall x.
Rep DownloadDefaultKeyPairResponse x
-> DownloadDefaultKeyPairResponse
forall x.
DownloadDefaultKeyPairResponse
-> Rep DownloadDefaultKeyPairResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DownloadDefaultKeyPairResponse x
-> DownloadDefaultKeyPairResponse
$cfrom :: forall x.
DownloadDefaultKeyPairResponse
-> Rep DownloadDefaultKeyPairResponse x
Prelude.Generic)
newDownloadDefaultKeyPairResponse ::
Prelude.Int ->
DownloadDefaultKeyPairResponse
newDownloadDefaultKeyPairResponse :: Int -> DownloadDefaultKeyPairResponse
newDownloadDefaultKeyPairResponse Int
pHttpStatus_ =
DownloadDefaultKeyPairResponse'
{ $sel:createdAt:DownloadDefaultKeyPairResponse' :: Maybe POSIX
createdAt =
forall a. Maybe a
Prelude.Nothing,
$sel:privateKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
privateKeyBase64 = forall a. Maybe a
Prelude.Nothing,
$sel:publicKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
publicKeyBase64 = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DownloadDefaultKeyPairResponse' :: Int
httpStatus = Int
pHttpStatus_
}
downloadDefaultKeyPairResponse_createdAt :: Lens.Lens' DownloadDefaultKeyPairResponse (Prelude.Maybe Prelude.UTCTime)
downloadDefaultKeyPairResponse_createdAt :: Lens' DownloadDefaultKeyPairResponse (Maybe UTCTime)
downloadDefaultKeyPairResponse_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DownloadDefaultKeyPairResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: DownloadDefaultKeyPairResponse
s@DownloadDefaultKeyPairResponse' {} Maybe POSIX
a -> DownloadDefaultKeyPairResponse
s {$sel:createdAt:DownloadDefaultKeyPairResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: DownloadDefaultKeyPairResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
downloadDefaultKeyPairResponse_privateKeyBase64 :: Lens.Lens' DownloadDefaultKeyPairResponse (Prelude.Maybe Prelude.Text)
downloadDefaultKeyPairResponse_privateKeyBase64 :: Lens' DownloadDefaultKeyPairResponse (Maybe Text)
downloadDefaultKeyPairResponse_privateKeyBase64 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DownloadDefaultKeyPairResponse' {Maybe Text
privateKeyBase64 :: Maybe Text
$sel:privateKeyBase64:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe Text
privateKeyBase64} -> Maybe Text
privateKeyBase64) (\s :: DownloadDefaultKeyPairResponse
s@DownloadDefaultKeyPairResponse' {} Maybe Text
a -> DownloadDefaultKeyPairResponse
s {$sel:privateKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
privateKeyBase64 = Maybe Text
a} :: DownloadDefaultKeyPairResponse)
downloadDefaultKeyPairResponse_publicKeyBase64 :: Lens.Lens' DownloadDefaultKeyPairResponse (Prelude.Maybe Prelude.Text)
downloadDefaultKeyPairResponse_publicKeyBase64 :: Lens' DownloadDefaultKeyPairResponse (Maybe Text)
downloadDefaultKeyPairResponse_publicKeyBase64 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DownloadDefaultKeyPairResponse' {Maybe Text
publicKeyBase64 :: Maybe Text
$sel:publicKeyBase64:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe Text
publicKeyBase64} -> Maybe Text
publicKeyBase64) (\s :: DownloadDefaultKeyPairResponse
s@DownloadDefaultKeyPairResponse' {} Maybe Text
a -> DownloadDefaultKeyPairResponse
s {$sel:publicKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
publicKeyBase64 = Maybe Text
a} :: DownloadDefaultKeyPairResponse)
downloadDefaultKeyPairResponse_httpStatus :: Lens.Lens' DownloadDefaultKeyPairResponse Prelude.Int
downloadDefaultKeyPairResponse_httpStatus :: Lens' DownloadDefaultKeyPairResponse Int
downloadDefaultKeyPairResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DownloadDefaultKeyPairResponse' {Int
httpStatus :: Int
$sel:httpStatus:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DownloadDefaultKeyPairResponse
s@DownloadDefaultKeyPairResponse' {} Int
a -> DownloadDefaultKeyPairResponse
s {$sel:httpStatus:DownloadDefaultKeyPairResponse' :: Int
httpStatus = Int
a} :: DownloadDefaultKeyPairResponse)
instance
Prelude.NFData
DownloadDefaultKeyPairResponse
where
rnf :: DownloadDefaultKeyPairResponse -> ()
rnf DownloadDefaultKeyPairResponse' {Int
Maybe Text
Maybe POSIX
httpStatus :: Int
publicKeyBase64 :: Maybe Text
privateKeyBase64 :: Maybe Text
createdAt :: Maybe POSIX
$sel:httpStatus:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Int
$sel:publicKeyBase64:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe Text
$sel:privateKeyBase64:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe Text
$sel:createdAt:DownloadDefaultKeyPairResponse' :: DownloadDefaultKeyPairResponse -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
privateKeyBase64
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicKeyBase64
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus