{-# 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.Transfer.ImportSshPublicKey
-- 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)
--
-- Adds a Secure Shell (SSH) public key to a user account identified by a
-- @UserName@ value assigned to the specific file transfer protocol-enabled
-- server, identified by @ServerId@.
--
-- The response returns the @UserName@ value, the @ServerId@ value, and the
-- name of the @SshPublicKeyId@.
module Amazonka.Transfer.ImportSshPublicKey
  ( -- * Creating a Request
    ImportSshPublicKey (..),
    newImportSshPublicKey,

    -- * Request Lenses
    importSshPublicKey_serverId,
    importSshPublicKey_sshPublicKeyBody,
    importSshPublicKey_userName,

    -- * Destructuring the Response
    ImportSshPublicKeyResponse (..),
    newImportSshPublicKeyResponse,

    -- * Response Lenses
    importSshPublicKeyResponse_httpStatus,
    importSshPublicKeyResponse_serverId,
    importSshPublicKeyResponse_sshPublicKeyId,
    importSshPublicKeyResponse_userName,
  )
where

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

-- | /See:/ 'newImportSshPublicKey' smart constructor.
data ImportSshPublicKey = ImportSshPublicKey'
  { -- | A system-assigned unique identifier for a server.
    ImportSshPublicKey -> Text
serverId :: Prelude.Text,
    -- | The public key portion of an SSH key pair.
    ImportSshPublicKey -> Text
sshPublicKeyBody :: Prelude.Text,
    -- | The name of the user account that is assigned to one or more servers.
    ImportSshPublicKey -> Text
userName :: Prelude.Text
  }
  deriving (ImportSshPublicKey -> ImportSshPublicKey -> Bool
(ImportSshPublicKey -> ImportSshPublicKey -> Bool)
-> (ImportSshPublicKey -> ImportSshPublicKey -> Bool)
-> Eq ImportSshPublicKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportSshPublicKey -> ImportSshPublicKey -> Bool
$c/= :: ImportSshPublicKey -> ImportSshPublicKey -> Bool
== :: ImportSshPublicKey -> ImportSshPublicKey -> Bool
$c== :: ImportSshPublicKey -> ImportSshPublicKey -> Bool
Prelude.Eq, ReadPrec [ImportSshPublicKey]
ReadPrec ImportSshPublicKey
Int -> ReadS ImportSshPublicKey
ReadS [ImportSshPublicKey]
(Int -> ReadS ImportSshPublicKey)
-> ReadS [ImportSshPublicKey]
-> ReadPrec ImportSshPublicKey
-> ReadPrec [ImportSshPublicKey]
-> Read ImportSshPublicKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportSshPublicKey]
$creadListPrec :: ReadPrec [ImportSshPublicKey]
readPrec :: ReadPrec ImportSshPublicKey
$creadPrec :: ReadPrec ImportSshPublicKey
readList :: ReadS [ImportSshPublicKey]
$creadList :: ReadS [ImportSshPublicKey]
readsPrec :: Int -> ReadS ImportSshPublicKey
$creadsPrec :: Int -> ReadS ImportSshPublicKey
Prelude.Read, Int -> ImportSshPublicKey -> ShowS
[ImportSshPublicKey] -> ShowS
ImportSshPublicKey -> String
(Int -> ImportSshPublicKey -> ShowS)
-> (ImportSshPublicKey -> String)
-> ([ImportSshPublicKey] -> ShowS)
-> Show ImportSshPublicKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportSshPublicKey] -> ShowS
$cshowList :: [ImportSshPublicKey] -> ShowS
show :: ImportSshPublicKey -> String
$cshow :: ImportSshPublicKey -> String
showsPrec :: Int -> ImportSshPublicKey -> ShowS
$cshowsPrec :: Int -> ImportSshPublicKey -> ShowS
Prelude.Show, (forall x. ImportSshPublicKey -> Rep ImportSshPublicKey x)
-> (forall x. Rep ImportSshPublicKey x -> ImportSshPublicKey)
-> Generic ImportSshPublicKey
forall x. Rep ImportSshPublicKey x -> ImportSshPublicKey
forall x. ImportSshPublicKey -> Rep ImportSshPublicKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportSshPublicKey x -> ImportSshPublicKey
$cfrom :: forall x. ImportSshPublicKey -> Rep ImportSshPublicKey x
Prelude.Generic)

