{-# 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.RDS.ModifyDBProxy
-- 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)
--
-- Changes the settings for an existing DB proxy.
module Amazonka.RDS.ModifyDBProxy
  ( -- * Creating a Request
    ModifyDBProxy (..),
    newModifyDBProxy,

    -- * Request Lenses
    modifyDBProxy_debugLogging,
    modifyDBProxy_securityGroups,
    modifyDBProxy_auth,
    modifyDBProxy_requireTLS,
    modifyDBProxy_idleClientTimeout,
    modifyDBProxy_newDBProxyName,
    modifyDBProxy_roleArn,
    modifyDBProxy_dbProxyName,

    -- * Destructuring the Response
    ModifyDBProxyResponse (..),
    newModifyDBProxyResponse,

    -- * Response Lenses
    modifyDBProxyResponse_dbProxy,
    modifyDBProxyResponse_httpStatus,
  )
where

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

-- | /See:/ 'newModifyDBProxy' smart constructor.
data ModifyDBProxy = ModifyDBProxy'
  { -- | Whether the proxy includes detailed information about SQL statements in
    -- its logs. This information helps you to debug issues involving SQL
    -- behavior or the performance and scalability of the proxy connections.
    -- The debug information includes the text of SQL statements that you
    -- submit through the proxy. Thus, only enable this setting when needed for
    -- debugging, and only when you have security measures in place to
    -- safeguard any sensitive information that appears in the logs.
    ModifyDBProxy -> Maybe Bool
debugLogging :: Prelude.Maybe Prelude.Bool,
    -- | The new list of security groups for the @DBProxy@.
    ModifyDBProxy -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The new authentication settings for the @DBProxy@.
    ModifyDBProxy -> Maybe [UserAuthConfig]
auth :: Prelude.Maybe [UserAuthConfig],
    -- | Whether Transport Layer Security (TLS) encryption is required for
    -- connections to the proxy. By enabling this setting, you can enforce
    -- encrypted TLS connections to the proxy, even if the associated database
    -- doesn\'t use TLS.
    ModifyDBProxy -> Maybe Bool
requireTLS :: Prelude.Maybe Prelude.Bool,
    -- | The number of seconds that a connection to the proxy can be inactive
    -- before the proxy disconnects it. You can set this value higher or lower
    -- than the connection timeout limit for the associated database.
    ModifyDBProxy -> Maybe Int
idleClientTimeout :: Prelude.Maybe Prelude.Int,
    -- | The new identifier for the @DBProxy@. An identifier must begin with a
    -- letter and must contain only ASCII letters, digits, and hyphens; it
    -- can\'t end with a hyphen or contain two consecutive hyphens.
    ModifyDBProxy -> Maybe Text
newDBProxyName' :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role that the proxy uses to
    -- access secrets in Amazon Web Services Secrets Manager.
    ModifyDBProxy -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the @DBProxy@ to modify.
    ModifyDBProxy -> Text
dbProxyName :: Prelude.Text
  }
  deriving (ModifyDBProxy -> ModifyDBProxy -> Bool
(ModifyDBProxy -> ModifyDBProxy -> Bool)
-> (ModifyDBProxy -> ModifyDBProxy -> Bool) -> Eq ModifyDBProxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBProxy -> ModifyDBProxy -> Bool
$c/= :: ModifyDBProxy -> ModifyDBProxy -> Bool
== :: ModifyDBProxy -> ModifyDBProxy -> Bool
$c== :: ModifyDBProxy -> ModifyDBProxy -> Bool
Prelude.Eq, ReadPrec [ModifyDBProxy]
ReadPrec ModifyDBProxy
Int -> ReadS ModifyDBProxy
ReadS [ModifyDBProxy]
(Int -> ReadS ModifyDBProxy)
-> ReadS [ModifyDBProxy]
-> ReadPrec ModifyDBProxy
-> ReadPrec [ModifyDBProxy]
-> Read ModifyDBProxy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBProxy]
$creadListPrec :: ReadPrec [ModifyDBProxy]
readPrec :: ReadPrec ModifyDBProxy
$creadPrec :: ReadPrec ModifyDBProxy
readList :: ReadS [ModifyDBProxy]
$creadList :: ReadS [ModifyDBProxy]
readsPrec :: Int -> ReadS ModifyDBProxy
$creadsPrec :: Int -> ReadS ModifyDBProxy
Prelude.Read, Int -> ModifyDBProxy -> ShowS
[ModifyDBProxy] -> ShowS
ModifyDBProxy -> String
(Int -> ModifyDBProxy -> ShowS)
-> (ModifyDBProxy -> String)
-> ([ModifyDBProxy] -> ShowS)
-> Show ModifyDBProxy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBProxy] -> ShowS
$cshowList :: [ModifyDBProxy] -> ShowS
show :: ModifyDBProxy -> String
$cshow :: ModifyDBProxy -> String
showsPrec :: Int -> ModifyDBProxy -> ShowS
$cshowsPrec :: Int -> ModifyDBProxy -> ShowS
Prelude.Show, (forall x. ModifyDBProxy -> Rep ModifyDBProxy x)
-> (forall x. Rep ModifyDBProxy x -> ModifyDBProxy)
-> Generic ModifyDBProxy
forall x. Rep ModifyDBProxy x -> ModifyDBProxy
forall x. ModifyDBProxy -> Rep ModifyDBProxy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyDBProxy x -> ModifyDBProxy
$cfrom :: forall x. ModifyDBProxy -> Rep ModifyDBProxy x
Prelude.Generic)

