{-# 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.CloudWatchEvents.Types.UpdateConnectionAuthRequestParameters
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudWatchEvents.Types.UpdateConnectionAuthRequestParameters where

import Amazonka.CloudWatchEvents.Types.ConnectionHttpParameters
import Amazonka.CloudWatchEvents.Types.UpdateConnectionApiKeyAuthRequestParameters
import Amazonka.CloudWatchEvents.Types.UpdateConnectionBasicAuthRequestParameters
import Amazonka.CloudWatchEvents.Types.UpdateConnectionOAuthRequestParameters
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains the additional parameters to use for the connection.
--
-- /See:/ 'newUpdateConnectionAuthRequestParameters' smart constructor.
data UpdateConnectionAuthRequestParameters = UpdateConnectionAuthRequestParameters'
  { -- | A @UpdateConnectionApiKeyAuthRequestParameters@ object that contains the
    -- authorization parameters for API key authorization.
    UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters :: Prelude.Maybe UpdateConnectionApiKeyAuthRequestParameters,
    -- | A @UpdateConnectionBasicAuthRequestParameters@ object that contains the
    -- authorization parameters for Basic authorization.
    UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters :: Prelude.Maybe UpdateConnectionBasicAuthRequestParameters,
    -- | A @ConnectionHttpParameters@ object that contains the additional
    -- parameters to use for the connection.
    UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
invocationHttpParameters :: Prelude.Maybe ConnectionHttpParameters,
    -- | A @UpdateConnectionOAuthRequestParameters@ object that contains the
    -- authorization parameters for OAuth authorization.
    UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Prelude.Maybe UpdateConnectionOAuthRequestParameters
  }
  deriving (UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
$c/= :: UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
== :: UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
$c== :: UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
Prelude.Eq, ReadPrec [UpdateConnectionAuthRequestParameters]
ReadPrec UpdateConnectionAuthRequestParameters
Int -> ReadS UpdateConnectionAuthRequestParameters
ReadS [UpdateConnectionAuthRequestParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectionAuthRequestParameters]
$creadListPrec :: ReadPrec [UpdateConnectionAuthRequestParameters]
readPrec :: ReadPrec UpdateConnectionAuthRequestParameters
$creadPrec :: ReadPrec UpdateConnectionAuthRequestParameters
readList :: ReadS [UpdateConnectionAuthRequestParameters]
$creadList :: ReadS [UpdateConnectionAuthRequestParameters]
readsPrec :: Int -> ReadS UpdateConnectionAuthRequestParameters
$creadsPrec :: Int -> ReadS UpdateConnectionAuthRequestParameters
Prelude.Read, Int -> UpdateConnectionAuthRequestParameters -> ShowS
[UpdateConnectionAuthRequestParameters] -> ShowS
UpdateConnectionAuthRequestParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectionAuthRequestParameters] -> ShowS
$cshowList :: [UpdateConnectionAuthRequestParameters] -> ShowS
show :: UpdateConnectionAuthRequestParameters -> String
$cshow :: UpdateConnectionAuthRequestParameters -> String
showsPrec :: Int -> UpdateConnectionAuthRequestParameters -> ShowS
$cshowsPrec :: Int -> UpdateConnectionAuthRequestParameters -> ShowS
Prelude.Show, forall x.
Rep UpdateConnectionAuthRequestParameters x
-> UpdateConnectionAuthRequestParameters
forall x.
UpdateConnectionAuthRequestParameters
-> Rep UpdateConnectionAuthRequestParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectionAuthRequestParameters x
-> UpdateConnectionAuthRequestParameters
$cfrom :: forall x.
UpdateConnectionAuthRequestParameters
-> Rep UpdateConnectionAuthRequestParameters x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConnectionAuthRequestParameters' 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:
--
-- 'apiKeyAuthParameters', 'updateConnectionAuthRequestParameters_apiKeyAuthParameters' - A @UpdateConnectionApiKeyAuthRequestParameters@ object that contains the
-- authorization parameters for API key authorization.
--
-- 'basicAuthParameters', 'updateConnectionAuthRequestParameters_basicAuthParameters' - A @UpdateConnectionBasicAuthRequestParameters@ object that contains the
-- authorization parameters for Basic authorization.
--
-- 'invocationHttpParameters', 'updateConnectionAuthRequestParameters_invocationHttpParameters' - A @ConnectionHttpParameters@ object that contains the additional
-- parameters to use for the connection.
--
-- 'oAuthParameters', 'updateConnectionAuthRequestParameters_oAuthParameters' - A @UpdateConnectionOAuthRequestParameters@ object that contains the
-- authorization parameters for OAuth authorization.
newUpdateConnectionAuthRequestParameters ::
  UpdateConnectionAuthRequestParameters
newUpdateConnectionAuthRequestParameters :: UpdateConnectionAuthRequestParameters
newUpdateConnectionAuthRequestParameters =
  UpdateConnectionAuthRequestParameters'
    { $sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: Maybe ConnectionHttpParameters
invocationHttpParameters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters = forall a. Maybe a
Prelude.Nothing
    }

-- | A @UpdateConnectionApiKeyAuthRequestParameters@ object that contains the
-- authorization parameters for API key authorization.
updateConnectionAuthRequestParameters_apiKeyAuthParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe UpdateConnectionApiKeyAuthRequestParameters)
updateConnectionAuthRequestParameters_apiKeyAuthParameters :: Lens'
  UpdateConnectionAuthRequestParameters
  (Maybe UpdateConnectionApiKeyAuthRequestParameters)
