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

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

-- |
-- Module      : Amazonka.Lightsail.Types.InstanceAccessDetails
-- 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)
module Amazonka.Lightsail.Types.InstanceAccessDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.HostKeyAttributes
import Amazonka.Lightsail.Types.InstanceAccessProtocol
import Amazonka.Lightsail.Types.PasswordData
import qualified Amazonka.Prelude as Prelude

-- | The parameters for gaining temporary access to one of your Amazon
-- Lightsail instances.
--
-- /See:/ 'newInstanceAccessDetails' smart constructor.
data InstanceAccessDetails = InstanceAccessDetails'
  { -- | Describes the public SSH host keys or the RDP certificate.
    InstanceAccessDetails -> Maybe [HostKeyAttributes]
hostKeys :: Prelude.Maybe [HostKeyAttributes],
    -- | For SSH access, the public key to use when accessing your instance For
    -- OpenSSH clients (e.g., command line SSH), you should save this value to
    -- @tempkey-cert.pub@.
    InstanceAccessDetails -> Maybe Text
certKey :: Prelude.Maybe Prelude.Text,
    -- | The public IP address of the Amazon Lightsail instance.
    InstanceAccessDetails -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | For SSH access, the temporary private key. For OpenSSH clients (e.g.,
    -- command line SSH), you should save this value to @tempkey@).
    InstanceAccessDetails -> Maybe Text
privateKey :: Prelude.Maybe Prelude.Text,
    -- | For SSH access, the date on which the temporary keys expire.
    InstanceAccessDetails -> Maybe POSIX
expiresAt :: Prelude.Maybe Core.POSIX,
    -- | The user name to use when logging in to the Amazon Lightsail instance.
    InstanceAccessDetails -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | The protocol for these Amazon Lightsail instance access details.
    InstanceAccessDetails -> Maybe InstanceAccessProtocol
protocol :: Prelude.Maybe InstanceAccessProtocol,
    -- | For a Windows Server-based instance, an object with the data you can use
    -- to retrieve your password. This is only needed if @password@ is empty
    -- and the instance is not new (and therefore the password is not ready
    -- yet). When you create an instance, it can take up to 15 minutes for the
    -- instance to be ready.
    InstanceAccessDetails -> Maybe PasswordData
passwordData :: Prelude.Maybe PasswordData,
    -- | For RDP access, the password for your Amazon Lightsail instance.
    -- Password will be an empty string if the password for your new instance
    -- is not ready yet. When you create an instance, it can take up to 15
    -- minutes for the instance to be ready.
    --
    -- If you create an instance using any key pair other than the default
    -- (@LightsailDefaultKeyPair@), @password@ will always be an empty string.
    --
    -- If you change the Administrator password on the instance, Lightsail will
    -- continue to return the original password value. When accessing the
    -- instance using RDP, you need to manually enter the Administrator
    -- password after changing it from the default.
    InstanceAccessDetails -> Maybe Text
password :: Prelude.Maybe Prelude.Text,
    -- | The name of this Amazon Lightsail instance.
    InstanceAccessDetails -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceAccessDetails -> InstanceAccessDetails -> Bool
