{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2InstanceConnect.SendSerialConsoleSSHPublicKey
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Pushes an SSH public key to the specified EC2 instance. The key remains
-- for 60 seconds, which gives you 60 seconds to establish a serial console
-- connection to the instance using SSH. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html EC2 Serial Console>
-- in the /Amazon EC2 User Guide/.
module Amazonka.EC2InstanceConnect.SendSerialConsoleSSHPublicKey
  ( -- * Creating a Request
    SendSerialConsoleSSHPublicKey (..),
    newSendSerialConsoleSSHPublicKey,

    -- * Request Lenses
    sendSerialConsoleSSHPublicKey_serialPort,
    sendSerialConsoleSSHPublicKey_instanceId,
    sendSerialConsoleSSHPublicKey_sSHPublicKey,

    -- * Destructuring the Response
    SendSerialConsoleSSHPublicKeyResponse (..),
    newSendSerialConsoleSSHPublicKeyResponse,

    -- * Response Lenses
    sendSerialConsoleSSHPublicKeyResponse_requestId,
    sendSerialConsoleSSHPublicKeyResponse_success,
    sendSerialConsoleSSHPublicKeyResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EC2InstanceConnect.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSendSerialConsoleSSHPublicKey' smart constructor.
data SendSerialConsoleSSHPublicKey = SendSerialConsoleSSHPublicKey'
  { -- | The serial port of the EC2 instance. Currently only port 0 is supported.
    --
    -- Default: 0
    SendSerialConsoleSSHPublicKey -> Maybe Natural
serialPort :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the EC2 instance.
    SendSerialConsoleSSHPublicKey -> Text
instanceId :: Prelude.Text,
    -- | The public key material. To use the public key, you must have the
    -- matching private key. For information about the supported key formats
    -- and lengths, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws Requirements for key pairs>
    -- in the /Amazon EC2 User Guide/.
    SendSerialConsoleSSHPublicKey -> Text
sSHPublicKey :: Prelude.Text
  }
  deriving (SendSerialConsoleSSHPublicKey
-> SendSerialConsoleSSHPublicKey -> Bool
(SendSerialConsoleSSHPublicKey
 -> SendSerialConsoleSSHPublicKey -> Bool)
-> (SendSerialConsoleSSHPublicKey
    -> SendSerialConsoleSSHPublicKey -> Bool)
-> Eq SendSerialConsoleSSHPublicKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendSerialConsoleSSHPublicKey
-> SendSerialConsoleSSHPublicKey -> Bool
$c/= :: SendSerialConsoleSSHPublicKey
-> SendSerialConsoleSSHPublicKey -> Bool
== :: SendSerialConsoleSSHPublicKey
-> SendSerialConsoleSSHPublicKey -> Bool
$c== :: SendSerialConsoleSSHPublicKey
-> SendSerialConsoleSSHPublicKey -> Bool
Prelude.Eq, ReadPrec [SendSerialConsoleSSHPublicKey]
ReadPrec SendSerialConsoleSSHPublicKey
Int -> ReadS SendSerialConsoleSSHPublicKey
ReadS [SendSerialConsoleSSHPublicKey]
(Int -> ReadS SendSerialConsoleSSHPublicKey)
-> ReadS [SendSerialConsoleSSHPublicKey]
-> ReadPrec SendSerialConsoleSSHPublicKey
-> ReadPrec [SendSerialConsoleSSHPublicKey]
-> Read SendSerialConsoleSSHPublicKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendSerialConsoleSSHPublicKey]
$creadListPrec :: ReadPrec [SendSerialConsoleSSHPublicKey]
readPrec :: ReadPrec SendSerialConsoleSSHPublicKey
$creadPrec :: ReadPrec SendSerialConsoleSSHPublicKey
readList :: ReadS [SendSerialConsoleSSHPublicKey]
$creadList :: ReadS [SendSerialConsoleSSHPublicKey]
readsPrec :: Int -> ReadS SendSerialConsoleSSHPublicKey
$creadsPrec :: Int -> ReadS SendSerialConsoleSSHPublicKey
Prelude.Read, Int -> SendSerialConsoleSSHPublicKey -> ShowS
[SendSerialConsoleSSHPublicKey] -> ShowS
SendSerialConsoleSSHPublicKey -> String
(Int -> SendSerialConsoleSSHPublicKey -> ShowS)
-> (SendSerialConsoleSSHPublicKey -> String)
-> ([SendSerialConsoleSSHPublicKey] -> ShowS)
-> Show SendSerialConsoleSSHPublicKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendSerialConsoleSSHPublicKey] -> ShowS
$cshowList :: [SendSerialConsoleSSHPublicKey] -> ShowS
show :: SendSerialConsoleSSHPublicKey -> String
$cshow :: SendSerialConsoleSSHPublicKey -> String
showsPrec :: Int -> SendSerialConsoleSSHPublicKey -> ShowS
$cshowsPrec :: Int -> SendSerialConsoleSSHPublicKey -> ShowS
Prelude.Show, (forall x.
 SendSerialConsoleSSHPublicKey
 -> Rep SendSerialConsoleSSHPublicKey x)
-> (forall x.
    Rep SendSerialConsoleSSHPublicKey x
    -> SendSerialConsoleSSHPublicKey)
-> Generic SendSerialConsoleSSHPublicKey
forall x.
Rep SendSerialConsoleSSHPublicKey x
-> SendSerialConsoleSSHPublicKey
forall x.
SendSerialConsoleSSHPublicKey
-> Rep SendSerialConsoleSSHPublicKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendSerialConsoleSSHPublicKey x
-> SendSerialConsoleSSHPublicKey
$cfrom :: forall x.
SendSerialConsoleSSHPublicKey
-> Rep SendSerialConsoleSSHPublicKey x
Prelude.Generic)