-- |
-- Create a value of 'ModifyDBProxy' 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:
--
-- 'debugLogging', 'modifyDBProxy_debugLogging' - Whether the proxy includes detailed information about SQL statements in
-- its logs. This information helps you to debug issues involving SQL
-- behavior or the performance and scalability of the proxy connections.
-- The debug information includes the text of SQL statements that you
-- submit through the proxy. Thus, only enable this setting when needed for
-- debugging, and only when you have security measures in place to
-- safeguard any sensitive information that appears in the logs.
--
-- 'securityGroups', 'modifyDBProxy_securityGroups' - The new list of security groups for the @DBProxy@.
--
-- 'auth', 'modifyDBProxy_auth' - The new authentication settings for the @DBProxy@.
--
-- 'requireTLS', 'modifyDBProxy_requireTLS' - Whether Transport Layer Security (TLS) encryption is required for
-- connections to the proxy. By enabling this setting, you can enforce
-- encrypted TLS connections to the proxy, even if the associated database
-- doesn\'t use TLS.
--
-- 'idleClientTimeout', 'modifyDBProxy_idleClientTimeout' - The number of seconds that a connection to the proxy can be inactive
-- before the proxy disconnects it. You can set this value higher or lower
-- than the connection timeout limit for the associated database.
--
-- 'newDBProxyName'', 'modifyDBProxy_newDBProxyName' - The new identifier for the @DBProxy@. An identifier must begin with a
-- letter and must contain only ASCII letters, digits, and hyphens; it
-- can\'t end with a hyphen or contain two consecutive hyphens.
--
-- 'roleArn', 'modifyDBProxy_roleArn' - The Amazon Resource Name (ARN) of the IAM role that the proxy uses to
-- access secrets in Amazon Web Services Secrets Manager.
--
-- 'dbProxyName', 'modifyDBProxy_dbProxyName' - The identifier for the @DBProxy@ to modify.
newModifyDBProxy ::
  -- | 'dbProxyName'
  Prelude.Text ->
  ModifyDBProxy
newModifyDBProxy :: Text -> ModifyDBProxy
newModifyDBProxy Text
pDBProxyName_ =
  ModifyDBProxy' :: Maybe Bool
-> Maybe [Text]
-> Maybe [UserAuthConfig]
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Text
-> ModifyDBProxy
ModifyDBProxy'
    { $sel:debugLogging:ModifyDBProxy' :: Maybe Bool
debugLogging = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:ModifyDBProxy' :: Maybe [Text]
securityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:auth:ModifyDBProxy' :: Maybe [UserAuthConfig]
auth = Maybe [UserAuthConfig]
forall a. Maybe a
Prelude.Nothing,
      $sel:requireTLS:ModifyDBProxy' :: Maybe Bool
requireTLS = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:idleClientTimeout:ModifyDBProxy' :: Maybe Int
idleClientTimeout = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:newDBProxyName':ModifyDBProxy' :: Maybe Text
newDBProxyName' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ModifyDBProxy' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbProxyName:ModifyDBProxy' :: Text
dbProxyName = Text
pDBProxyName_
    }

