{-# 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_publicKeyBase64,
downloadDefaultKeyPairResponse_privateKeyBase64,
downloadDefaultKeyPairResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool)
-> (DownloadDefaultKeyPair -> DownloadDefaultKeyPair -> Bool)
-> Eq DownloadDefaultKeyPair
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]
(Int -> ReadS DownloadDefaultKeyPair)
-> ReadS [DownloadDefaultKeyPair]
-> ReadPrec DownloadDefaultKeyPair
-> ReadPrec [DownloadDefaultKeyPair]
-> Read 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
(Int -> DownloadDefaultKeyPair -> ShowS)
-> (DownloadDefaultKeyPair -> String)
-> ([DownloadDefaultKeyPair] -> ShowS)
-> Show DownloadDefaultKeyPair
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. DownloadDefaultKeyPair -> Rep DownloadDefaultKeyPair x)
-> (forall x.
Rep DownloadDefaultKeyPair x -> DownloadDefaultKeyPair)
-> Generic DownloadDefaultKeyPair
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 :: DownloadDefaultKeyPair -> Request DownloadDefaultKeyPair
request = Service -> DownloadDefaultKeyPair -> Request DownloadDefaultKeyPair
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DownloadDefaultKeyPair
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DownloadDefaultKeyPair)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DownloadDefaultKeyPair))
-> Logger
-> Service
-> Proxy DownloadDefaultKeyPair
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DownloadDefaultKeyPair)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse'
(Maybe Text -> Maybe Text -> Int -> DownloadDefaultKeyPairResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> DownloadDefaultKeyPairResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"publicKeyBase64")
Either String (Maybe Text -> Int -> DownloadDefaultKeyPairResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DownloadDefaultKeyPairResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"privateKeyBase64")
Either String (Int -> DownloadDefaultKeyPairResponse)
-> Either String Int
-> Either String DownloadDefaultKeyPairResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DownloadDefaultKeyPair
instance Prelude.NFData DownloadDefaultKeyPair
instance Core.ToHeaders DownloadDefaultKeyPair where
toHeaders :: DownloadDefaultKeyPair -> ResponseHeaders
toHeaders =
ResponseHeaders -> DownloadDefaultKeyPair -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.DownloadDefaultKeyPair" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DownloadDefaultKeyPair where
toJSON :: DownloadDefaultKeyPair -> Value
toJSON = Value -> DownloadDefaultKeyPair -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DownloadDefaultKeyPair where
toPath :: DownloadDefaultKeyPair -> ByteString
toPath = ByteString -> DownloadDefaultKeyPair -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DownloadDefaultKeyPair where
toQuery :: DownloadDefaultKeyPair -> QueryString
toQuery = QueryString -> DownloadDefaultKeyPair -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DownloadDefaultKeyPairResponse = DownloadDefaultKeyPairResponse'
{
DownloadDefaultKeyPairResponse -> Maybe Text
publicKeyBase64 :: Prelude.Maybe Prelude.Text,
DownloadDefaultKeyPairResponse -> Maybe Text
privateKeyBase64 :: Prelude.Maybe Prelude.Text,
DownloadDefaultKeyPairResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool
(DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool)
-> (DownloadDefaultKeyPairResponse
-> DownloadDefaultKeyPairResponse -> Bool)
-> Eq DownloadDefaultKeyPairResponse
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]
(Int -> ReadS DownloadDefaultKeyPairResponse)
-> ReadS [DownloadDefaultKeyPairResponse]
-> ReadPrec DownloadDefaultKeyPairResponse
-> ReadPrec [DownloadDefaultKeyPairResponse]
-> Read 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
(Int -> DownloadDefaultKeyPairResponse -> ShowS)
-> (DownloadDefaultKeyPairResponse -> String)
-> ([DownloadDefaultKeyPairResponse] -> ShowS)
-> Show DownloadDefaultKeyPairResponse
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.
DownloadDefaultKeyPairResponse
-> Rep DownloadDefaultKeyPairResponse x)
-> (forall x.
Rep DownloadDefaultKeyPairResponse x
-> DownloadDefaultKeyPairResponse)
-> Generic DownloadDefaultKeyPairResponse
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' :: Maybe Text -> Maybe Text -> Int -> DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse'
{ $sel:publicKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
publicKeyBase64 =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privateKeyBase64:DownloadDefaultKeyPairResponse' :: Maybe Text
privateKeyBase64 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DownloadDefaultKeyPairResponse' :: Int
httpStatus = Int
pHttpStatus_
}
downloadDefaultKeyPairResponse_publicKeyBase64 :: Lens.Lens' DownloadDefaultKeyPairResponse (Prelude.Maybe Prelude.Text)
downloadDefaultKeyPairResponse_publicKeyBase64 :: (Maybe Text -> f (Maybe Text))
-> DownloadDefaultKeyPairResponse
-> f DownloadDefaultKeyPairResponse
downloadDefaultKeyPairResponse_publicKeyBase64 = (DownloadDefaultKeyPairResponse -> Maybe Text)
-> (DownloadDefaultKeyPairResponse
-> Maybe Text -> DownloadDefaultKeyPairResponse)
-> Lens
DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse
(Maybe Text)
(Maybe Text)
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_privateKeyBase64 :: Lens.Lens' DownloadDefaultKeyPairResponse (Prelude.Maybe Prelude.Text)
downloadDefaultKeyPairResponse_privateKeyBase64 :: (Maybe Text -> f (Maybe Text))
-> DownloadDefaultKeyPairResponse
-> f DownloadDefaultKeyPairResponse
downloadDefaultKeyPairResponse_privateKeyBase64 = (DownloadDefaultKeyPairResponse -> Maybe Text)
-> (DownloadDefaultKeyPairResponse
-> Maybe Text -> DownloadDefaultKeyPairResponse)
-> Lens
DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse
(Maybe Text)
(Maybe Text)
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_httpStatus :: Lens.Lens' DownloadDefaultKeyPairResponse Prelude.Int
downloadDefaultKeyPairResponse_httpStatus :: (Int -> f Int)
-> DownloadDefaultKeyPairResponse
-> f DownloadDefaultKeyPairResponse
downloadDefaultKeyPairResponse_httpStatus = (DownloadDefaultKeyPairResponse -> Int)
-> (DownloadDefaultKeyPairResponse
-> Int -> DownloadDefaultKeyPairResponse)
-> Lens
DownloadDefaultKeyPairResponse
DownloadDefaultKeyPairResponse
Int
Int
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