-- |
-- Create a value of 'SendSerialConsoleSSHPublicKey' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'serialPort', 'sendSerialConsoleSSHPublicKey_serialPort' - The serial port of the EC2 instance. Currently only port 0 is supported.
--
-- Default: 0
--
-- 'instanceId', 'sendSerialConsoleSSHPublicKey_instanceId' - The ID of the EC2 instance.
--
-- 'sSHPublicKey', 'sendSerialConsoleSSHPublicKey_sSHPublicKey' - The public key material. To use the public key, you must have the
-- matching private key. For information about the supported key formats
-- and lengths, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws Requirements for key pairs>
-- in the /Amazon EC2 User Guide/.
newSendSerialConsoleSSHPublicKey ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'sSHPublicKey'
  Prelude.Text ->
  SendSerialConsoleSSHPublicKey
newSendSerialConsoleSSHPublicKey :: Text -> Text -> SendSerialConsoleSSHPublicKey
newSendSerialConsoleSSHPublicKey
  Text
pInstanceId_
  Text
pSSHPublicKey_ =
    SendSerialConsoleSSHPublicKey' :: Maybe Natural -> Text -> Text -> SendSerialConsoleSSHPublicKey
SendSerialConsoleSSHPublicKey'
      { $sel:serialPort:SendSerialConsoleSSHPublicKey' :: Maybe Natural
serialPort =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:SendSerialConsoleSSHPublicKey' :: Text
instanceId = Text
pInstanceId_,
        $sel:sSHPublicKey:SendSerialConsoleSSHPublicKey' :: Text
sSHPublicKey = Text
pSSHPublicKey_
      }

-- | The serial port of the EC2 instance. Currently only port 0 is supported.
--
-- Default: 0
sendSerialConsoleSSHPublicKey_serialPort :: Lens.Lens' SendSerialConsoleSSHPublicKey (Prelude.Maybe Prelude.Natural)
sendSerialConsoleSSHPublicKey_serialPort :: (Maybe Natural -> f (Maybe Natural))
-> SendSerialConsoleSSHPublicKey -> f SendSerialConsoleSSHPublicKey
sendSerialConsoleSSHPublicKey_serialPort = (SendSerialConsoleSSHPublicKey -> Maybe Natural)
-> (SendSerialConsoleSSHPublicKey
    -> Maybe Natural -> SendSerialConsoleSSHPublicKey)