-- | Whether the proxy includes detailed information about SQL statements in
-- its logs. This information helps you to debug issues involving SQL
-- behavior or the performance and scalability of the proxy connections.
-- The debug information includes the text of SQL statements that you
-- submit through the proxy. Thus, only enable this setting when needed for
-- debugging, and only when you have security measures in place to
-- safeguard any sensitive information that appears in the logs.
modifyDBProxy_debugLogging :: Lens.Lens' ModifyDBProxy (Prelude.Maybe Prelude.Bool)
modifyDBProxy_debugLogging :: (Maybe Bool -> f (Maybe Bool)) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_debugLogging = (ModifyDBProxy -> Maybe Bool)
-> (ModifyDBProxy -> Maybe Bool -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe Bool
debugLogging :: Maybe Bool
$sel:debugLogging:ModifyDBProxy' :: ModifyDBProxy -> Maybe Bool
debugLogging} -> Maybe Bool
debugLogging) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe Bool
a -> ModifyDBProxy
s {$sel:debugLogging:ModifyDBProxy' :: Maybe Bool
debugLogging = Maybe Bool
a} :: ModifyDBProxy)

-- | The new list of security groups for the @DBProxy@.
modifyDBProxy_securityGroups :: Lens.Lens' ModifyDBProxy (Prelude.Maybe [Prelude.Text])
modifyDBProxy_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_securityGroups = (ModifyDBProxy -> Maybe [Text])
-> (ModifyDBProxy -> Maybe [Text] -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:ModifyDBProxy' :: ModifyDBProxy -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe [Text]
a -> ModifyDBProxy
s {$sel:securityGroups:ModifyDBProxy' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: ModifyDBProxy) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyDBProxy -> f ModifyDBProxy)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyDBProxy
-> f ModifyDBProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The new authentication settings for the @DBProxy@.
modifyDBProxy_auth :: Lens.Lens' ModifyDBProxy (Prelude.Maybe [UserAuthConfig])
modifyDBProxy_auth :: (Maybe [UserAuthConfig] -> f (Maybe [UserAuthConfig]))
-> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_auth = (ModifyDBProxy -> Maybe [UserAuthConfig])
-> (ModifyDBProxy -> Maybe [UserAuthConfig] -> ModifyDBProxy)
-> Lens
     ModifyDBProxy
     ModifyDBProxy
     (Maybe [UserAuthConfig])
     (Maybe [UserAuthConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe [UserAuthConfig]
auth :: Maybe [UserAuthConfig]
$sel:auth:ModifyDBProxy' :: ModifyDBProxy -> Maybe [UserAuthConfig]
auth} -> Maybe [UserAuthConfig]
auth) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe [UserAuthConfig]
a -> ModifyDBProxy
s {$sel:auth:ModifyDBProxy' :: Maybe [UserAuthConfig]
auth = Maybe [UserAuthConfig]
a} :: ModifyDBProxy) ((Maybe [UserAuthConfig] -> f (Maybe [UserAuthConfig]))
 -> ModifyDBProxy -> f ModifyDBProxy)
-> ((Maybe [UserAuthConfig] -> f (Maybe [UserAuthConfig]))
    -> Maybe [UserAuthConfig] -> f (Maybe [UserAuthConfig]))
-> (Maybe [UserAuthConfig] -> f (Maybe [UserAuthConfig]))
-> ModifyDBProxy
-> f ModifyDBProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UserAuthConfig] [UserAuthConfig] [UserAuthConfig] [UserAuthConfig]
-> Iso
     (Maybe [UserAuthConfig])
     (Maybe [UserAuthConfig])
     (Maybe [UserAuthConfig])
     (Maybe [UserAuthConfig])
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
  [UserAuthConfig] [UserAuthConfig] [UserAuthConfig] [UserAuthConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether Transport Layer Security (TLS) encryption is required for
-- connections to the proxy. By enabling this setting, you can enforce
-- encrypted TLS connections to the proxy, even if the associated database
-- doesn\'t use TLS.
modifyDBProxy_requireTLS :: Lens.Lens' ModifyDBProxy (Prelude.Maybe Prelude.Bool)
modifyDBProxy_requireTLS :: (Maybe Bool -> f (Maybe Bool)) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_requireTLS = (ModifyDBProxy -> Maybe Bool)
-> (ModifyDBProxy -> Maybe Bool -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe Bool
requireTLS :: Maybe Bool
$sel:requireTLS:ModifyDBProxy' :: ModifyDBProxy -> Maybe Bool
requireTLS} -> Maybe Bool
requireTLS) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe Bool
a -> ModifyDBProxy
s {$sel:requireTLS:ModifyDBProxy' :: Maybe Bool
requireTLS = Maybe Bool
a} :: ModifyDBProxy)