(InstanceAccessDetails -> InstanceAccessDetails -> Bool)
-> (InstanceAccessDetails -> InstanceAccessDetails -> Bool)
-> Eq InstanceAccessDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceAccessDetails -> InstanceAccessDetails -> Bool
$c/= :: InstanceAccessDetails -> InstanceAccessDetails -> Bool
== :: InstanceAccessDetails -> InstanceAccessDetails -> Bool
$c== :: InstanceAccessDetails -> InstanceAccessDetails -> Bool
Prelude.Eq, ReadPrec [InstanceAccessDetails]
ReadPrec InstanceAccessDetails
Int -> ReadS InstanceAccessDetails
ReadS [InstanceAccessDetails]
(Int -> ReadS InstanceAccessDetails)
-> ReadS [InstanceAccessDetails]
-> ReadPrec InstanceAccessDetails
-> ReadPrec [InstanceAccessDetails]
-> Read InstanceAccessDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceAccessDetails]
$creadListPrec :: ReadPrec [InstanceAccessDetails]
readPrec :: ReadPrec InstanceAccessDetails
$creadPrec :: ReadPrec InstanceAccessDetails
readList :: ReadS [InstanceAccessDetails]
$creadList :: ReadS [InstanceAccessDetails]
readsPrec :: Int -> ReadS InstanceAccessDetails
$creadsPrec :: Int -> ReadS InstanceAccessDetails
Prelude.Read, Int -> InstanceAccessDetails -> ShowS
[InstanceAccessDetails] -> ShowS
InstanceAccessDetails -> String
(Int -> InstanceAccessDetails -> ShowS)
-> (InstanceAccessDetails -> String)
-> ([InstanceAccessDetails] -> ShowS)
-> Show InstanceAccessDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceAccessDetails] -> ShowS
$cshowList :: [InstanceAccessDetails] -> ShowS
show :: InstanceAccessDetails -> String
$cshow :: InstanceAccessDetails -> String
showsPrec :: Int -> InstanceAccessDetails -> ShowS
$cshowsPrec :: Int -> InstanceAccessDetails -> ShowS
Prelude.Show, (forall x. InstanceAccessDetails -> Rep InstanceAccessDetails x)
-> (forall x. Rep InstanceAccessDetails x -> InstanceAccessDetails)
-> Generic InstanceAccessDetails
forall x. Rep InstanceAccessDetails x -> InstanceAccessDetails
forall x. InstanceAccessDetails -> Rep InstanceAccessDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceAccessDetails x -> InstanceAccessDetails
$cfrom :: forall x. InstanceAccessDetails -> Rep InstanceAccessDetails x
Prelude.Generic)

-- |
-- Create a value of 'InstanceAccessDetails' 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:
--
-- 'hostKeys', 'instanceAccessDetails_hostKeys' - Describes the public SSH host keys or the RDP certificate.
--
-- 'certKey', 'instanceAccessDetails_certKey' - For SSH access, the public key to use when accessing your instance For
-- OpenSSH clients (e.g., command line SSH), you should save this value to
-- @tempkey-cert.pub@.
--
-- 'ipAddress', 'instanceAccessDetails_ipAddress' - The public IP address of the Amazon Lightsail instance.
--
-- 'privateKey', 'instanceAccessDetails_privateKey' - For SSH access, the temporary private key. For OpenSSH clients (e.g.,
-- command line SSH), you should save this value to @tempkey@).
--
-- 'expiresAt', 'instanceAccessDetails_expiresAt' - For SSH access, the date on which the temporary keys expire.
--
-- 'username', 'instanceAccessDetails_username' - The user name to use when logging in to the Amazon Lightsail instance.
--
-- 'protocol', 'instanceAccessDetails_protocol' - The protocol for these Amazon Lightsail instance access details.
--
-- 'passwordData', 'instanceAccessDetails_passwordData' - For a Windows Server-based instance, an object with the data you can use
-- to retrieve your password. This is only needed if @password@ is empty
-- and the instance is not new (and therefore the password is not ready
-- yet). When you create an instance, it can take up to 15 minutes for the
-- instance to be ready.
--
-- 'password', 'instanceAccessDetails_password' - For RDP access, the password for your Amazon Lightsail instance.
-- Password will be an empty string if the password for your new instance
-- is not ready yet. When you create an instance, it can take up to 15
-- minutes for the instance to be ready.
--
-- If you create an instance using any key pair other than the default
-- (@LightsailDefaultKeyPair@), @password@ will always be an empty string.
--
-- If you change the Administrator password on the instance, Lightsail will
-- continue to return the original password value. When accessing the
-- instance using RDP, you need to manually enter the Administrator
-- password after changing it from the default.
--
-- 'instanceName', 'instanceAccessDetails_instanceName' - The name of this Amazon Lightsail instance.
newInstanceAccessDetails ::
  InstanceAccessDetails
