{-# 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.Lightsail.GetRelationalDatabaseMasterUserPassword
-- 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)
--
-- Returns the current, previous, or pending versions of the master user
-- password for a Lightsail database.
--
-- The @GetRelationalDatabaseMasterUserPassword@ operation supports
-- tag-based access control via resource tags applied to the resource
-- identified by relationalDatabaseName.
module Amazonka.Lightsail.GetRelationalDatabaseMasterUserPassword
  ( -- * Creating a Request
    GetRelationalDatabaseMasterUserPassword (..),
    newGetRelationalDatabaseMasterUserPassword,

    -- * Request Lenses
    getRelationalDatabaseMasterUserPassword_passwordVersion,
    getRelationalDatabaseMasterUserPassword_relationalDatabaseName,

    -- * Destructuring the Response
    GetRelationalDatabaseMasterUserPasswordResponse (..),
    newGetRelationalDatabaseMasterUserPasswordResponse,

    -- * Response Lenses
    getRelationalDatabaseMasterUserPasswordResponse_masterUserPassword,
    getRelationalDatabaseMasterUserPasswordResponse_createdAt,
    getRelationalDatabaseMasterUserPasswordResponse_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

-- | /See:/ 'newGetRelationalDatabaseMasterUserPassword' smart constructor.
data GetRelationalDatabaseMasterUserPassword = GetRelationalDatabaseMasterUserPassword'
  { -- | The password version to return.
    --
    -- Specifying @CURRENT@ or @PREVIOUS@ returns the current or previous
    -- passwords respectively. Specifying @PENDING@ returns the newest version
    -- of the password that will rotate to @CURRENT@. After the @PENDING@
    -- password rotates to @CURRENT@, the @PENDING@ password is no longer
    -- available.
    --
    -- Default: @CURRENT@
    GetRelationalDatabaseMasterUserPassword
-> Maybe RelationalDatabasePasswordVersion
passwordVersion :: Prelude.Maybe RelationalDatabasePasswordVersion,
    -- | The name of your database for which to get the master user password.
    GetRelationalDatabaseMasterUserPassword -> Text
relationalDatabaseName :: Prelude.Text
  }
  deriving (GetRelationalDatabaseMasterUserPassword
-> GetRelationalDatabaseMasterUserPassword -> Bool
(GetRelationalDatabaseMasterUserPassword
 -> GetRelationalDatabaseMasterUserPassword -> Bool)
-> (GetRelationalDatabaseMasterUserPassword
    -> GetRelationalDatabaseMasterUserPassword -> Bool)
-> Eq GetRelationalDatabaseMasterUserPassword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMasterUserPassword
-> GetRelationalDatabaseMasterUserPassword -> Bool
$c/= :: GetRelationalDatabaseMasterUserPassword
-> GetRelationalDatabaseMasterUserPassword -> Bool
== :: GetRelationalDatabaseMasterUserPassword
-> GetRelationalDatabaseMasterUserPassword -> Bool
$c== :: GetRelationalDatabaseMasterUserPassword
-> GetRelationalDatabaseMasterUserPassword -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseMasterUserPassword]
ReadPrec GetRelationalDatabaseMasterUserPassword
Int -> ReadS GetRelationalDatabaseMasterUserPassword
ReadS [GetRelationalDatabaseMasterUserPassword]
(Int -> ReadS GetRelationalDatabaseMasterUserPassword)
-> ReadS [GetRelationalDatabaseMasterUserPassword]
-> ReadPrec GetRelationalDatabaseMasterUserPassword
-> ReadPrec [GetRelationalDatabaseMasterUserPassword]
-> Read GetRelationalDatabaseMasterUserPassword
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseMasterUserPassword]
$creadListPrec :: ReadPrec [GetRelationalDatabaseMasterUserPassword]
readPrec :: ReadPrec GetRelationalDatabaseMasterUserPassword
$creadPrec :: ReadPrec GetRelationalDatabaseMasterUserPassword
readList :: ReadS [GetRelationalDatabaseMasterUserPassword]
$creadList :: ReadS [GetRelationalDatabaseMasterUserPassword]
readsPrec :: Int -> ReadS GetRelationalDatabaseMasterUserPassword
$creadsPrec :: Int -> ReadS GetRelationalDatabaseMasterUserPassword
Prelude.Read, Int -> GetRelationalDatabaseMasterUserPassword -> ShowS
[GetRelationalDatabaseMasterUserPassword] -> ShowS
GetRelationalDatabaseMasterUserPassword -> String
(Int -> GetRelationalDatabaseMasterUserPassword -> ShowS)
-> (GetRelationalDatabaseMasterUserPassword -> String)
-> ([GetRelationalDatabaseMasterUserPassword] -> ShowS)
-> Show GetRelationalDatabaseMasterUserPassword
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMasterUserPassword] -> ShowS
$cshowList :: [GetRelationalDatabaseMasterUserPassword] -> ShowS
show :: GetRelationalDatabaseMasterUserPassword -> String
$cshow :: GetRelationalDatabaseMasterUserPassword -> String
showsPrec :: Int -> GetRelationalDatabaseMasterUserPassword -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMasterUserPassword -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseMasterUserPassword
 -> Rep GetRelationalDatabaseMasterUserPassword x)