-- | The number of seconds that a connection to the proxy can be inactive
-- before the proxy disconnects it. You can set this value higher or lower
-- than the connection timeout limit for the associated database.
modifyDBProxy_idleClientTimeout :: Lens.Lens' ModifyDBProxy (Prelude.Maybe Prelude.Int)
modifyDBProxy_idleClientTimeout :: (Maybe Int -> f (Maybe Int)) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_idleClientTimeout = (ModifyDBProxy -> Maybe Int)
-> (ModifyDBProxy -> Maybe Int -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe Int
idleClientTimeout :: Maybe Int
$sel:idleClientTimeout:ModifyDBProxy' :: ModifyDBProxy -> Maybe Int
idleClientTimeout} -> Maybe Int
idleClientTimeout) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe Int
a -> ModifyDBProxy
s {$sel:idleClientTimeout:ModifyDBProxy' :: Maybe Int
idleClientTimeout = Maybe Int
a} :: ModifyDBProxy)

-- | The new identifier for the @DBProxy@. An identifier must begin with a
-- letter and must contain only ASCII letters, digits, and hyphens; it
-- can\'t end with a hyphen or contain two consecutive hyphens.
modifyDBProxy_newDBProxyName :: Lens.Lens' ModifyDBProxy (Prelude.Maybe Prelude.Text)
modifyDBProxy_newDBProxyName :: (Maybe Text -> f (Maybe Text)) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_newDBProxyName = (ModifyDBProxy -> Maybe Text)
-> (ModifyDBProxy -> Maybe Text -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe Text
newDBProxyName' :: Maybe Text
$sel:newDBProxyName':ModifyDBProxy' :: ModifyDBProxy -> Maybe Text
newDBProxyName'} -> Maybe Text
newDBProxyName') (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe Text
a -> ModifyDBProxy
s {$sel:newDBProxyName':ModifyDBProxy' :: Maybe Text
newDBProxyName' = Maybe Text
a} :: ModifyDBProxy)

-- | The Amazon Resource Name (ARN) of the IAM role that the proxy uses to
-- access secrets in Amazon Web Services Secrets Manager.
modifyDBProxy_roleArn :: Lens.Lens' ModifyDBProxy (Prelude.Maybe Prelude.Text)
modifyDBProxy_roleArn :: (Maybe Text -> f (Maybe Text)) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_roleArn = (ModifyDBProxy -> Maybe Text)
-> (ModifyDBProxy -> Maybe Text -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:ModifyDBProxy' :: ModifyDBProxy -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Maybe Text
a -> ModifyDBProxy
s {$sel:roleArn:ModifyDBProxy' :: Maybe Text
roleArn = Maybe Text
a} :: ModifyDBProxy)

-- | The identifier for the @DBProxy@ to modify.
modifyDBProxy_dbProxyName :: Lens.Lens' ModifyDBProxy Prelude.Text
modifyDBProxy_dbProxyName :: (Text -> f Text) -> ModifyDBProxy -> f ModifyDBProxy
modifyDBProxy_dbProxyName = (ModifyDBProxy -> Text)
-> (ModifyDBProxy -> Text -> ModifyDBProxy)
-> Lens ModifyDBProxy ModifyDBProxy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxy' {Text
dbProxyName :: Text
$sel:dbProxyName:ModifyDBProxy' :: ModifyDBProxy -> Text
dbProxyName} -> Text
dbProxyName) (\s :: ModifyDBProxy
s@ModifyDBProxy' {} Text
a -> ModifyDBProxy
s {$sel:dbProxyName:ModifyDBProxy' :: Text
dbProxyName = Text
a} :: ModifyDBProxy)