updateConnectionAuthRequestParameters_apiKeyAuthParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAuthRequestParameters' {Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters :: Maybe UpdateConnectionApiKeyAuthRequestParameters
$sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters} -> Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters) (\s :: UpdateConnectionAuthRequestParameters
s@UpdateConnectionAuthRequestParameters' {} Maybe UpdateConnectionApiKeyAuthRequestParameters
a -> UpdateConnectionAuthRequestParameters
s {$sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters = Maybe UpdateConnectionApiKeyAuthRequestParameters
a} :: UpdateConnectionAuthRequestParameters)

-- | A @UpdateConnectionBasicAuthRequestParameters@ object that contains the
-- authorization parameters for Basic authorization.
updateConnectionAuthRequestParameters_basicAuthParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe UpdateConnectionBasicAuthRequestParameters)
updateConnectionAuthRequestParameters_basicAuthParameters :: Lens'
  UpdateConnectionAuthRequestParameters
  (Maybe UpdateConnectionBasicAuthRequestParameters)
updateConnectionAuthRequestParameters_basicAuthParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAuthRequestParameters' {Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters :: Maybe UpdateConnectionBasicAuthRequestParameters
$sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters} -> Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters) (\s :: UpdateConnectionAuthRequestParameters
s@UpdateConnectionAuthRequestParameters' {} Maybe UpdateConnectionBasicAuthRequestParameters
a -> UpdateConnectionAuthRequestParameters
s {$sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters = Maybe UpdateConnectionBasicAuthRequestParameters
a} :: UpdateConnectionAuthRequestParameters)

-- | A @ConnectionHttpParameters@ object that contains the additional
-- parameters to use for the connection.
updateConnectionAuthRequestParameters_invocationHttpParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe ConnectionHttpParameters)
updateConnectionAuthRequestParameters_invocationHttpParameters :: Lens'
  UpdateConnectionAuthRequestParameters
  (Maybe ConnectionHttpParameters)