-> (forall x.
    Rep GetRelationalDatabaseMasterUserPassword x
    -> GetRelationalDatabaseMasterUserPassword)
-> Generic GetRelationalDatabaseMasterUserPassword
forall x.
Rep GetRelationalDatabaseMasterUserPassword x
-> GetRelationalDatabaseMasterUserPassword
forall x.
GetRelationalDatabaseMasterUserPassword
-> Rep GetRelationalDatabaseMasterUserPassword x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMasterUserPassword x
-> GetRelationalDatabaseMasterUserPassword
$cfrom :: forall x.
GetRelationalDatabaseMasterUserPassword
-> Rep GetRelationalDatabaseMasterUserPassword x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseMasterUserPassword' 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:
--
-- 'passwordVersion', 'getRelationalDatabaseMasterUserPassword_passwordVersion' - The password version to return.
--
-- Specifying @CURRENT@ or @PREVIOUS@ returns the current or previous
-- passwords respectively. Specifying @PENDING@ returns the newest version
-- of the password that will rotate to @CURRENT@. After the @PENDING@
-- password rotates to @CURRENT@, the @PENDING@ password is no longer
-- available.
--
-- Default: @CURRENT@
--
-- 'relationalDatabaseName', 'getRelationalDatabaseMasterUserPassword_relationalDatabaseName' - The name of your database for which to get the master user password.
newGetRelationalDatabaseMasterUserPassword ::
  -- | 'relationalDatabaseName'
  Prelude.Text ->
  GetRelationalDatabaseMasterUserPassword
newGetRelationalDatabaseMasterUserPassword :: Text -> GetRelationalDatabaseMasterUserPassword
newGetRelationalDatabaseMasterUserPassword
  Text
pRelationalDatabaseName_ =
    GetRelationalDatabaseMasterUserPassword' :: Maybe RelationalDatabasePasswordVersion
-> Text -> GetRelationalDatabaseMasterUserPassword
GetRelationalDatabaseMasterUserPassword'
      { $sel:passwordVersion:GetRelationalDatabaseMasterUserPassword' :: Maybe RelationalDatabasePasswordVersion
passwordVersion =
          Maybe RelationalDatabasePasswordVersion
forall a. Maybe a
Prelude.Nothing,
        $sel:relationalDatabaseName:GetRelationalDatabaseMasterUserPassword' :: Text
relationalDatabaseName =
          Text
pRelationalDatabaseName_
      }

-- | The password version to return.
--
-- Specifying @CURRENT@ or @PREVIOUS@ returns the current or previous
-- passwords respectively. Specifying @PENDING@ returns the newest version
-- of the password that will rotate to @CURRENT@. After the @PENDING@
-- password rotates to @CURRENT@, the @PENDING@ password is no longer
-- available.
--
-- Default: @CURRENT@
getRelationalDatabaseMasterUserPassword_passwordVersion :: Lens.Lens' GetRelationalDatabaseMasterUserPassword (Prelude.Maybe RelationalDatabasePasswordVersion)
getRelationalDatabaseMasterUserPassword_passwordVersion :: (Maybe RelationalDatabasePasswordVersion
 -> f (Maybe RelationalDatabasePasswordVersion))
-> GetRelationalDatabaseMasterUserPassword
-> f GetRelationalDatabaseMasterUserPassword
getRelationalDatabaseMasterUserPassword_passwordVersion = (GetRelationalDatabaseMasterUserPassword
 -> Maybe RelationalDatabasePasswordVersion)
-> (GetRelationalDatabaseMasterUserPassword
    -> Maybe RelationalDatabasePasswordVersion
    -> GetRelationalDatabaseMasterUserPassword)
