{-# 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.UpdateConnectionOAuthClientRequestParameters
-- 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.UpdateConnectionOAuthClientRequestParameters where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the OAuth authorization parameters to use for the connection.
--
-- /See:/ 'newUpdateConnectionOAuthClientRequestParameters' smart constructor.
data UpdateConnectionOAuthClientRequestParameters = UpdateConnectionOAuthClientRequestParameters'
  { -- | The client ID to use for OAuth authorization.
    UpdateConnectionOAuthClientRequestParameters -> Maybe Text
clientID :: Prelude.Maybe Prelude.Text,
    -- | The client secret assciated with the client ID to use for OAuth
    -- authorization.
    UpdateConnectionOAuthClientRequestParameters -> Maybe Text
clientSecret :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateConnectionOAuthClientRequestParameters
-> UpdateConnectionOAuthClientRequestParameters -> Bool
(UpdateConnectionOAuthClientRequestParameters
 -> UpdateConnectionOAuthClientRequestParameters -> Bool)
-> (UpdateConnectionOAuthClientRequestParameters
    -> UpdateConnectionOAuthClientRequestParameters -> Bool)
-> Eq UpdateConnectionOAuthClientRequestParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectionOAuthClientRequestParameters
-> UpdateConnectionOAuthClientRequestParameters -> Bool
$c/= :: UpdateConnectionOAuthClientRequestParameters
-> UpdateConnectionOAuthClientRequestParameters -> Bool
== :: UpdateConnectionOAuthClientRequestParameters
-> UpdateConnectionOAuthClientRequestParameters -> Bool
$c== :: UpdateConnectionOAuthClientRequestParameters
-> UpdateConnectionOAuthClientRequestParameters -> Bool
Prelude.Eq, ReadPrec [UpdateConnectionOAuthClientRequestParameters]
ReadPrec UpdateConnectionOAuthClientRequestParameters
Int -> ReadS UpdateConnectionOAuthClientRequestParameters
ReadS [UpdateConnectionOAuthClientRequestParameters]
(Int -> ReadS UpdateConnectionOAuthClientRequestParameters)
-> ReadS [UpdateConnectionOAuthClientRequestParameters]
-> ReadPrec UpdateConnectionOAuthClientRequestParameters
-> ReadPrec [UpdateConnectionOAuthClientRequestParameters]
-> Read UpdateConnectionOAuthClientRequestParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectionOAuthClientRequestParameters]
$creadListPrec :: ReadPrec [UpdateConnectionOAuthClientRequestParameters]
readPrec :: ReadPrec UpdateConnectionOAuthClientRequestParameters
$creadPrec :: ReadPrec UpdateConnectionOAuthClientRequestParameters
readList :: ReadS [UpdateConnectionOAuthClientRequestParameters]
$creadList :: ReadS [UpdateConnectionOAuthClientRequestParameters]
readsPrec :: Int -> ReadS UpdateConnectionOAuthClientRequestParameters
$creadsPrec :: Int -> ReadS UpdateConnectionOAuthClientRequestParameters
Prelude.Read, Int -> UpdateConnectionOAuthClientRequestParameters -> ShowS
[UpdateConnectionOAuthClientRequestParameters] -> ShowS
UpdateConnectionOAuthClientRequestParameters -> String
(Int -> UpdateConnectionOAuthClientRequestParameters -> ShowS)
-> (UpdateConnectionOAuthClientRequestParameters -> String)
-> ([UpdateConnectionOAuthClientRequestParameters] -> ShowS)
-> Show UpdateConnectionOAuthClientRequestParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectionOAuthClientRequestParameters] -> ShowS
$cshowList :: [UpdateConnectionOAuthClientRequestParameters] -> ShowS
show :: UpdateConnectionOAuthClientRequestParameters -> String
$cshow :: UpdateConnectionOAuthClientRequestParameters -> String
showsPrec :: Int -> UpdateConnectionOAuthClientRequestParameters -> ShowS
$cshowsPrec :: Int -> UpdateConnectionOAuthClientRequestParameters -> ShowS
Prelude.Show, (forall x.
 UpdateConnectionOAuthClientRequestParameters
 -> Rep UpdateConnectionOAuthClientRequestParameters x)
-> (forall x.
    Rep UpdateConnectionOAuthClientRequestParameters x
    -> UpdateConnectionOAuthClientRequestParameters)
-> Generic UpdateConnectionOAuthClientRequestParameters
forall x.
Rep UpdateConnectionOAuthClientRequestParameters x
-> UpdateConnectionOAuthClientRequestParameters
forall x.
UpdateConnectionOAuthClientRequestParameters
-> Rep UpdateConnectionOAuthClientRequestParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectionOAuthClientRequestParameters x
-> UpdateConnectionOAuthClientRequestParameters
$cfrom :: forall x.
UpdateConnectionOAuthClientRequestParameters
-> Rep UpdateConnectionOAuthClientRequestParameters x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConnectionOAuthClientRequestParameters' 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:
--
-- 'clientID', 'updateConnectionOAuthClientRequestParameters_clientID' - The client ID to use for OAuth authorization.
--
-- 'clientSecret', 'updateConnectionOAuthClientRequestParameters_clientSecret' - The client secret assciated with the client ID to use for OAuth
-- authorization.
newUpdateConnectionOAuthClientRequestParameters ::
  UpdateConnectionOAuthClientRequestParameters