-> Lens
     SendSerialConsoleSSHPublicKey
     SendSerialConsoleSSHPublicKey
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKey' {Maybe Natural
serialPort :: Maybe Natural
$sel:serialPort:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Maybe Natural
serialPort} -> Maybe Natural
serialPort) (\s :: SendSerialConsoleSSHPublicKey
s@SendSerialConsoleSSHPublicKey' {} Maybe Natural
a -> SendSerialConsoleSSHPublicKey
s {$sel:serialPort:SendSerialConsoleSSHPublicKey' :: Maybe Natural
serialPort = Maybe Natural
a} :: SendSerialConsoleSSHPublicKey)

-- | The ID of the EC2 instance.
sendSerialConsoleSSHPublicKey_instanceId :: Lens.Lens' SendSerialConsoleSSHPublicKey Prelude.Text
sendSerialConsoleSSHPublicKey_instanceId :: (Text -> f Text)
-> SendSerialConsoleSSHPublicKey -> f SendSerialConsoleSSHPublicKey
sendSerialConsoleSSHPublicKey_instanceId = (SendSerialConsoleSSHPublicKey -> Text)
-> (SendSerialConsoleSSHPublicKey
    -> Text -> SendSerialConsoleSSHPublicKey)
-> Lens
     SendSerialConsoleSSHPublicKey
     SendSerialConsoleSSHPublicKey
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKey' {Text
instanceId :: Text
$sel:instanceId:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Text
instanceId} -> Text
instanceId) (\s :: SendSerialConsoleSSHPublicKey
s@SendSerialConsoleSSHPublicKey' {} Text
a -> SendSerialConsoleSSHPublicKey
s {$sel:instanceId:SendSerialConsoleSSHPublicKey' :: Text
instanceId = Text
a} :: SendSerialConsoleSSHPublicKey)

-- | The public key material. To use the public key, you must have the
-- matching private key. For information about the supported key formats
-- and lengths, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws Requirements for key pairs>
-- in the /Amazon EC2 User Guide/.
sendSerialConsoleSSHPublicKey_sSHPublicKey :: Lens.Lens' SendSerialConsoleSSHPublicKey Prelude.Text
sendSerialConsoleSSHPublicKey_sSHPublicKey :: (Text -> f Text)
-> SendSerialConsoleSSHPublicKey -> f SendSerialConsoleSSHPublicKey
sendSerialConsoleSSHPublicKey_sSHPublicKey = (SendSerialConsoleSSHPublicKey -> Text)
-> (SendSerialConsoleSSHPublicKey
    -> Text -> SendSerialConsoleSSHPublicKey)
-> Lens
     SendSerialConsoleSSHPublicKey
     SendSerialConsoleSSHPublicKey
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKey' {Text
sSHPublicKey :: Text
$sel:sSHPublicKey:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Text
sSHPublicKey} -> Text
sSHPublicKey) (\s :: SendSerialConsoleSSHPublicKey
s@SendSerialConsoleSSHPublicKey' {} Text
a -> SendSerialConsoleSSHPublicKey
s {$sel:sSHPublicKey:SendSerialConsoleSSHPublicKey' :: Text
sSHPublicKey = Text
a} :: SendSerialConsoleSSHPublicKey)

instance
  Core.AWSRequest
    SendSerialConsoleSSHPublicKey
  where
  type
    AWSResponse SendSerialConsoleSSHPublicKey =
      SendSerialConsoleSSHPublicKeyResponse
  request :: SendSerialConsoleSSHPublicKey
