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

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

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

-- |
-- Create a value of 'ConnectionOAuthClientResponseParameters' 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', 'connectionOAuthClientResponseParameters_clientID' - The client ID associated with the response to the connection request.
newConnectionOAuthClientResponseParameters ::
  ConnectionOAuthClientResponseParameters
newConnectionOAuthClientResponseParameters :: ConnectionOAuthClientResponseParameters
newConnectionOAuthClientResponseParameters =
  ConnectionOAuthClientResponseParameters' :: Maybe Text -> ConnectionOAuthClientResponseParameters
ConnectionOAuthClientResponseParameters'
    { $sel:clientID:ConnectionOAuthClientResponseParameters' :: Maybe Text
clientID =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The client ID associated with the response to the connection request.
connectionOAuthClientResponseParameters_clientID :: Lens.Lens' ConnectionOAuthClientResponseParameters (Prelude.Maybe Prelude.Text)
connectionOAuthClientResponseParameters_clientID :: (Maybe Text -> f (Maybe Text))
-> ConnectionOAuthClientResponseParameters
-> f ConnectionOAuthClientResponseParameters
connectionOAuthClientResponseParameters_clientID = (ConnectionOAuthClientResponseParameters -> Maybe Text)
-> (ConnectionOAuthClientResponseParameters
    -> Maybe Text -> ConnectionOAuthClientResponseParameters)
-> Lens
     ConnectionOAuthClientResponseParameters
     ConnectionOAuthClientResponseParameters
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionOAuthClientResponseParameters' {Maybe Text
clientID :: Maybe Text
$sel:clientID:ConnectionOAuthClientResponseParameters' :: ConnectionOAuthClientResponseParameters -> Maybe Text
clientID} -> Maybe Text
clientID) (\s :: ConnectionOAuthClientResponseParameters
s@ConnectionOAuthClientResponseParameters' {} Maybe Text
a -> ConnectionOAuthClientResponseParameters
s {$sel:clientID:ConnectionOAuthClientResponseParameters' :: Maybe Text
clientID = Maybe Text
a} :: ConnectionOAuthClientResponseParameters)

instance
  Core.FromJSON
    ConnectionOAuthClientResponseParameters
  where
  parseJSON :: Value -> Parser ConnectionOAuthClientResponseParameters
parseJSON =
    String
-> (Object -> Parser ConnectionOAuthClientResponseParameters)
-> Value
-> Parser ConnectionOAuthClientResponseParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConnectionOAuthClientResponseParameters"
      ( \Object
x ->
          Maybe Text -> ConnectionOAuthClientResponseParameters
ConnectionOAuthClientResponseParameters'
            (Maybe Text -> ConnectionOAuthClientResponseParameters)
-> Parser (Maybe Text)
-> Parser ConnectionOAuthClientResponseParameters
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientID")
      )

instance
  Prelude.Hashable
    ConnectionOAuthClientResponseParameters

instance
  Prelude.NFData
    ConnectionOAuthClientResponseParameters