updateConnectionAuthRequestParameters_invocationHttpParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAuthRequestParameters' {Maybe ConnectionHttpParameters
invocationHttpParameters :: Maybe ConnectionHttpParameters
$sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
invocationHttpParameters} -> Maybe ConnectionHttpParameters
invocationHttpParameters) (\s :: UpdateConnectionAuthRequestParameters
s@UpdateConnectionAuthRequestParameters' {} Maybe ConnectionHttpParameters
a -> UpdateConnectionAuthRequestParameters
s {$sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: Maybe ConnectionHttpParameters
invocationHttpParameters = Maybe ConnectionHttpParameters
a} :: UpdateConnectionAuthRequestParameters)

-- | A @UpdateConnectionOAuthRequestParameters@ object that contains the
-- authorization parameters for OAuth authorization.
updateConnectionAuthRequestParameters_oAuthParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe UpdateConnectionOAuthRequestParameters)
updateConnectionAuthRequestParameters_oAuthParameters :: Lens'
  UpdateConnectionAuthRequestParameters
  (Maybe UpdateConnectionOAuthRequestParameters)
updateConnectionAuthRequestParameters_oAuthParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAuthRequestParameters' {Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Maybe UpdateConnectionOAuthRequestParameters
$sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters} -> Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters) (\s :: UpdateConnectionAuthRequestParameters
s@UpdateConnectionAuthRequestParameters' {} Maybe UpdateConnectionOAuthRequestParameters
a -> UpdateConnectionAuthRequestParameters
s {$sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters = Maybe UpdateConnectionOAuthRequestParameters
a} :: UpdateConnectionAuthRequestParameters)

instance
  Prelude.Hashable
    UpdateConnectionAuthRequestParameters
  where
  hashWithSalt :: Int -> UpdateConnectionAuthRequestParameters -> Int
hashWithSalt
    Int
_salt
    UpdateConnectionAuthRequestParameters' {Maybe ConnectionHttpParameters
Maybe UpdateConnectionApiKeyAuthRequestParameters
Maybe UpdateConnectionBasicAuthRequestParameters
Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Maybe UpdateConnectionOAuthRequestParameters
invocationHttpParameters :: Maybe ConnectionHttpParameters
basicAuthParameters :: Maybe UpdateConnectionBasicAuthRequestParameters
apiKeyAuthParameters :: Maybe UpdateConnectionApiKeyAuthRequestParameters
$sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
$sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
$sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
$sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectionHttpParameters
invocationHttpParameters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters

instance
  Prelude.NFData
    UpdateConnectionAuthRequestParameters
  where
  rnf :: UpdateConnectionAuthRequestParameters -> ()
rnf UpdateConnectionAuthRequestParameters' {Maybe ConnectionHttpParameters
Maybe UpdateConnectionApiKeyAuthRequestParameters
Maybe UpdateConnectionBasicAuthRequestParameters
Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Maybe UpdateConnectionOAuthRequestParameters
invocationHttpParameters :: Maybe ConnectionHttpParameters
basicAuthParameters :: Maybe UpdateConnectionBasicAuthRequestParameters
apiKeyAuthParameters :: Maybe UpdateConnectionApiKeyAuthRequestParameters
$sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
$sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
$sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
$sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectionHttpParameters
invocationHttpParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters

instance
  Data.ToJSON
    UpdateConnectionAuthRequestParameters
  where
  toJSON :: UpdateConnectionAuthRequestParameters -> Value
toJSON UpdateConnectionAuthRequestParameters' {Maybe ConnectionHttpParameters
Maybe UpdateConnectionApiKeyAuthRequestParameters
Maybe UpdateConnectionBasicAuthRequestParameters
Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Maybe UpdateConnectionOAuthRequestParameters
invocationHttpParameters :: Maybe ConnectionHttpParameters
basicAuthParameters :: Maybe UpdateConnectionBasicAuthRequestParameters
apiKeyAuthParameters :: Maybe UpdateConnectionApiKeyAuthRequestParameters
$sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
$sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
$sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
$sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ApiKeyAuthParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters,
            (Key
"BasicAuthParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters,
            (Key
"InvocationHttpParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionHttpParameters
invocationHttpParameters,
            (Key
"OAuthParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters
          ]
      )