-> Request SendSerialConsoleSSHPublicKey
request = Service
-> SendSerialConsoleSSHPublicKey
-> Request SendSerialConsoleSSHPublicKey
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SendSerialConsoleSSHPublicKey
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendSerialConsoleSSHPublicKey)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SendSerialConsoleSSHPublicKey))
-> Logger
-> Service
-> Proxy SendSerialConsoleSSHPublicKey
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendSerialConsoleSSHPublicKey)))
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 Bool -> Int -> SendSerialConsoleSSHPublicKeyResponse
SendSerialConsoleSSHPublicKeyResponse'
            (Maybe Text
 -> Maybe Bool -> Int -> SendSerialConsoleSSHPublicKeyResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> SendSerialConsoleSSHPublicKeyResponse)
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
"RequestId")
            Either
  String (Maybe Bool -> Int -> SendSerialConsoleSSHPublicKeyResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> SendSerialConsoleSSHPublicKeyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Success")
            Either String (Int -> SendSerialConsoleSSHPublicKeyResponse)
-> Either String Int
-> Either String SendSerialConsoleSSHPublicKeyResponse
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
    SendSerialConsoleSSHPublicKey

instance Prelude.NFData SendSerialConsoleSSHPublicKey

instance Core.ToHeaders SendSerialConsoleSSHPublicKey where
  toHeaders :: SendSerialConsoleSSHPublicKey -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SendSerialConsoleSSHPublicKey -> 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
"AWSEC2InstanceConnectService.SendSerialConsoleSSHPublicKey" ::
                          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 SendSerialConsoleSSHPublicKey where
  toJSON :: SendSerialConsoleSSHPublicKey -> Value
toJSON SendSerialConsoleSSHPublicKey' {Maybe Natural
Text
sSHPublicKey :: Text
instanceId :: Text
serialPort :: Maybe Natural
$sel:sSHPublicKey:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Text
$sel:instanceId:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Text
$sel:serialPort:SendSerialConsoleSSHPublicKey' :: SendSerialConsoleSSHPublicKey -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SerialPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
serialPort,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SSHPublicKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sSHPublicKey)
          ]
      )

instance Core.ToPath SendSerialConsoleSSHPublicKey where
  toPath :: SendSerialConsoleSSHPublicKey -> ByteString
toPath = ByteString -> SendSerialConsoleSSHPublicKey -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery SendSerialConsoleSSHPublicKey where
  toQuery :: SendSerialConsoleSSHPublicKey -> QueryString
toQuery = QueryString -> SendSerialConsoleSSHPublicKey -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newSendSerialConsoleSSHPublicKeyResponse' smart constructor.
data SendSerialConsoleSSHPublicKeyResponse = SendSerialConsoleSSHPublicKeyResponse'
  { -- | The ID of the request. Please provide this ID when contacting AWS
    -- Support for assistance.
    SendSerialConsoleSSHPublicKeyResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | Is true if the request succeeds and an error otherwise.
    SendSerialConsoleSSHPublicKeyResponse -> Maybe Bool
success :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    SendSerialConsoleSSHPublicKeyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SendSerialConsoleSSHPublicKeyResponse
-> SendSerialConsoleSSHPublicKeyResponse -> Bool
(SendSerialConsoleSSHPublicKeyResponse
 -> SendSerialConsoleSSHPublicKeyResponse -> Bool)
-> (SendSerialConsoleSSHPublicKeyResponse
    -> SendSerialConsoleSSHPublicKeyResponse -> Bool)
-> Eq SendSerialConsoleSSHPublicKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendSerialConsoleSSHPublicKeyResponse
-> SendSerialConsoleSSHPublicKeyResponse -> Bool
$c/= :: SendSerialConsoleSSHPublicKeyResponse
-> SendSerialConsoleSSHPublicKeyResponse -> Bool
== :: SendSerialConsoleSSHPublicKeyResponse
-> SendSerialConsoleSSHPublicKeyResponse -> Bool
$c== :: SendSerialConsoleSSHPublicKeyResponse
-> SendSerialConsoleSSHPublicKeyResponse -> Bool
Prelude.Eq, ReadPrec [SendSerialConsoleSSHPublicKeyResponse]
ReadPrec SendSerialConsoleSSHPublicKeyResponse
Int -> ReadS SendSerialConsoleSSHPublicKeyResponse
ReadS [SendSerialConsoleSSHPublicKeyResponse]
(Int -> ReadS SendSerialConsoleSSHPublicKeyResponse)
-> ReadS [SendSerialConsoleSSHPublicKeyResponse]
-> ReadPrec SendSerialConsoleSSHPublicKeyResponse
-> ReadPrec [SendSerialConsoleSSHPublicKeyResponse]
-> Read SendSerialConsoleSSHPublicKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendSerialConsoleSSHPublicKeyResponse]
$creadListPrec :: ReadPrec [SendSerialConsoleSSHPublicKeyResponse]
readPrec :: ReadPrec SendSerialConsoleSSHPublicKeyResponse
$creadPrec :: ReadPrec SendSerialConsoleSSHPublicKeyResponse
readList :: ReadS [SendSerialConsoleSSHPublicKeyResponse]
$creadList :: ReadS [SendSerialConsoleSSHPublicKeyResponse]
readsPrec :: Int -> ReadS SendSerialConsoleSSHPublicKeyResponse
$creadsPrec :: Int -> ReadS SendSerialConsoleSSHPublicKeyResponse
Prelude.Read, Int -> SendSerialConsoleSSHPublicKeyResponse -> ShowS
[SendSerialConsoleSSHPublicKeyResponse] -> ShowS
SendSerialConsoleSSHPublicKeyResponse -> String
(Int -> SendSerialConsoleSSHPublicKeyResponse -> ShowS)
-> (SendSerialConsoleSSHPublicKeyResponse -> String)
-> ([SendSerialConsoleSSHPublicKeyResponse] -> ShowS)
-> Show SendSerialConsoleSSHPublicKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendSerialConsoleSSHPublicKeyResponse] -> ShowS
$cshowList :: [SendSerialConsoleSSHPublicKeyResponse] -> ShowS
show :: SendSerialConsoleSSHPublicKeyResponse -> String
$cshow :: SendSerialConsoleSSHPublicKeyResponse -> String
showsPrec :: Int -> SendSerialConsoleSSHPublicKeyResponse -> ShowS
$cshowsPrec :: Int -> SendSerialConsoleSSHPublicKeyResponse -> ShowS
Prelude.Show, (forall x.
 SendSerialConsoleSSHPublicKeyResponse
 -> Rep SendSerialConsoleSSHPublicKeyResponse x)