-- |
-- Create a value of 'ImportSshPublicKey' 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:
--
-- 'serverId', 'importSshPublicKey_serverId' - A system-assigned unique identifier for a server.
--
-- 'sshPublicKeyBody', 'importSshPublicKey_sshPublicKeyBody' - The public key portion of an SSH key pair.
--
-- 'userName', 'importSshPublicKey_userName' - The name of the user account that is assigned to one or more servers.
newImportSshPublicKey ::
  -- | 'serverId'
  Prelude.Text ->
  -- | 'sshPublicKeyBody'
  Prelude.Text ->
  -- | 'userName'
  Prelude.Text ->
  ImportSshPublicKey
newImportSshPublicKey :: Text -> Text -> Text -> ImportSshPublicKey
newImportSshPublicKey
  Text
pServerId_
  Text
pSshPublicKeyBody_
  Text
pUserName_ =
    ImportSshPublicKey' :: Text -> Text -> Text -> ImportSshPublicKey
ImportSshPublicKey'
      { $sel:serverId:ImportSshPublicKey' :: Text
serverId = Text
pServerId_,
        $sel:sshPublicKeyBody:ImportSshPublicKey' :: Text
sshPublicKeyBody = Text
pSshPublicKeyBody_,
        $sel:userName:ImportSshPublicKey' :: Text
userName = Text
pUserName_
      }

-- | A system-assigned unique identifier for a server.
importSshPublicKey_serverId :: Lens.Lens' ImportSshPublicKey Prelude.Text
importSshPublicKey_serverId :: (Text -> f Text) -> ImportSshPublicKey -> f ImportSshPublicKey
importSshPublicKey_serverId = (ImportSshPublicKey -> Text)
-> (ImportSshPublicKey -> Text -> ImportSshPublicKey)
-> Lens ImportSshPublicKey ImportSshPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKey' {Text
serverId :: Text
$sel:serverId:ImportSshPublicKey' :: ImportSshPublicKey -> Text
serverId} -> Text
serverId) (\s :: ImportSshPublicKey
s@ImportSshPublicKey' {} Text
a -> ImportSshPublicKey
s {$sel:serverId:ImportSshPublicKey' :: Text
serverId = Text
a} :: ImportSshPublicKey)

-- | The public key portion of an SSH key pair.
importSshPublicKey_sshPublicKeyBody :: Lens.Lens' ImportSshPublicKey Prelude.Text
importSshPublicKey_sshPublicKeyBody :: (Text -> f Text) -> ImportSshPublicKey -> f ImportSshPublicKey
importSshPublicKey_sshPublicKeyBody = (ImportSshPublicKey -> Text)
-> (ImportSshPublicKey -> Text -> ImportSshPublicKey)
-> Lens ImportSshPublicKey ImportSshPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKey' {Text
sshPublicKeyBody :: Text
$sel:sshPublicKeyBody:ImportSshPublicKey' :: ImportSshPublicKey -> Text
sshPublicKeyBody} -> Text
sshPublicKeyBody) (\s :: ImportSshPublicKey
s@ImportSshPublicKey' {} Text
a -> ImportSshPublicKey
s {$sel:sshPublicKeyBody:ImportSshPublicKey' :: Text
sshPublicKeyBody = Text
a} :: ImportSshPublicKey)

