{-# 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.AppFlow.Types.SingularConnectorProfileCredentials
-- 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.AppFlow.Types.SingularConnectorProfileCredentials where

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

-- | The connector-specific profile credentials required when using Singular.
--
-- /See:/ 'newSingularConnectorProfileCredentials' smart constructor.
data SingularConnectorProfileCredentials = SingularConnectorProfileCredentials'
  { -- | A unique alphanumeric identifier used to authenticate a user, developer,
    -- or calling program to your API.
    SingularConnectorProfileCredentials -> Text
apiKey :: Prelude.Text
  }
  deriving (SingularConnectorProfileCredentials
-> SingularConnectorProfileCredentials -> Bool
(SingularConnectorProfileCredentials
 -> SingularConnectorProfileCredentials -> Bool)
-> (SingularConnectorProfileCredentials
    -> SingularConnectorProfileCredentials -> Bool)
-> Eq SingularConnectorProfileCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SingularConnectorProfileCredentials
-> SingularConnectorProfileCredentials -> Bool
$c/= :: SingularConnectorProfileCredentials
-> SingularConnectorProfileCredentials -> Bool
== :: SingularConnectorProfileCredentials
-> SingularConnectorProfileCredentials -> Bool
$c== :: SingularConnectorProfileCredentials
-> SingularConnectorProfileCredentials -> Bool
Prelude.Eq, ReadPrec [SingularConnectorProfileCredentials]
ReadPrec SingularConnectorProfileCredentials
Int -> ReadS SingularConnectorProfileCredentials
ReadS [SingularConnectorProfileCredentials]
(Int -> ReadS SingularConnectorProfileCredentials)
-> ReadS [SingularConnectorProfileCredentials]
-> ReadPrec SingularConnectorProfileCredentials
-> ReadPrec [SingularConnectorProfileCredentials]
-> Read SingularConnectorProfileCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SingularConnectorProfileCredentials]
$creadListPrec :: ReadPrec [SingularConnectorProfileCredentials]
readPrec :: ReadPrec SingularConnectorProfileCredentials
$creadPrec :: ReadPrec SingularConnectorProfileCredentials
readList :: ReadS [SingularConnectorProfileCredentials]
$creadList :: ReadS [SingularConnectorProfileCredentials]
readsPrec :: Int -> ReadS SingularConnectorProfileCredentials
$creadsPrec :: Int -> ReadS SingularConnectorProfileCredentials
Prelude.Read, Int -> SingularConnectorProfileCredentials -> ShowS
[SingularConnectorProfileCredentials] -> ShowS
SingularConnectorProfileCredentials -> String
(Int -> SingularConnectorProfileCredentials -> ShowS)
-> (SingularConnectorProfileCredentials -> String)
-> ([SingularConnectorProfileCredentials] -> ShowS)
-> Show SingularConnectorProfileCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SingularConnectorProfileCredentials] -> ShowS
$cshowList :: [SingularConnectorProfileCredentials] -> ShowS
show :: SingularConnectorProfileCredentials -> String
$cshow :: SingularConnectorProfileCredentials -> String
showsPrec :: Int -> SingularConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> SingularConnectorProfileCredentials -> ShowS
Prelude.Show, (forall x.
 SingularConnectorProfileCredentials
 -> Rep SingularConnectorProfileCredentials x)
-> (forall x.
    Rep SingularConnectorProfileCredentials x
    -> SingularConnectorProfileCredentials)
-> Generic SingularConnectorProfileCredentials
forall x.
Rep SingularConnectorProfileCredentials x
-> SingularConnectorProfileCredentials
forall x.
SingularConnectorProfileCredentials
-> Rep SingularConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SingularConnectorProfileCredentials x
-> SingularConnectorProfileCredentials
$cfrom :: forall x.
SingularConnectorProfileCredentials
-> Rep SingularConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'SingularConnectorProfileCredentials' 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:
--
-- 'apiKey', 'singularConnectorProfileCredentials_apiKey' - A unique alphanumeric identifier used to authenticate a user, developer,
-- or calling program to your API.
newSingularConnectorProfileCredentials ::
  -- | 'apiKey'
  Prelude.Text ->
  SingularConnectorProfileCredentials
newSingularConnectorProfileCredentials :: Text -> SingularConnectorProfileCredentials
newSingularConnectorProfileCredentials Text
pApiKey_ =
  SingularConnectorProfileCredentials' :: Text -> SingularConnectorProfileCredentials
SingularConnectorProfileCredentials'
    { $sel:apiKey:SingularConnectorProfileCredentials' :: Text
apiKey =
        Text
pApiKey_
    }

-- | A unique alphanumeric identifier used to authenticate a user, developer,
-- or calling program to your API.
singularConnectorProfileCredentials_apiKey :: Lens.Lens' SingularConnectorProfileCredentials Prelude.Text
singularConnectorProfileCredentials_apiKey :: (Text -> f Text)
-> SingularConnectorProfileCredentials
-> f SingularConnectorProfileCredentials
singularConnectorProfileCredentials_apiKey = (SingularConnectorProfileCredentials -> Text)
-> (SingularConnectorProfileCredentials
    -> Text -> SingularConnectorProfileCredentials)
-> Lens
     SingularConnectorProfileCredentials
     SingularConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingularConnectorProfileCredentials' {Text
apiKey :: Text
$sel:apiKey:SingularConnectorProfileCredentials' :: SingularConnectorProfileCredentials -> Text
apiKey} -> Text
apiKey) (\s :: SingularConnectorProfileCredentials
s@SingularConnectorProfileCredentials' {} Text
a -> SingularConnectorProfileCredentials
s {$sel:apiKey:SingularConnectorProfileCredentials' :: Text
apiKey = Text
a} :: SingularConnectorProfileCredentials)

instance
  Prelude.Hashable
    SingularConnectorProfileCredentials

instance
  Prelude.NFData
    SingularConnectorProfileCredentials

instance
  Core.ToJSON
    SingularConnectorProfileCredentials
  where
  toJSON :: SingularConnectorProfileCredentials -> Value
toJSON SingularConnectorProfileCredentials' {Text
apiKey :: Text
$sel:apiKey:SingularConnectorProfileCredentials' :: SingularConnectorProfileCredentials -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"apiKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
apiKey)]
      )