instance Core.AWSRequest ModifyDBProxy where
  type
    AWSResponse ModifyDBProxy =
      ModifyDBProxyResponse
  request :: ModifyDBProxy -> Request ModifyDBProxy
request = Service -> ModifyDBProxy -> Request ModifyDBProxy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyDBProxy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyDBProxy)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ModifyDBProxy))
-> Logger
-> Service
-> Proxy ModifyDBProxy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyDBProxy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ModifyDBProxyResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBProxy -> Int -> ModifyDBProxyResponse
ModifyDBProxyResponse'
            (Maybe DBProxy -> Int -> ModifyDBProxyResponse)
-> Either String (Maybe DBProxy)
-> Either String (Int -> ModifyDBProxyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBProxy)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBProxy")
            Either String (Int -> ModifyDBProxyResponse)
-> Either String Int -> Either String ModifyDBProxyResponse
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 ModifyDBProxy

instance Prelude.NFData ModifyDBProxy

instance Core.ToHeaders ModifyDBProxy where
  toHeaders :: ModifyDBProxy -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyDBProxy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ModifyDBProxy where
  toQuery :: ModifyDBProxy -> QueryString
toQuery ModifyDBProxy' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [UserAuthConfig]
Maybe Text
Text
dbProxyName :: Text
roleArn :: Maybe Text
newDBProxyName' :: Maybe Text
idleClientTimeout :: Maybe Int
requireTLS :: Maybe Bool
auth :: Maybe [UserAuthConfig]
securityGroups :: Maybe [Text]
debugLogging :: Maybe Bool
$sel:dbProxyName:ModifyDBProxy' :: ModifyDBProxy -> Text
$sel:roleArn:ModifyDBProxy' :: ModifyDBProxy -> Maybe Text
$sel:newDBProxyName':ModifyDBProxy' :: ModifyDBProxy -> Maybe Text
$sel:idleClientTimeout:ModifyDBProxy' :: ModifyDBProxy -> Maybe Int
$sel:requireTLS:ModifyDBProxy' :: ModifyDBProxy -> Maybe Bool
$sel:auth:ModifyDBProxy' :: ModifyDBProxy -> Maybe [UserAuthConfig]
$sel:securityGroups:ModifyDBProxy' :: ModifyDBProxy -> Maybe [Text]
$sel:debugLogging:ModifyDBProxy' :: ModifyDBProxy -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ModifyDBProxy" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DebugLogging" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
debugLogging,
        ByteString
"SecurityGroups"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroups
            ),
        ByteString
"Auth"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [UserAuthConfig] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([UserAuthConfig] -> QueryString)
-> Maybe [UserAuthConfig] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [UserAuthConfig]
auth),
        ByteString
"RequireTLS" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
requireTLS,
        ByteString
"IdleClientTimeout" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
idleClientTimeout,
        ByteString
"NewDBProxyName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
newDBProxyName',
        ByteString
"RoleArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
roleArn,
        ByteString
"DBProxyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbProxyName
      ]