-- | The name of the user account that is assigned to one or more servers.
importSshPublicKey_userName :: Lens.Lens' ImportSshPublicKey Prelude.Text
importSshPublicKey_userName :: (Text -> f Text) -> ImportSshPublicKey -> f ImportSshPublicKey
importSshPublicKey_userName = (ImportSshPublicKey -> Text)
-> (ImportSshPublicKey -> Text -> ImportSshPublicKey)
-> Lens ImportSshPublicKey ImportSshPublicKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKey' {Text
userName :: Text
$sel:userName:ImportSshPublicKey' :: ImportSshPublicKey -> Text
userName} -> Text
userName) (\s :: ImportSshPublicKey
s@ImportSshPublicKey' {} Text
a -> ImportSshPublicKey
s {$sel:userName:ImportSshPublicKey' :: Text
userName = Text
a} :: ImportSshPublicKey)

instance Core.AWSRequest ImportSshPublicKey where
  type
    AWSResponse ImportSshPublicKey =
      ImportSshPublicKeyResponse
  request :: ImportSshPublicKey -> Request ImportSshPublicKey
request = Service -> ImportSshPublicKey -> Request ImportSshPublicKey
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportSshPublicKey
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportSshPublicKey)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ImportSshPublicKey))
-> Logger
-> Service
-> Proxy ImportSshPublicKey
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportSshPublicKey)))
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 ->
          Int -> Text -> Text -> Text -> ImportSshPublicKeyResponse
ImportSshPublicKeyResponse'
            (Int -> Text -> Text -> Text -> ImportSshPublicKeyResponse)
-> Either String Int
-> Either
     String (Text -> Text -> Text -> ImportSshPublicKeyResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (Text -> Text -> Text -> ImportSshPublicKeyResponse)
-> Either String Text
-> Either String (Text -> Text -> ImportSshPublicKeyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ServerId")
            Either String (Text -> Text -> ImportSshPublicKeyResponse)
-> Either String Text
-> Either String (Text -> ImportSshPublicKeyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"SshPublicKeyId")
            Either String (Text -> ImportSshPublicKeyResponse)
-> Either String Text -> Either String ImportSshPublicKeyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserName")
      )

instance Prelude.Hashable ImportSshPublicKey

instance Prelude.NFData ImportSshPublicKey

instance Core.ToHeaders ImportSshPublicKey where
  toHeaders :: ImportSshPublicKey -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportSshPublicKey -> 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
"TransferService.ImportSshPublicKey" ::
                          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 ImportSshPublicKey where
  toJSON :: ImportSshPublicKey -> Value
toJSON ImportSshPublicKey' {Text
userName :: Text
sshPublicKeyBody :: Text
serverId :: Text
$sel:userName:ImportSshPublicKey' :: ImportSshPublicKey -> Text
$sel:sshPublicKeyBody:ImportSshPublicKey' :: ImportSshPublicKey -> Text
$sel:serverId:ImportSshPublicKey' :: ImportSshPublicKey -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SshPublicKeyBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sshPublicKeyBody),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userName)
          ]
      )

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

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

