{-# 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-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.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.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the additional parameters to use for the connection.
--
-- /See:/ 'newUpdateConnectionAuthRequestParameters' smart constructor.
data UpdateConnectionAuthRequestParameters = UpdateConnectionAuthRequestParameters'
  { -- | A @UpdateConnectionOAuthRequestParameters@ object that contains the
    -- authorization parameters for OAuth authorization.
    UpdateConnectionAuthRequestParameters
-> Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters :: Prelude.Maybe UpdateConnectionOAuthRequestParameters,
    -- | A @ConnectionHttpParameters@ object that contains the additional
    -- parameters to use for the connection.
    UpdateConnectionAuthRequestParameters
-> Maybe ConnectionHttpParameters
invocationHttpParameters :: Prelude.Maybe ConnectionHttpParameters,
    -- | 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
  }
  deriving (UpdateConnectionAuthRequestParameters
-> UpdateConnectionAuthRequestParameters -> Bool
(UpdateConnectionAuthRequestParameters
 -> UpdateConnectionAuthRequestParameters -> Bool)
-> (UpdateConnectionAuthRequestParameters
    -> UpdateConnectionAuthRequestParameters -> Bool)
-> Eq UpdateConnectionAuthRequestParameters
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]
(Int -> ReadS UpdateConnectionAuthRequestParameters)
-> ReadS [UpdateConnectionAuthRequestParameters]
-> ReadPrec UpdateConnectionAuthRequestParameters
-> ReadPrec [UpdateConnectionAuthRequestParameters]
-> Read 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
(Int -> UpdateConnectionAuthRequestParameters -> ShowS)
-> (UpdateConnectionAuthRequestParameters -> String)
-> ([UpdateConnectionAuthRequestParameters] -> ShowS)
-> Show UpdateConnectionAuthRequestParameters
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.
 UpdateConnectionAuthRequestParameters
 -> Rep UpdateConnectionAuthRequestParameters x)
-> (forall x.
    Rep UpdateConnectionAuthRequestParameters x
    -> UpdateConnectionAuthRequestParameters)
-> Generic UpdateConnectionAuthRequestParameters
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:
--
-- 'oAuthParameters', 'updateConnectionAuthRequestParameters_oAuthParameters' - A @UpdateConnectionOAuthRequestParameters@ object that contains the
-- authorization parameters for OAuth authorization.
--
-- 'invocationHttpParameters', 'updateConnectionAuthRequestParameters_invocationHttpParameters' - A @ConnectionHttpParameters@ object that contains the additional
-- parameters to use for the connection.
--
-- '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.
newUpdateConnectionAuthRequestParameters ::
  UpdateConnectionAuthRequestParameters
newUpdateConnectionAuthRequestParameters :: UpdateConnectionAuthRequestParameters
newUpdateConnectionAuthRequestParameters =
  UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters
-> Maybe UpdateConnectionApiKeyAuthRequestParameters
-> Maybe UpdateConnectionBasicAuthRequestParameters
-> UpdateConnectionAuthRequestParameters
UpdateConnectionAuthRequestParameters'
    { $sel:oAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionOAuthRequestParameters
oAuthParameters =
        Maybe UpdateConnectionOAuthRequestParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:invocationHttpParameters:UpdateConnectionAuthRequestParameters' :: Maybe ConnectionHttpParameters
invocationHttpParameters =
        Maybe ConnectionHttpParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeyAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionApiKeyAuthRequestParameters
apiKeyAuthParameters =
        Maybe UpdateConnectionApiKeyAuthRequestParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:basicAuthParameters:UpdateConnectionAuthRequestParameters' :: Maybe UpdateConnectionBasicAuthRequestParameters
basicAuthParameters =
        Maybe UpdateConnectionBasicAuthRequestParameters
forall a. Maybe a
Prelude.Nothing
    }

-- | A @UpdateConnectionOAuthRequestParameters@ object that contains the
-- authorization parameters for OAuth authorization.
updateConnectionAuthRequestParameters_oAuthParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe UpdateConnectionOAuthRequestParameters)
updateConnectionAuthRequestParameters_oAuthParameters :: (Maybe UpdateConnectionOAuthRequestParameters
 -> f (Maybe UpdateConnectionOAuthRequestParameters))