newUpdateConnectionOAuthClientRequestParameters :: UpdateConnectionOAuthClientRequestParameters
newUpdateConnectionOAuthClientRequestParameters =
  UpdateConnectionOAuthClientRequestParameters' :: Maybe Text
-> Maybe Text -> UpdateConnectionOAuthClientRequestParameters
UpdateConnectionOAuthClientRequestParameters'
    { $sel:clientID:UpdateConnectionOAuthClientRequestParameters' :: Maybe Text
clientID =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientSecret:UpdateConnectionOAuthClientRequestParameters' :: Maybe Text
clientSecret =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The client ID to use for OAuth authorization.
updateConnectionOAuthClientRequestParameters_clientID :: Lens.Lens' UpdateConnectionOAuthClientRequestParameters (Prelude.Maybe Prelude.Text)
updateConnectionOAuthClientRequestParameters_clientID :: (Maybe Text -> f (Maybe Text))
-> UpdateConnectionOAuthClientRequestParameters
-> f UpdateConnectionOAuthClientRequestParameters
updateConnectionOAuthClientRequestParameters_clientID = (UpdateConnectionOAuthClientRequestParameters -> Maybe Text)
-> (UpdateConnectionOAuthClientRequestParameters
    -> Maybe Text -> UpdateConnectionOAuthClientRequestParameters)
-> Lens
     UpdateConnectionOAuthClientRequestParameters
     UpdateConnectionOAuthClientRequestParameters
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionOAuthClientRequestParameters' {Maybe Text
clientID :: Maybe Text
$sel:clientID:UpdateConnectionOAuthClientRequestParameters' :: UpdateConnectionOAuthClientRequestParameters -> Maybe Text
clientID} -> Maybe Text
clientID) (\s :: UpdateConnectionOAuthClientRequestParameters
s@UpdateConnectionOAuthClientRequestParameters' {} Maybe Text
a -> UpdateConnectionOAuthClientRequestParameters
s {$sel:clientID:UpdateConnectionOAuthClientRequestParameters' :: Maybe Text
clientID = Maybe Text
a} :: UpdateConnectionOAuthClientRequestParameters)

-- | The client secret assciated with the client ID to use for OAuth
-- authorization.
updateConnectionOAuthClientRequestParameters_clientSecret :: Lens.Lens' UpdateConnectionOAuthClientRequestParameters (Prelude.Maybe Prelude.Text)
updateConnectionOAuthClientRequestParameters_clientSecret :: (Maybe Text -> f (Maybe Text))
-> UpdateConnectionOAuthClientRequestParameters
-> f UpdateConnectionOAuthClientRequestParameters
updateConnectionOAuthClientRequestParameters_clientSecret = (UpdateConnectionOAuthClientRequestParameters -> Maybe Text)
-> (UpdateConnectionOAuthClientRequestParameters
    -> Maybe Text -> UpdateConnectionOAuthClientRequestParameters)
-> Lens
     UpdateConnectionOAuthClientRequestParameters
     UpdateConnectionOAuthClientRequestParameters
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionOAuthClientRequestParameters' {Maybe Text
clientSecret :: Maybe Text
$sel:clientSecret:UpdateConnectionOAuthClientRequestParameters' :: UpdateConnectionOAuthClientRequestParameters -> Maybe Text
clientSecret} -> Maybe Text
clientSecret) (\s :: UpdateConnectionOAuthClientRequestParameters
s@UpdateConnectionOAuthClientRequestParameters' {} Maybe Text
a -> UpdateConnectionOAuthClientRequestParameters
s {$sel:clientSecret:UpdateConnectionOAuthClientRequestParameters' :: Maybe Text
clientSecret = Maybe Text
a} :: UpdateConnectionOAuthClientRequestParameters)

instance
  Prelude.Hashable
    UpdateConnectionOAuthClientRequestParameters

instance
  Prelude.NFData
    UpdateConnectionOAuthClientRequestParameters

instance
  Core.ToJSON
    UpdateConnectionOAuthClientRequestParameters
  where
  toJSON :: UpdateConnectionOAuthClientRequestParameters -> Value
toJSON
    UpdateConnectionOAuthClientRequestParameters' {Maybe Text
clientSecret :: Maybe Text
clientID :: Maybe Text
$sel:clientSecret:UpdateConnectionOAuthClientRequestParameters' :: UpdateConnectionOAuthClientRequestParameters -> Maybe Text
$sel:clientID:UpdateConnectionOAuthClientRequestParameters' :: UpdateConnectionOAuthClientRequestParameters -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"ClientID" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientID,
              (Text
"ClientSecret" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientSecret
            ]
        )