-- | Identifies the user, the server they belong to, and the identifier of
-- the SSH public key associated with that user. A user can have more than
-- one key on each server that they are associated with.
--
-- /See:/ 'newImportSshPublicKeyResponse' smart constructor.
data ImportSshPublicKeyResponse = ImportSshPublicKeyResponse'
  { -- | The response's http status code.
    ImportSshPublicKeyResponse -> Int
httpStatus :: Prelude.Int,
    -- | A system-assigned unique identifier for a server.
    ImportSshPublicKeyResponse -> Text
serverId :: Prelude.Text,
    -- | The name given to a public key by the system that was imported.
    ImportSshPublicKeyResponse -> Text
sshPublicKeyId :: Prelude.Text,
    -- | A user name assigned to the @ServerID@ value that you specified.
    ImportSshPublicKeyResponse -> Text
userName :: Prelude.Text
  }
  deriving (ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool
(ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool)
-> (ImportSshPublicKeyResponse
    -> ImportSshPublicKeyResponse -> Bool)
-> Eq ImportSshPublicKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool
$c/= :: ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool
== :: ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool
$c== :: ImportSshPublicKeyResponse -> ImportSshPublicKeyResponse -> Bool
Prelude.Eq, ReadPrec [ImportSshPublicKeyResponse]
ReadPrec ImportSshPublicKeyResponse
Int -> ReadS ImportSshPublicKeyResponse
ReadS [ImportSshPublicKeyResponse]
(Int -> ReadS ImportSshPublicKeyResponse)
-> ReadS [ImportSshPublicKeyResponse]
-> ReadPrec ImportSshPublicKeyResponse
-> ReadPrec [ImportSshPublicKeyResponse]
-> Read ImportSshPublicKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportSshPublicKeyResponse]
$creadListPrec :: ReadPrec [ImportSshPublicKeyResponse]
readPrec :: ReadPrec ImportSshPublicKeyResponse
$creadPrec :: ReadPrec ImportSshPublicKeyResponse
readList :: ReadS [ImportSshPublicKeyResponse]
$creadList :: ReadS [ImportSshPublicKeyResponse]
readsPrec :: Int -> ReadS ImportSshPublicKeyResponse
$creadsPrec :: Int -> ReadS ImportSshPublicKeyResponse
Prelude.Read, Int -> ImportSshPublicKeyResponse -> ShowS
[ImportSshPublicKeyResponse] -> ShowS
ImportSshPublicKeyResponse -> String
(Int -> ImportSshPublicKeyResponse -> ShowS)
-> (ImportSshPublicKeyResponse -> String)
-> ([ImportSshPublicKeyResponse] -> ShowS)
-> Show ImportSshPublicKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportSshPublicKeyResponse] -> ShowS
$cshowList :: [ImportSshPublicKeyResponse] -> ShowS
show :: ImportSshPublicKeyResponse -> String
$cshow :: ImportSshPublicKeyResponse -> String
showsPrec :: Int -> ImportSshPublicKeyResponse -> ShowS
$cshowsPrec :: Int -> ImportSshPublicKeyResponse -> ShowS
Prelude.Show, (forall x.
 ImportSshPublicKeyResponse -> Rep ImportSshPublicKeyResponse x)
-> (forall x.
    Rep ImportSshPublicKeyResponse x -> ImportSshPublicKeyResponse)
-> Generic ImportSshPublicKeyResponse
forall x.
Rep ImportSshPublicKeyResponse x -> ImportSshPublicKeyResponse
forall x.
ImportSshPublicKeyResponse -> Rep ImportSshPublicKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportSshPublicKeyResponse x -> ImportSshPublicKeyResponse
$cfrom :: forall x.
ImportSshPublicKeyResponse -> Rep ImportSshPublicKeyResponse x
Prelude.Generic)

-- |
-- Create a value of 'ImportSshPublicKeyResponse' 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:
--
-- 'httpStatus', 'importSshPublicKeyResponse_httpStatus' - The response's http status code.
--
-- 'serverId', 'importSshPublicKeyResponse_serverId' - A system-assigned unique identifier for a server.
--
-- 'sshPublicKeyId', 'importSshPublicKeyResponse_sshPublicKeyId' - The name given to a public key by the system that was imported.
--
-- 'userName', 'importSshPublicKeyResponse_userName' - A user name assigned to the @ServerID@ value that you specified.
newImportSshPublicKeyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serverId'
  Prelude.Text ->
  -- | 'sshPublicKeyId'
  Prelude.Text ->
  -- | 'userName'
  Prelude.Text ->
  ImportSshPublicKeyResponse
newImportSshPublicKeyResponse :: Int -> Text -> Text -> Text -> ImportSshPublicKeyResponse
newImportSshPublicKeyResponse
  Int
pHttpStatus_
  Text
pServerId_
  Text
pSshPublicKeyId_
  Text
pUserName_ =
    ImportSshPublicKeyResponse' :: Int -> Text -> Text -> Text -> ImportSshPublicKeyResponse