-> UpdateConnectionAuthRequestParameters
-> f UpdateConnectionAuthRequestParameters
updateConnectionAuthRequestParameters_oAuthParameters = (UpdateConnectionAuthRequestParameters
 -> Maybe UpdateConnectionOAuthRequestParameters)
-> (UpdateConnectionAuthRequestParameters
    -> Maybe UpdateConnectionOAuthRequestParameters
    -> UpdateConnectionAuthRequestParameters)
-> Lens
     UpdateConnectionAuthRequestParameters
     UpdateConnectionAuthRequestParameters
     (Maybe UpdateConnectionOAuthRequestParameters)
     (Maybe UpdateConnectionOAuthRequestParameters)
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)

-- | A @ConnectionHttpParameters@ object that contains the additional
-- parameters to use for the connection.
updateConnectionAuthRequestParameters_invocationHttpParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe ConnectionHttpParameters)
updateConnectionAuthRequestParameters_invocationHttpParameters :: (Maybe ConnectionHttpParameters
 -> f (Maybe ConnectionHttpParameters))
-> UpdateConnectionAuthRequestParameters
-> f UpdateConnectionAuthRequestParameters
updateConnectionAuthRequestParameters_invocationHttpParameters = (UpdateConnectionAuthRequestParameters
 -> Maybe ConnectionHttpParameters)
-> (UpdateConnectionAuthRequestParameters
    -> Maybe ConnectionHttpParameters
    -> UpdateConnectionAuthRequestParameters)
-> Lens
     UpdateConnectionAuthRequestParameters
     UpdateConnectionAuthRequestParameters
     (Maybe ConnectionHttpParameters)
     (Maybe ConnectionHttpParameters)
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 @UpdateConnectionApiKeyAuthRequestParameters@ object that contains the
-- authorization parameters for API key authorization.
updateConnectionAuthRequestParameters_apiKeyAuthParameters :: Lens.Lens' UpdateConnectionAuthRequestParameters (Prelude.Maybe UpdateConnectionApiKeyAuthRequestParameters)
updateConnectionAuthRequestParameters_apiKeyAuthParameters :: (Maybe UpdateConnectionApiKeyAuthRequestParameters
 -> f (Maybe UpdateConnectionApiKeyAuthRequestParameters))
-> UpdateConnectionAuthRequestParameters
-> f UpdateConnectionAuthRequestParameters
updateConnectionAuthRequestParameters_apiKeyAuthParameters = (UpdateConnectionAuthRequestParameters
 -> Maybe UpdateConnectionApiKeyAuthRequestParameters)
-> (UpdateConnectionAuthRequestParameters
    -> Maybe UpdateConnectionApiKeyAuthRequestParameters
    -> UpdateConnectionAuthRequestParameters)
-> Lens
     UpdateConnectionAuthRequestParameters
     UpdateConnectionAuthRequestParameters
     (Maybe UpdateConnectionApiKeyAuthRequestParameters)
     (Maybe UpdateConnectionApiKeyAuthRequestParameters)
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 :: (Maybe UpdateConnectionBasicAuthRequestParameters
 -> f (Maybe UpdateConnectionBasicAuthRequestParameters))
-> UpdateConnectionAuthRequestParameters
-> f UpdateConnectionAuthRequestParameters
updateConnectionAuthRequestParameters_basicAuthParameters = (UpdateConnectionAuthRequestParameters
 -> Maybe UpdateConnectionBasicAuthRequestParameters)
-> (UpdateConnectionAuthRequestParameters
    -> Maybe UpdateConnectionBasicAuthRequestParameters
    -> UpdateConnectionAuthRequestParameters)
-> Lens
     UpdateConnectionAuthRequestParameters
     UpdateConnectionAuthRequestParameters
     (Maybe UpdateConnectionBasicAuthRequestParameters)
     (Maybe UpdateConnectionBasicAuthRequestParameters)
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)

instance
  Prelude.Hashable
    UpdateConnectionAuthRequestParameters

instance
  Prelude.NFData
    UpdateConnectionAuthRequestParameters

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