-> (forall x.
    Rep SendSerialConsoleSSHPublicKeyResponse x
    -> SendSerialConsoleSSHPublicKeyResponse)
-> Generic SendSerialConsoleSSHPublicKeyResponse
forall x.
Rep SendSerialConsoleSSHPublicKeyResponse x
-> SendSerialConsoleSSHPublicKeyResponse
forall x.
SendSerialConsoleSSHPublicKeyResponse
-> Rep SendSerialConsoleSSHPublicKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendSerialConsoleSSHPublicKeyResponse x
-> SendSerialConsoleSSHPublicKeyResponse
$cfrom :: forall x.
SendSerialConsoleSSHPublicKeyResponse
-> Rep SendSerialConsoleSSHPublicKeyResponse x
Prelude.Generic)

-- |
-- Create a value of 'SendSerialConsoleSSHPublicKeyResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestId', 'sendSerialConsoleSSHPublicKeyResponse_requestId' - The ID of the request. Please provide this ID when contacting AWS
-- Support for assistance.
--
-- 'success', 'sendSerialConsoleSSHPublicKeyResponse_success' - Is true if the request succeeds and an error otherwise.
--
-- 'httpStatus', 'sendSerialConsoleSSHPublicKeyResponse_httpStatus' - The response's http status code.
newSendSerialConsoleSSHPublicKeyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendSerialConsoleSSHPublicKeyResponse
newSendSerialConsoleSSHPublicKeyResponse :: Int -> SendSerialConsoleSSHPublicKeyResponse
newSendSerialConsoleSSHPublicKeyResponse Int
pHttpStatus_ =
  SendSerialConsoleSSHPublicKeyResponse' :: Maybe Text