newInstanceAccessDetails :: InstanceAccessDetails
newInstanceAccessDetails =
  InstanceAccessDetails' :: Maybe [HostKeyAttributes]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe InstanceAccessProtocol
-> Maybe PasswordData
-> Maybe Text
-> Maybe Text
-> InstanceAccessDetails
InstanceAccessDetails'
    { $sel:hostKeys:InstanceAccessDetails' :: Maybe [HostKeyAttributes]
hostKeys = Maybe [HostKeyAttributes]
forall a. Maybe a
Prelude.Nothing,
      $sel:certKey:InstanceAccessDetails' :: Maybe Text
certKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:InstanceAccessDetails' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privateKey:InstanceAccessDetails' :: Maybe Text
privateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expiresAt:InstanceAccessDetails' :: Maybe POSIX
expiresAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:username:InstanceAccessDetails' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocol:InstanceAccessDetails' :: Maybe InstanceAccessProtocol
protocol = Maybe InstanceAccessProtocol
forall a. Maybe a
Prelude.Nothing,
      $sel:passwordData:InstanceAccessDetails' :: Maybe PasswordData
passwordData = Maybe PasswordData
forall a. Maybe a
Prelude.Nothing,
      $sel:password:InstanceAccessDetails' :: Maybe Text
password = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceName:InstanceAccessDetails' :: Maybe Text
instanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the public SSH host keys or the RDP certificate.
instanceAccessDetails_hostKeys :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe [HostKeyAttributes])
instanceAccessDetails_hostKeys :: (Maybe [HostKeyAttributes] -> f (Maybe [HostKeyAttributes]))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_hostKeys = (InstanceAccessDetails -> Maybe [HostKeyAttributes])
-> (InstanceAccessDetails
    -> Maybe [HostKeyAttributes] -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe [HostKeyAttributes])
     (Maybe [HostKeyAttributes])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe [HostKeyAttributes]
hostKeys :: Maybe [HostKeyAttributes]
$sel:hostKeys:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe [HostKeyAttributes]
hostKeys} -> Maybe [HostKeyAttributes]
hostKeys) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe [HostKeyAttributes]
a -> InstanceAccessDetails
s {$sel:hostKeys:InstanceAccessDetails' :: Maybe [HostKeyAttributes]
hostKeys = Maybe [HostKeyAttributes]
a} :: InstanceAccessDetails) ((Maybe [HostKeyAttributes] -> f (Maybe [HostKeyAttributes]))
 -> InstanceAccessDetails -> f InstanceAccessDetails)
-> ((Maybe [HostKeyAttributes] -> f (Maybe [HostKeyAttributes]))
    -> Maybe [HostKeyAttributes] -> f (Maybe [HostKeyAttributes]))
-> (Maybe [HostKeyAttributes] -> f (Maybe [HostKeyAttributes]))
-> InstanceAccessDetails
-> f InstanceAccessDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [HostKeyAttributes]
  [HostKeyAttributes]
  [HostKeyAttributes]
  [HostKeyAttributes]
-> Iso
     (Maybe [HostKeyAttributes])
     (Maybe [HostKeyAttributes])
     (Maybe [HostKeyAttributes])
     (Maybe [HostKeyAttributes])
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
  [HostKeyAttributes]
  [HostKeyAttributes]
  [HostKeyAttributes]
  [HostKeyAttributes]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For SSH access, the public key to use when accessing your instance For
-- OpenSSH clients (e.g., command line SSH), you should save this value to
-- @tempkey-cert.pub@.
instanceAccessDetails_certKey :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_certKey :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_certKey = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
certKey :: Maybe Text
$sel:certKey:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
certKey} -> Maybe Text
certKey) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:certKey:InstanceAccessDetails' :: Maybe Text
certKey = Maybe Text
a} :: InstanceAccessDetails)

