{-# 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.Grafana.Types.AwsSsoAuthentication
-- 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.Grafana.Types.AwsSsoAuthentication where

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

-- | A structure containing information about how this workspace works with
-- Amazon Web Services SSO.
--
-- /See:/ 'newAwsSsoAuthentication' smart constructor.
data AwsSsoAuthentication = AwsSsoAuthentication'
  { -- | The ID of the Amazon Web Services SSO-managed application that is
    -- created by Amazon Managed Grafana.
    AwsSsoAuthentication -> Maybe Text
ssoClientId :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsSsoAuthentication -> AwsSsoAuthentication -> Bool
(AwsSsoAuthentication -> AwsSsoAuthentication -> Bool)
-> (AwsSsoAuthentication -> AwsSsoAuthentication -> Bool)
-> Eq AwsSsoAuthentication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsSsoAuthentication -> AwsSsoAuthentication -> Bool
$c/= :: AwsSsoAuthentication -> AwsSsoAuthentication -> Bool
== :: AwsSsoAuthentication -> AwsSsoAuthentication -> Bool
$c== :: AwsSsoAuthentication -> AwsSsoAuthentication -> Bool
Prelude.Eq, ReadPrec [AwsSsoAuthentication]
ReadPrec AwsSsoAuthentication
Int -> ReadS AwsSsoAuthentication
ReadS [AwsSsoAuthentication]
(Int -> ReadS AwsSsoAuthentication)
-> ReadS [AwsSsoAuthentication]
-> ReadPrec AwsSsoAuthentication
-> ReadPrec [AwsSsoAuthentication]
-> Read AwsSsoAuthentication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsSsoAuthentication]
$creadListPrec :: ReadPrec [AwsSsoAuthentication]
readPrec :: ReadPrec AwsSsoAuthentication
$creadPrec :: ReadPrec AwsSsoAuthentication
readList :: ReadS [AwsSsoAuthentication]
$creadList :: ReadS [AwsSsoAuthentication]
readsPrec :: Int -> ReadS AwsSsoAuthentication
$creadsPrec :: Int -> ReadS AwsSsoAuthentication
Prelude.Read, Int -> AwsSsoAuthentication -> ShowS
[AwsSsoAuthentication] -> ShowS
AwsSsoAuthentication -> String
(Int -> AwsSsoAuthentication -> ShowS)
-> (AwsSsoAuthentication -> String)
-> ([AwsSsoAuthentication] -> ShowS)
-> Show AwsSsoAuthentication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsSsoAuthentication] -> ShowS
$cshowList :: [AwsSsoAuthentication] -> ShowS
show :: AwsSsoAuthentication -> String
$cshow :: AwsSsoAuthentication -> String
showsPrec :: Int -> AwsSsoAuthentication -> ShowS
$cshowsPrec :: Int -> AwsSsoAuthentication -> ShowS
Prelude.Show, (forall x. AwsSsoAuthentication -> Rep AwsSsoAuthentication x)
-> (forall x. Rep AwsSsoAuthentication x -> AwsSsoAuthentication)
-> Generic AwsSsoAuthentication
forall x. Rep AwsSsoAuthentication x -> AwsSsoAuthentication
forall x. AwsSsoAuthentication -> Rep AwsSsoAuthentication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsSsoAuthentication x -> AwsSsoAuthentication
$cfrom :: forall x. AwsSsoAuthentication -> Rep AwsSsoAuthentication x
Prelude.Generic)

-- |
-- Create a value of 'AwsSsoAuthentication' 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:
--
-- 'ssoClientId', 'awsSsoAuthentication_ssoClientId' - The ID of the Amazon Web Services SSO-managed application that is
-- created by Amazon Managed Grafana.
newAwsSsoAuthentication ::
  AwsSsoAuthentication
newAwsSsoAuthentication :: AwsSsoAuthentication
newAwsSsoAuthentication =
  AwsSsoAuthentication' :: Maybe Text -> AwsSsoAuthentication
AwsSsoAuthentication'
    { $sel:ssoClientId:AwsSsoAuthentication' :: Maybe Text
ssoClientId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Amazon Web Services SSO-managed application that is
-- created by Amazon Managed Grafana.
awsSsoAuthentication_ssoClientId :: Lens.Lens' AwsSsoAuthentication (Prelude.Maybe Prelude.Text)
awsSsoAuthentication_ssoClientId :: (Maybe Text -> f (Maybe Text))
-> AwsSsoAuthentication -> f AwsSsoAuthentication
awsSsoAuthentication_ssoClientId = (AwsSsoAuthentication -> Maybe Text)
-> (AwsSsoAuthentication -> Maybe Text -> AwsSsoAuthentication)
-> Lens
     AwsSsoAuthentication AwsSsoAuthentication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSsoAuthentication' {Maybe Text
ssoClientId :: Maybe Text
$sel:ssoClientId:AwsSsoAuthentication' :: AwsSsoAuthentication -> Maybe Text
ssoClientId} -> Maybe Text
ssoClientId) (\s :: AwsSsoAuthentication
s@AwsSsoAuthentication' {} Maybe Text
a -> AwsSsoAuthentication
s {$sel:ssoClientId:AwsSsoAuthentication' :: Maybe Text
ssoClientId = Maybe Text
a} :: AwsSsoAuthentication)

instance Core.FromJSON AwsSsoAuthentication where
  parseJSON :: Value -> Parser AwsSsoAuthentication
parseJSON =
    String
-> (Object -> Parser AwsSsoAuthentication)
-> Value
-> Parser AwsSsoAuthentication
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsSsoAuthentication"
      ( \Object
x ->
          Maybe Text -> AwsSsoAuthentication
AwsSsoAuthentication'
            (Maybe Text -> AwsSsoAuthentication)
-> Parser (Maybe Text) -> Parser AwsSsoAuthentication
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
"ssoClientId")
      )

instance Prelude.Hashable AwsSsoAuthentication

instance Prelude.NFData AwsSsoAuthentication