-> Lens
     GetRelationalDatabaseMasterUserPassword
     GetRelationalDatabaseMasterUserPassword
     (Maybe RelationalDatabasePasswordVersion)
     (Maybe RelationalDatabasePasswordVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMasterUserPassword' {Maybe RelationalDatabasePasswordVersion
passwordVersion :: Maybe RelationalDatabasePasswordVersion
$sel:passwordVersion:GetRelationalDatabaseMasterUserPassword' :: GetRelationalDatabaseMasterUserPassword
-> Maybe RelationalDatabasePasswordVersion
passwordVersion} -> Maybe RelationalDatabasePasswordVersion
passwordVersion) (\s :: GetRelationalDatabaseMasterUserPassword
s@GetRelationalDatabaseMasterUserPassword' {} Maybe RelationalDatabasePasswordVersion
a -> GetRelationalDatabaseMasterUserPassword
s {$sel:passwordVersion:GetRelationalDatabaseMasterUserPassword' :: Maybe RelationalDatabasePasswordVersion
passwordVersion = Maybe RelationalDatabasePasswordVersion
a} :: GetRelationalDatabaseMasterUserPassword)

-- | The name of your database for which to get the master user password.
getRelationalDatabaseMasterUserPassword_relationalDatabaseName :: Lens.Lens' GetRelationalDatabaseMasterUserPassword Prelude.Text
getRelationalDatabaseMasterUserPassword_relationalDatabaseName :: (Text -> f Text)
-> GetRelationalDatabaseMasterUserPassword
-> f GetRelationalDatabaseMasterUserPassword
getRelationalDatabaseMasterUserPassword_relationalDatabaseName = (GetRelationalDatabaseMasterUserPassword -> Text)
-> (GetRelationalDatabaseMasterUserPassword
    -> Text -> GetRelationalDatabaseMasterUserPassword)
-> Lens
     GetRelationalDatabaseMasterUserPassword
     GetRelationalDatabaseMasterUserPassword
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMasterUserPassword' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseMasterUserPassword' :: GetRelationalDatabaseMasterUserPassword -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: GetRelationalDatabaseMasterUserPassword
s@GetRelationalDatabaseMasterUserPassword' {} Text
a -> GetRelationalDatabaseMasterUserPassword
s {$sel:relationalDatabaseName:GetRelationalDatabaseMasterUserPassword' :: Text
relationalDatabaseName = Text
a} :: GetRelationalDatabaseMasterUserPassword)

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

instance
  Prelude.NFData
    GetRelationalDatabaseMasterUserPassword

instance
  Core.ToHeaders
    GetRelationalDatabaseMasterUserPassword
  where
  toHeaders :: GetRelationalDatabaseMasterUserPassword -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetRelationalDatabaseMasterUserPassword -> 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.GetRelationalDatabaseMasterUserPassword" ::
                          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
    GetRelationalDatabaseMasterUserPassword
  where
  toJSON :: GetRelationalDatabaseMasterUserPassword -> Value
toJSON GetRelationalDatabaseMasterUserPassword' {Maybe RelationalDatabasePasswordVersion
Text
relationalDatabaseName :: Text
passwordVersion :: Maybe RelationalDatabasePasswordVersion
$sel:relationalDatabaseName:GetRelationalDatabaseMasterUserPassword' :: GetRelationalDatabaseMasterUserPassword -> Text
$sel:passwordVersion:GetRelationalDatabaseMasterUserPassword' :: GetRelationalDatabaseMasterUserPassword
-> Maybe RelationalDatabasePasswordVersion
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"passwordVersion" Text -> RelationalDatabasePasswordVersion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RelationalDatabasePasswordVersion -> Pair)
-> Maybe RelationalDatabasePasswordVersion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RelationalDatabasePasswordVersion
passwordVersion,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"relationalDatabaseName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseName
              )
          ]
      )

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

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