-> Maybe Bool -> Int -> SendSerialConsoleSSHPublicKeyResponse
SendSerialConsoleSSHPublicKeyResponse'
    { $sel:requestId:SendSerialConsoleSSHPublicKeyResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:success:SendSerialConsoleSSHPublicKeyResponse' :: Maybe Bool
success = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SendSerialConsoleSSHPublicKeyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the request. Please provide this ID when contacting AWS
-- Support for assistance.
sendSerialConsoleSSHPublicKeyResponse_requestId :: Lens.Lens' SendSerialConsoleSSHPublicKeyResponse (Prelude.Maybe Prelude.Text)
sendSerialConsoleSSHPublicKeyResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> SendSerialConsoleSSHPublicKeyResponse
-> f SendSerialConsoleSSHPublicKeyResponse
sendSerialConsoleSSHPublicKeyResponse_requestId = (SendSerialConsoleSSHPublicKeyResponse -> Maybe Text)
-> (SendSerialConsoleSSHPublicKeyResponse
    -> Maybe Text -> SendSerialConsoleSSHPublicKeyResponse)
-> Lens
     SendSerialConsoleSSHPublicKeyResponse
     SendSerialConsoleSSHPublicKeyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKeyResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:SendSerialConsoleSSHPublicKeyResponse' :: SendSerialConsoleSSHPublicKeyResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: SendSerialConsoleSSHPublicKeyResponse
s@SendSerialConsoleSSHPublicKeyResponse' {} Maybe Text
a -> SendSerialConsoleSSHPublicKeyResponse
s {$sel:requestId:SendSerialConsoleSSHPublicKeyResponse' :: Maybe Text
requestId = Maybe Text
a} :: SendSerialConsoleSSHPublicKeyResponse)

-- | Is true if the request succeeds and an error otherwise.
sendSerialConsoleSSHPublicKeyResponse_success :: Lens.Lens' SendSerialConsoleSSHPublicKeyResponse (Prelude.Maybe Prelude.Bool)
sendSerialConsoleSSHPublicKeyResponse_success :: (Maybe Bool -> f (Maybe Bool))
-> SendSerialConsoleSSHPublicKeyResponse
-> f SendSerialConsoleSSHPublicKeyResponse
sendSerialConsoleSSHPublicKeyResponse_success = (SendSerialConsoleSSHPublicKeyResponse -> Maybe Bool)
-> (SendSerialConsoleSSHPublicKeyResponse
    -> Maybe Bool -> SendSerialConsoleSSHPublicKeyResponse)
-> Lens
     SendSerialConsoleSSHPublicKeyResponse
     SendSerialConsoleSSHPublicKeyResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKeyResponse' {Maybe Bool
success :: Maybe Bool
$sel:success:SendSerialConsoleSSHPublicKeyResponse' :: SendSerialConsoleSSHPublicKeyResponse -> Maybe Bool
success} -> Maybe Bool
success) (\s :: SendSerialConsoleSSHPublicKeyResponse
s@SendSerialConsoleSSHPublicKeyResponse' {} Maybe Bool
a -> SendSerialConsoleSSHPublicKeyResponse
s {$sel:success:SendSerialConsoleSSHPublicKeyResponse' :: Maybe Bool
success = Maybe Bool
a} :: SendSerialConsoleSSHPublicKeyResponse)

-- | The response's http status code.
sendSerialConsoleSSHPublicKeyResponse_httpStatus :: Lens.Lens' SendSerialConsoleSSHPublicKeyResponse Prelude.Int
sendSerialConsoleSSHPublicKeyResponse_httpStatus :: (Int -> f Int)
-> SendSerialConsoleSSHPublicKeyResponse
-> f SendSerialConsoleSSHPublicKeyResponse
sendSerialConsoleSSHPublicKeyResponse_httpStatus = (SendSerialConsoleSSHPublicKeyResponse -> Int)
-> (SendSerialConsoleSSHPublicKeyResponse
    -> Int -> SendSerialConsoleSSHPublicKeyResponse)
-> Lens
     SendSerialConsoleSSHPublicKeyResponse
     SendSerialConsoleSSHPublicKeyResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendSerialConsoleSSHPublicKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendSerialConsoleSSHPublicKeyResponse' :: SendSerialConsoleSSHPublicKeyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendSerialConsoleSSHPublicKeyResponse
s@SendSerialConsoleSSHPublicKeyResponse' {} Int
a -> SendSerialConsoleSSHPublicKeyResponse
s {$sel:httpStatus:SendSerialConsoleSSHPublicKeyResponse' :: Int
httpStatus = Int
a} :: SendSerialConsoleSSHPublicKeyResponse)

instance
  Prelude.NFData
    SendSerialConsoleSSHPublicKeyResponse