-- | /See:/ 'newModifyDBProxyResponse' smart constructor.
data ModifyDBProxyResponse = ModifyDBProxyResponse'
  { -- | The @DBProxy@ object representing the new settings for the proxy.
    ModifyDBProxyResponse -> Maybe DBProxy
dbProxy :: Prelude.Maybe DBProxy,
    -- | The response's http status code.
    ModifyDBProxyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool
(ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool)
-> (ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool)
-> Eq ModifyDBProxyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool
$c/= :: ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool
== :: ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool
$c== :: ModifyDBProxyResponse -> ModifyDBProxyResponse -> Bool
Prelude.Eq, ReadPrec [ModifyDBProxyResponse]
ReadPrec ModifyDBProxyResponse
Int -> ReadS ModifyDBProxyResponse
ReadS [ModifyDBProxyResponse]
(Int -> ReadS ModifyDBProxyResponse)
-> ReadS [ModifyDBProxyResponse]
-> ReadPrec ModifyDBProxyResponse
-> ReadPrec [ModifyDBProxyResponse]
-> Read ModifyDBProxyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBProxyResponse]
$creadListPrec :: ReadPrec [ModifyDBProxyResponse]
readPrec :: ReadPrec ModifyDBProxyResponse
$creadPrec :: ReadPrec ModifyDBProxyResponse
readList :: ReadS [ModifyDBProxyResponse]
$creadList :: ReadS [ModifyDBProxyResponse]
readsPrec :: Int -> ReadS ModifyDBProxyResponse
$creadsPrec :: Int -> ReadS ModifyDBProxyResponse
Prelude.Read, Int -> ModifyDBProxyResponse -> ShowS
[ModifyDBProxyResponse] -> ShowS
ModifyDBProxyResponse -> String
(Int -> ModifyDBProxyResponse -> ShowS)
-> (ModifyDBProxyResponse -> String)
-> ([ModifyDBProxyResponse] -> ShowS)
-> Show ModifyDBProxyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBProxyResponse] -> ShowS
$cshowList :: [ModifyDBProxyResponse] -> ShowS
show :: ModifyDBProxyResponse -> String
$cshow :: ModifyDBProxyResponse -> String
showsPrec :: Int -> ModifyDBProxyResponse -> ShowS
$cshowsPrec :: Int -> ModifyDBProxyResponse -> ShowS
Prelude.Show, (forall x. ModifyDBProxyResponse -> Rep ModifyDBProxyResponse x)
-> (forall x. Rep ModifyDBProxyResponse x -> ModifyDBProxyResponse)
-> Generic ModifyDBProxyResponse
forall x. Rep ModifyDBProxyResponse x -> ModifyDBProxyResponse
forall x. ModifyDBProxyResponse -> Rep ModifyDBProxyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyDBProxyResponse x -> ModifyDBProxyResponse
$cfrom :: forall x. ModifyDBProxyResponse -> Rep ModifyDBProxyResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyDBProxyResponse' 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:
--
-- 'dbProxy', 'modifyDBProxyResponse_dbProxy' - The @DBProxy@ object representing the new settings for the proxy.
--
-- 'httpStatus', 'modifyDBProxyResponse_httpStatus' - The response's http status code.
newModifyDBProxyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyDBProxyResponse
newModifyDBProxyResponse :: Int -> ModifyDBProxyResponse
newModifyDBProxyResponse Int
pHttpStatus_ =
  ModifyDBProxyResponse' :: Maybe DBProxy -> Int -> ModifyDBProxyResponse
ModifyDBProxyResponse'
    { $sel:dbProxy:ModifyDBProxyResponse' :: Maybe DBProxy
dbProxy = Maybe DBProxy
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyDBProxyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @DBProxy@ object representing the new settings for the proxy.
modifyDBProxyResponse_dbProxy :: Lens.Lens' ModifyDBProxyResponse (Prelude.Maybe DBProxy)
modifyDBProxyResponse_dbProxy :: (Maybe DBProxy -> f (Maybe DBProxy))
-> ModifyDBProxyResponse -> f ModifyDBProxyResponse
modifyDBProxyResponse_dbProxy = (ModifyDBProxyResponse -> Maybe DBProxy)
-> (ModifyDBProxyResponse
    -> Maybe DBProxy -> ModifyDBProxyResponse)
-> Lens
     ModifyDBProxyResponse
     ModifyDBProxyResponse
     (Maybe DBProxy)
     (Maybe DBProxy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBProxyResponse' {Maybe DBProxy
dbProxy :: Maybe DBProxy
$sel:dbProxy:ModifyDBProxyResponse' :: ModifyDBProxyResponse -> Maybe DBProxy
dbProxy} -> Maybe DBProxy
dbProxy) (\s :: ModifyDBProxyResponse
s@ModifyDBProxyResponse' {} Maybe DBProxy
a -> ModifyDBProxyResponse
s {$sel:dbProxy:ModifyDBProxyResponse' :: Maybe DBProxy
dbProxy = Maybe DBProxy
a} :: ModifyDBProxyResponse)

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

instance Prelude.NFData ModifyDBProxyResponse