-- | The public IP address of the Amazon Lightsail instance.
instanceAccessDetails_ipAddress :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_ipAddress :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_ipAddress = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:ipAddress:InstanceAccessDetails' :: Maybe Text
ipAddress = Maybe Text
a} :: InstanceAccessDetails)

-- | For SSH access, the temporary private key. For OpenSSH clients (e.g.,
-- command line SSH), you should save this value to @tempkey@).
instanceAccessDetails_privateKey :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_privateKey :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_privateKey = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
privateKey :: Maybe Text
$sel:privateKey:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
privateKey} -> Maybe Text
privateKey) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:privateKey:InstanceAccessDetails' :: Maybe Text
privateKey = Maybe Text
a} :: InstanceAccessDetails)

-- | For SSH access, the date on which the temporary keys expire.
instanceAccessDetails_expiresAt :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.UTCTime)
instanceAccessDetails_expiresAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_expiresAt = (InstanceAccessDetails -> Maybe POSIX)
-> (InstanceAccessDetails -> Maybe POSIX -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe POSIX
expiresAt :: Maybe POSIX
$sel:expiresAt:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe POSIX
expiresAt} -> Maybe POSIX
expiresAt) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe POSIX
a -> InstanceAccessDetails
s {$sel:expiresAt:InstanceAccessDetails' :: Maybe POSIX
expiresAt = Maybe POSIX
a} :: InstanceAccessDetails) ((Maybe POSIX -> f (Maybe POSIX))
 -> InstanceAccessDetails -> f InstanceAccessDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceAccessDetails
-> f InstanceAccessDetails
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

-- | The user name to use when logging in to the Amazon Lightsail instance.
instanceAccessDetails_username :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_username :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_username = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
username :: Maybe Text
$sel:username:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
username} -> Maybe Text
username) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:username:InstanceAccessDetails' :: Maybe Text
username = Maybe Text
a} :: InstanceAccessDetails)

-- | The protocol for these Amazon Lightsail instance access details.
instanceAccessDetails_protocol :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe InstanceAccessProtocol)
instanceAccessDetails_protocol :: (Maybe InstanceAccessProtocol -> f (Maybe InstanceAccessProtocol))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_protocol = (InstanceAccessDetails -> Maybe InstanceAccessProtocol)
-> (InstanceAccessDetails
    -> Maybe InstanceAccessProtocol -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe InstanceAccessProtocol)
     (Maybe InstanceAccessProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe InstanceAccessProtocol
protocol :: Maybe InstanceAccessProtocol
$sel:protocol:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe InstanceAccessProtocol
protocol} -> Maybe InstanceAccessProtocol
protocol) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe InstanceAccessProtocol
a -> InstanceAccessDetails
s {$sel:protocol:InstanceAccessDetails' :: Maybe InstanceAccessProtocol
protocol = Maybe InstanceAccessProtocol
a} :: InstanceAccessDetails)

-- | For a Windows Server-based instance, an object with the data you can use
-- to retrieve your password. This is only needed if @password@ is empty
-- and the instance is not new (and therefore the password is not ready
-- yet). When you create an instance, it can take up to 15 minutes for the
-- instance to be ready.
instanceAccessDetails_passwordData :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe PasswordData)
instanceAccessDetails_passwordData :: (Maybe PasswordData -> f (Maybe PasswordData))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_passwordData = (InstanceAccessDetails -> Maybe PasswordData)
-> (InstanceAccessDetails
    -> Maybe PasswordData -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe PasswordData)
     (Maybe PasswordData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe PasswordData
passwordData :: Maybe PasswordData
$sel:passwordData:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe PasswordData
passwordData} -> Maybe PasswordData
passwordData) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe PasswordData
a -> InstanceAccessDetails
s {$sel:passwordData:InstanceAccessDetails' :: Maybe PasswordData
passwordData = Maybe PasswordData
a} :: InstanceAccessDetails)