-- | /See:/ 'newGetRelationalDatabaseMasterUserPasswordResponse' smart constructor.
data GetRelationalDatabaseMasterUserPasswordResponse = GetRelationalDatabaseMasterUserPasswordResponse'
  { -- | The master user password for the @password version@ specified.
    GetRelationalDatabaseMasterUserPasswordResponse
-> Maybe (Sensitive Text)
masterUserPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The timestamp when the specified version of the master user password was
    -- created.
    GetRelationalDatabaseMasterUserPasswordResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    GetRelationalDatabaseMasterUserPasswordResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRelationalDatabaseMasterUserPasswordResponse
-> GetRelationalDatabaseMasterUserPasswordResponse -> Bool
(GetRelationalDatabaseMasterUserPasswordResponse
 -> GetRelationalDatabaseMasterUserPasswordResponse -> Bool)
-> (GetRelationalDatabaseMasterUserPasswordResponse
    -> GetRelationalDatabaseMasterUserPasswordResponse -> Bool)
-> Eq GetRelationalDatabaseMasterUserPasswordResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMasterUserPasswordResponse
-> GetRelationalDatabaseMasterUserPasswordResponse -> Bool
$c/= :: GetRelationalDatabaseMasterUserPasswordResponse
-> GetRelationalDatabaseMasterUserPasswordResponse -> Bool
== :: GetRelationalDatabaseMasterUserPasswordResponse
-> GetRelationalDatabaseMasterUserPasswordResponse -> Bool
$c== :: GetRelationalDatabaseMasterUserPasswordResponse
-> GetRelationalDatabaseMasterUserPasswordResponse -> Bool
Prelude.Eq, Int -> GetRelationalDatabaseMasterUserPasswordResponse -> ShowS
[GetRelationalDatabaseMasterUserPasswordResponse] -> ShowS
GetRelationalDatabaseMasterUserPasswordResponse -> String
(Int -> GetRelationalDatabaseMasterUserPasswordResponse -> ShowS)
-> (GetRelationalDatabaseMasterUserPasswordResponse -> String)
-> ([GetRelationalDatabaseMasterUserPasswordResponse] -> ShowS)
-> Show GetRelationalDatabaseMasterUserPasswordResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMasterUserPasswordResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseMasterUserPasswordResponse] -> ShowS
show :: GetRelationalDatabaseMasterUserPasswordResponse -> String
$cshow :: GetRelationalDatabaseMasterUserPasswordResponse -> String
showsPrec :: Int -> GetRelationalDatabaseMasterUserPasswordResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMasterUserPasswordResponse -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseMasterUserPasswordResponse
 -> Rep GetRelationalDatabaseMasterUserPasswordResponse x)
-> (forall x.
    Rep GetRelationalDatabaseMasterUserPasswordResponse x
    -> GetRelationalDatabaseMasterUserPasswordResponse)
-> Generic GetRelationalDatabaseMasterUserPasswordResponse
forall x.
Rep GetRelationalDatabaseMasterUserPasswordResponse x
-> GetRelationalDatabaseMasterUserPasswordResponse
forall x.
GetRelationalDatabaseMasterUserPasswordResponse
-> Rep GetRelationalDatabaseMasterUserPasswordResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMasterUserPasswordResponse x
-> GetRelationalDatabaseMasterUserPasswordResponse
$cfrom :: forall x.
GetRelationalDatabaseMasterUserPasswordResponse
-> Rep GetRelationalDatabaseMasterUserPasswordResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseMasterUserPasswordResponse' 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:
--
-- 'masterUserPassword', 'getRelationalDatabaseMasterUserPasswordResponse_masterUserPassword' - The master user password for the @password version@ specified.
--
-- 'createdAt', 'getRelationalDatabaseMasterUserPasswordResponse_createdAt' - The timestamp when the specified version of the master user password was
-- created.
--
-- 'httpStatus', 'getRelationalDatabaseMasterUserPasswordResponse_httpStatus' - The response's http status code.
newGetRelationalDatabaseMasterUserPasswordResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRelationalDatabaseMasterUserPasswordResponse
newGetRelationalDatabaseMasterUserPasswordResponse :: Int -> GetRelationalDatabaseMasterUserPasswordResponse
newGetRelationalDatabaseMasterUserPasswordResponse
  Int
pHttpStatus_ =
    GetRelationalDatabaseMasterUserPasswordResponse' :: Maybe (Sensitive Text)