ImportSshPublicKeyResponse'
      { $sel:httpStatus:ImportSshPublicKeyResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:serverId:ImportSshPublicKeyResponse' :: Text
serverId = Text
pServerId_,
        $sel:sshPublicKeyId:ImportSshPublicKeyResponse' :: Text
sshPublicKeyId = Text
pSshPublicKeyId_,
        $sel:userName:ImportSshPublicKeyResponse' :: Text
userName = Text
pUserName_
      }

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

-- | A system-assigned unique identifier for a server.
importSshPublicKeyResponse_serverId :: Lens.Lens' ImportSshPublicKeyResponse Prelude.Text
importSshPublicKeyResponse_serverId :: (Text -> f Text)
-> ImportSshPublicKeyResponse -> f ImportSshPublicKeyResponse
importSshPublicKeyResponse_serverId = (ImportSshPublicKeyResponse -> Text)
-> (ImportSshPublicKeyResponse
    -> Text -> ImportSshPublicKeyResponse)
-> Lens
     ImportSshPublicKeyResponse ImportSshPublicKeyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKeyResponse' {Text
serverId :: Text
$sel:serverId:ImportSshPublicKeyResponse' :: ImportSshPublicKeyResponse -> Text
serverId} -> Text
serverId) (\s :: ImportSshPublicKeyResponse
s@ImportSshPublicKeyResponse' {} Text
a -> ImportSshPublicKeyResponse
s {$sel:serverId:ImportSshPublicKeyResponse' :: Text
serverId = Text
a} :: ImportSshPublicKeyResponse)

-- | The name given to a public key by the system that was imported.
importSshPublicKeyResponse_sshPublicKeyId :: Lens.Lens' ImportSshPublicKeyResponse Prelude.Text
importSshPublicKeyResponse_sshPublicKeyId :: (Text -> f Text)
-> ImportSshPublicKeyResponse -> f ImportSshPublicKeyResponse
importSshPublicKeyResponse_sshPublicKeyId = (ImportSshPublicKeyResponse -> Text)
-> (ImportSshPublicKeyResponse
    -> Text -> ImportSshPublicKeyResponse)
-> Lens
     ImportSshPublicKeyResponse ImportSshPublicKeyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKeyResponse' {Text
sshPublicKeyId :: Text
$sel:sshPublicKeyId:ImportSshPublicKeyResponse' :: ImportSshPublicKeyResponse -> Text
sshPublicKeyId} -> Text
sshPublicKeyId) (\s :: ImportSshPublicKeyResponse
s@ImportSshPublicKeyResponse' {} Text
a -> ImportSshPublicKeyResponse
s {$sel:sshPublicKeyId:ImportSshPublicKeyResponse' :: Text
sshPublicKeyId = Text
a} :: ImportSshPublicKeyResponse)

-- | A user name assigned to the @ServerID@ value that you specified.
importSshPublicKeyResponse_userName :: Lens.Lens' ImportSshPublicKeyResponse Prelude.Text
importSshPublicKeyResponse_userName :: (Text -> f Text)
-> ImportSshPublicKeyResponse -> f ImportSshPublicKeyResponse
importSshPublicKeyResponse_userName = (ImportSshPublicKeyResponse -> Text)
-> (ImportSshPublicKeyResponse
    -> Text -> ImportSshPublicKeyResponse)
-> Lens
     ImportSshPublicKeyResponse ImportSshPublicKeyResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSshPublicKeyResponse' {Text
userName :: Text
$sel:userName:ImportSshPublicKeyResponse' :: ImportSshPublicKeyResponse -> Text
userName} -> Text
userName) (\s :: ImportSshPublicKeyResponse
s@ImportSshPublicKeyResponse' {} Text
a -> ImportSshPublicKeyResponse
s {$sel:userName:ImportSshPublicKeyResponse' :: Text
userName = Text
a} :: ImportSshPublicKeyResponse)

instance Prelude.NFData ImportSshPublicKeyResponse