-- | For RDP access, the password for your Amazon Lightsail instance.
-- Password will be an empty string if the password for your new instance
-- is not ready yet. When you create an instance, it can take up to 15
-- minutes for the instance to be ready.
--
-- If you create an instance using any key pair other than the default
-- (@LightsailDefaultKeyPair@), @password@ will always be an empty string.
--
-- If you change the Administrator password on the instance, Lightsail will
-- continue to return the original password value. When accessing the
-- instance using RDP, you need to manually enter the Administrator
-- password after changing it from the default.
instanceAccessDetails_password :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_password :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_password = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
password :: Maybe Text
$sel:password:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
password} -> Maybe Text
password) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:password:InstanceAccessDetails' :: Maybe Text
password = Maybe Text
a} :: InstanceAccessDetails)

-- | The name of this Amazon Lightsail instance.
instanceAccessDetails_instanceName :: Lens.Lens' InstanceAccessDetails (Prelude.Maybe Prelude.Text)
instanceAccessDetails_instanceName :: (Maybe Text -> f (Maybe Text))
-> InstanceAccessDetails -> f InstanceAccessDetails
instanceAccessDetails_instanceName = (InstanceAccessDetails -> Maybe Text)
-> (InstanceAccessDetails -> Maybe Text -> InstanceAccessDetails)
-> Lens
     InstanceAccessDetails
     InstanceAccessDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAccessDetails' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:InstanceAccessDetails' :: InstanceAccessDetails -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: InstanceAccessDetails
s@InstanceAccessDetails' {} Maybe Text
a -> InstanceAccessDetails
s {$sel:instanceName:InstanceAccessDetails' :: Maybe Text
instanceName = Maybe Text
a} :: InstanceAccessDetails)

instance Core.FromJSON InstanceAccessDetails where
  parseJSON :: Value -> Parser InstanceAccessDetails
parseJSON =
    String
-> (Object -> Parser InstanceAccessDetails)
-> Value
-> Parser InstanceAccessDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceAccessDetails"
      ( \Object
x ->
          Maybe [HostKeyAttributes]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe InstanceAccessProtocol
-> Maybe PasswordData
-> Maybe Text
-> Maybe Text
-> InstanceAccessDetails
InstanceAccessDetails'
            (Maybe [HostKeyAttributes]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe InstanceAccessProtocol
 -> Maybe PasswordData
 -> Maybe Text
 -> Maybe Text
 -> InstanceAccessDetails)
-> Parser (Maybe [HostKeyAttributes])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [HostKeyAttributes]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hostKeys" Parser (Maybe (Maybe [HostKeyAttributes]))
-> Maybe [HostKeyAttributes] -> Parser (Maybe [HostKeyAttributes])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [HostKeyAttributes]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
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
"certKey")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
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
"ipAddress")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
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
"privateKey")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
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
"expiresAt")
            Parser
  (Maybe Text
   -> Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe InstanceAccessProtocol
      -> Maybe PasswordData
      -> Maybe Text
      -> Maybe Text
      -> InstanceAccessDetails)
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
"username")
            Parser
  (Maybe InstanceAccessProtocol
   -> Maybe PasswordData
   -> Maybe Text
   -> Maybe Text
   -> InstanceAccessDetails)
-> Parser (Maybe InstanceAccessProtocol)
-> Parser
     (Maybe PasswordData
      -> Maybe Text -> Maybe Text -> InstanceAccessDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceAccessProtocol)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"protocol")
            Parser
  (Maybe PasswordData
   -> Maybe Text -> Maybe Text -> InstanceAccessDetails)
-> Parser (Maybe PasswordData)
-> Parser (Maybe Text -> Maybe Text -> InstanceAccessDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PasswordData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"passwordData")
            Parser (Maybe Text -> Maybe Text -> InstanceAccessDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> InstanceAccessDetails)
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
"password")
            Parser (Maybe Text -> InstanceAccessDetails)
-> Parser (Maybe Text) -> Parser InstanceAccessDetails
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
"instanceName")
      )

instance Prelude.Hashable InstanceAccessDetails

instance Prelude.NFData InstanceAccessDetails