-> Maybe POSIX
-> Int
-> GetRelationalDatabaseMasterUserPasswordResponse
GetRelationalDatabaseMasterUserPasswordResponse'
      { $sel:masterUserPassword:GetRelationalDatabaseMasterUserPasswordResponse' :: Maybe (Sensitive Text)
masterUserPassword =
          Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:createdAt:GetRelationalDatabaseMasterUserPasswordResponse' :: Maybe POSIX
createdAt =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRelationalDatabaseMasterUserPasswordResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The master user password for the @password version@ specified.
getRelationalDatabaseMasterUserPasswordResponse_masterUserPassword :: Lens.Lens' GetRelationalDatabaseMasterUserPasswordResponse (Prelude.Maybe Prelude.Text)
getRelationalDatabaseMasterUserPasswordResponse_masterUserPassword :: (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabaseMasterUserPasswordResponse
-> f GetRelationalDatabaseMasterUserPasswordResponse
getRelationalDatabaseMasterUserPasswordResponse_masterUserPassword = (GetRelationalDatabaseMasterUserPasswordResponse
 -> Maybe (Sensitive Text))
-> (GetRelationalDatabaseMasterUserPasswordResponse
    -> Maybe (Sensitive Text)
    -> GetRelationalDatabaseMasterUserPasswordResponse)
-> Lens
     GetRelationalDatabaseMasterUserPasswordResponse
     GetRelationalDatabaseMasterUserPasswordResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMasterUserPasswordResponse' {Maybe (Sensitive Text)
masterUserPassword :: Maybe (Sensitive Text)
$sel:masterUserPassword:GetRelationalDatabaseMasterUserPasswordResponse' :: GetRelationalDatabaseMasterUserPasswordResponse
-> Maybe (Sensitive Text)
masterUserPassword} -> Maybe (Sensitive Text)
masterUserPassword) (\s :: GetRelationalDatabaseMasterUserPasswordResponse
s@GetRelationalDatabaseMasterUserPasswordResponse' {} Maybe (Sensitive Text)
a -> GetRelationalDatabaseMasterUserPasswordResponse
s {$sel:masterUserPassword:GetRelationalDatabaseMasterUserPasswordResponse' :: Maybe (Sensitive Text)
masterUserPassword = Maybe (Sensitive Text)
a} :: GetRelationalDatabaseMasterUserPasswordResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> GetRelationalDatabaseMasterUserPasswordResponse
 -> f GetRelationalDatabaseMasterUserPasswordResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetRelationalDatabaseMasterUserPasswordResponse
-> f GetRelationalDatabaseMasterUserPasswordResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The timestamp when the specified version of the master user password was
-- created.
getRelationalDatabaseMasterUserPasswordResponse_createdAt :: Lens.Lens' GetRelationalDatabaseMasterUserPasswordResponse (Prelude.Maybe Prelude.UTCTime)
getRelationalDatabaseMasterUserPasswordResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRelationalDatabaseMasterUserPasswordResponse
-> f GetRelationalDatabaseMasterUserPasswordResponse
getRelationalDatabaseMasterUserPasswordResponse_createdAt = (GetRelationalDatabaseMasterUserPasswordResponse -> Maybe POSIX)
-> (GetRelationalDatabaseMasterUserPasswordResponse
    -> Maybe POSIX -> GetRelationalDatabaseMasterUserPasswordResponse)
-> Lens
     GetRelationalDatabaseMasterUserPasswordResponse
     GetRelationalDatabaseMasterUserPasswordResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMasterUserPasswordResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:GetRelationalDatabaseMasterUserPasswordResponse' :: GetRelationalDatabaseMasterUserPasswordResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: GetRelationalDatabaseMasterUserPasswordResponse
s@GetRelationalDatabaseMasterUserPasswordResponse' {} Maybe POSIX
a -> GetRelationalDatabaseMasterUserPasswordResponse
s {$sel:createdAt:GetRelationalDatabaseMasterUserPasswordResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: GetRelationalDatabaseMasterUserPasswordResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetRelationalDatabaseMasterUserPasswordResponse
 -> f GetRelationalDatabaseMasterUserPasswordResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRelationalDatabaseMasterUserPasswordResponse
-> f GetRelationalDatabaseMasterUserPasswordResponse
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 response's http status code.
getRelationalDatabaseMasterUserPasswordResponse_httpStatus :: Lens.Lens' GetRelationalDatabaseMasterUserPasswordResponse Prelude.Int
getRelationalDatabaseMasterUserPasswordResponse_httpStatus :: (Int -> f Int)
-> GetRelationalDatabaseMasterUserPasswordResponse
-> f GetRelationalDatabaseMasterUserPasswordResponse
getRelationalDatabaseMasterUserPasswordResponse_httpStatus = (GetRelationalDatabaseMasterUserPasswordResponse -> Int)
-> (GetRelationalDatabaseMasterUserPasswordResponse
    -> Int -> GetRelationalDatabaseMasterUserPasswordResponse)
-> Lens
     GetRelationalDatabaseMasterUserPasswordResponse
     GetRelationalDatabaseMasterUserPasswordResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMasterUserPasswordResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRelationalDatabaseMasterUserPasswordResponse' :: GetRelationalDatabaseMasterUserPasswordResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRelationalDatabaseMasterUserPasswordResponse
s@GetRelationalDatabaseMasterUserPasswordResponse' {} Int
a -> GetRelationalDatabaseMasterUserPasswordResponse
s {$sel:httpStatus:GetRelationalDatabaseMasterUserPasswordResponse' :: Int
httpStatus = Int
a} :: GetRelationalDatabaseMasterUserPasswordResponse)

instance
  Prelude.NFData
    GetRelationalDatabaseMasterUserPasswordResponse