{-# 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.WorkLink.Types.WebsiteAuthorizationProviderSummary
-- 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.WorkLink.Types.WebsiteAuthorizationProviderSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkLink.Types.AuthorizationProviderType

-- | The summary of the website authorization provider.
--
-- /See:/ 'newWebsiteAuthorizationProviderSummary' smart constructor.
data WebsiteAuthorizationProviderSummary = WebsiteAuthorizationProviderSummary'
  { -- | A unique identifier for the authorization provider.
    WebsiteAuthorizationProviderSummary -> Maybe Text
authorizationProviderId :: Prelude.Maybe Prelude.Text,
    -- | The time of creation.
    WebsiteAuthorizationProviderSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The domain name of the authorization provider. This applies only to
    -- SAML-based authorization providers.
    WebsiteAuthorizationProviderSummary -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The authorization provider type.
    WebsiteAuthorizationProviderSummary -> AuthorizationProviderType
authorizationProviderType :: AuthorizationProviderType
  }
  deriving (WebsiteAuthorizationProviderSummary
-> WebsiteAuthorizationProviderSummary -> Bool
(WebsiteAuthorizationProviderSummary
 -> WebsiteAuthorizationProviderSummary -> Bool)
-> (WebsiteAuthorizationProviderSummary
    -> WebsiteAuthorizationProviderSummary -> Bool)
-> Eq WebsiteAuthorizationProviderSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebsiteAuthorizationProviderSummary
-> WebsiteAuthorizationProviderSummary -> Bool
$c/= :: WebsiteAuthorizationProviderSummary
-> WebsiteAuthorizationProviderSummary -> Bool
== :: WebsiteAuthorizationProviderSummary
-> WebsiteAuthorizationProviderSummary -> Bool
$c== :: WebsiteAuthorizationProviderSummary
-> WebsiteAuthorizationProviderSummary -> Bool
Prelude.Eq, ReadPrec [WebsiteAuthorizationProviderSummary]
ReadPrec WebsiteAuthorizationProviderSummary
Int -> ReadS WebsiteAuthorizationProviderSummary
ReadS [WebsiteAuthorizationProviderSummary]
(Int -> ReadS WebsiteAuthorizationProviderSummary)
-> ReadS [WebsiteAuthorizationProviderSummary]
-> ReadPrec WebsiteAuthorizationProviderSummary
-> ReadPrec [WebsiteAuthorizationProviderSummary]
-> Read WebsiteAuthorizationProviderSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebsiteAuthorizationProviderSummary]
$creadListPrec :: ReadPrec [WebsiteAuthorizationProviderSummary]
readPrec :: ReadPrec WebsiteAuthorizationProviderSummary
$creadPrec :: ReadPrec WebsiteAuthorizationProviderSummary
readList :: ReadS [WebsiteAuthorizationProviderSummary]
$creadList :: ReadS [WebsiteAuthorizationProviderSummary]
readsPrec :: Int -> ReadS WebsiteAuthorizationProviderSummary
$creadsPrec :: Int -> ReadS WebsiteAuthorizationProviderSummary
Prelude.Read, Int -> WebsiteAuthorizationProviderSummary -> ShowS
[WebsiteAuthorizationProviderSummary] -> ShowS
WebsiteAuthorizationProviderSummary -> String
(Int -> WebsiteAuthorizationProviderSummary -> ShowS)
-> (WebsiteAuthorizationProviderSummary -> String)
-> ([WebsiteAuthorizationProviderSummary] -> ShowS)
-> Show WebsiteAuthorizationProviderSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebsiteAuthorizationProviderSummary] -> ShowS
$cshowList :: [WebsiteAuthorizationProviderSummary] -> ShowS
show :: WebsiteAuthorizationProviderSummary -> String
$cshow :: WebsiteAuthorizationProviderSummary -> String
showsPrec :: Int -> WebsiteAuthorizationProviderSummary -> ShowS
$cshowsPrec :: Int -> WebsiteAuthorizationProviderSummary -> ShowS
Prelude.Show, (forall x.
 WebsiteAuthorizationProviderSummary
 -> Rep WebsiteAuthorizationProviderSummary x)
-> (forall x.
    Rep WebsiteAuthorizationProviderSummary x
    -> WebsiteAuthorizationProviderSummary)
-> Generic WebsiteAuthorizationProviderSummary
forall x.
Rep WebsiteAuthorizationProviderSummary x
-> WebsiteAuthorizationProviderSummary
forall x.
WebsiteAuthorizationProviderSummary
-> Rep WebsiteAuthorizationProviderSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WebsiteAuthorizationProviderSummary x
-> WebsiteAuthorizationProviderSummary
$cfrom :: forall x.
WebsiteAuthorizationProviderSummary
-> Rep WebsiteAuthorizationProviderSummary x
Prelude.Generic)

-- |
-- Create a value of 'WebsiteAuthorizationProviderSummary' 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:
--
-- 'authorizationProviderId', 'websiteAuthorizationProviderSummary_authorizationProviderId' - A unique identifier for the authorization provider.
--
-- 'createdTime', 'websiteAuthorizationProviderSummary_createdTime' - The time of creation.
--
-- 'domainName', 'websiteAuthorizationProviderSummary_domainName' - The domain name of the authorization provider. This applies only to
-- SAML-based authorization providers.
--
-- 'authorizationProviderType', 'websiteAuthorizationProviderSummary_authorizationProviderType' - The authorization provider type.
newWebsiteAuthorizationProviderSummary ::
  -- | 'authorizationProviderType'
  AuthorizationProviderType ->
  WebsiteAuthorizationProviderSummary
newWebsiteAuthorizationProviderSummary :: AuthorizationProviderType -> WebsiteAuthorizationProviderSummary
newWebsiteAuthorizationProviderSummary
  AuthorizationProviderType
pAuthorizationProviderType_ =
    WebsiteAuthorizationProviderSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> AuthorizationProviderType
-> WebsiteAuthorizationProviderSummary
WebsiteAuthorizationProviderSummary'
      { $sel:authorizationProviderId:WebsiteAuthorizationProviderSummary' :: Maybe Text
authorizationProviderId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createdTime:WebsiteAuthorizationProviderSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:domainName:WebsiteAuthorizationProviderSummary' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:authorizationProviderType:WebsiteAuthorizationProviderSummary' :: AuthorizationProviderType
authorizationProviderType =
          AuthorizationProviderType
pAuthorizationProviderType_
      }

-- | A unique identifier for the authorization provider.
websiteAuthorizationProviderSummary_authorizationProviderId :: Lens.Lens' WebsiteAuthorizationProviderSummary (Prelude.Maybe Prelude.Text)
websiteAuthorizationProviderSummary_authorizationProviderId :: (Maybe Text -> f (Maybe Text))
-> WebsiteAuthorizationProviderSummary
-> f WebsiteAuthorizationProviderSummary
websiteAuthorizationProviderSummary_authorizationProviderId = (WebsiteAuthorizationProviderSummary -> Maybe Text)
-> (WebsiteAuthorizationProviderSummary
    -> Maybe Text -> WebsiteAuthorizationProviderSummary)
-> Lens
     WebsiteAuthorizationProviderSummary
     WebsiteAuthorizationProviderSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteAuthorizationProviderSummary' {Maybe Text
authorizationProviderId :: Maybe Text
$sel:authorizationProviderId:WebsiteAuthorizationProviderSummary' :: WebsiteAuthorizationProviderSummary -> Maybe Text
authorizationProviderId} -> Maybe Text
authorizationProviderId) (\s :: WebsiteAuthorizationProviderSummary
s@WebsiteAuthorizationProviderSummary' {} Maybe Text
a -> WebsiteAuthorizationProviderSummary
s {$sel:authorizationProviderId:WebsiteAuthorizationProviderSummary' :: Maybe Text
authorizationProviderId = Maybe Text
a} :: WebsiteAuthorizationProviderSummary)

-- | The time of creation.
websiteAuthorizationProviderSummary_createdTime :: Lens.Lens' WebsiteAuthorizationProviderSummary (Prelude.Maybe Prelude.UTCTime)
websiteAuthorizationProviderSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WebsiteAuthorizationProviderSummary
-> f WebsiteAuthorizationProviderSummary
websiteAuthorizationProviderSummary_createdTime = (WebsiteAuthorizationProviderSummary -> Maybe POSIX)
-> (WebsiteAuthorizationProviderSummary
    -> Maybe POSIX -> WebsiteAuthorizationProviderSummary)
-> Lens
     WebsiteAuthorizationProviderSummary
     WebsiteAuthorizationProviderSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteAuthorizationProviderSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:WebsiteAuthorizationProviderSummary' :: WebsiteAuthorizationProviderSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: WebsiteAuthorizationProviderSummary
s@WebsiteAuthorizationProviderSummary' {} Maybe POSIX
a -> WebsiteAuthorizationProviderSummary
s {$sel:createdTime:WebsiteAuthorizationProviderSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: WebsiteAuthorizationProviderSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WebsiteAuthorizationProviderSummary
 -> f WebsiteAuthorizationProviderSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WebsiteAuthorizationProviderSummary
-> f WebsiteAuthorizationProviderSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The domain name of the authorization provider. This applies only to
-- SAML-based authorization providers.
websiteAuthorizationProviderSummary_domainName :: Lens.Lens' WebsiteAuthorizationProviderSummary (Prelude.Maybe Prelude.Text)
websiteAuthorizationProviderSummary_domainName :: (Maybe Text -> f (Maybe Text))
-> WebsiteAuthorizationProviderSummary
-> f WebsiteAuthorizationProviderSummary
websiteAuthorizationProviderSummary_domainName = (WebsiteAuthorizationProviderSummary -> Maybe Text)
-> (WebsiteAuthorizationProviderSummary
    -> Maybe Text -> WebsiteAuthorizationProviderSummary)
-> Lens
     WebsiteAuthorizationProviderSummary
     WebsiteAuthorizationProviderSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteAuthorizationProviderSummary' {Maybe Text
domainName :: Maybe Text
$sel:domainName:WebsiteAuthorizationProviderSummary' :: WebsiteAuthorizationProviderSummary -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: WebsiteAuthorizationProviderSummary
s@WebsiteAuthorizationProviderSummary' {} Maybe Text
a -> WebsiteAuthorizationProviderSummary
s {$sel:domainName:WebsiteAuthorizationProviderSummary' :: Maybe Text
domainName = Maybe Text
a} :: WebsiteAuthorizationProviderSummary)

-- | The authorization provider type.
websiteAuthorizationProviderSummary_authorizationProviderType :: Lens.Lens' WebsiteAuthorizationProviderSummary AuthorizationProviderType
websiteAuthorizationProviderSummary_authorizationProviderType :: (AuthorizationProviderType -> f AuthorizationProviderType)
-> WebsiteAuthorizationProviderSummary
-> f WebsiteAuthorizationProviderSummary
websiteAuthorizationProviderSummary_authorizationProviderType = (WebsiteAuthorizationProviderSummary -> AuthorizationProviderType)
-> (WebsiteAuthorizationProviderSummary
    -> AuthorizationProviderType
    -> WebsiteAuthorizationProviderSummary)
-> Lens
     WebsiteAuthorizationProviderSummary
     WebsiteAuthorizationProviderSummary
     AuthorizationProviderType
     AuthorizationProviderType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteAuthorizationProviderSummary' {AuthorizationProviderType
authorizationProviderType :: AuthorizationProviderType
$sel:authorizationProviderType:WebsiteAuthorizationProviderSummary' :: WebsiteAuthorizationProviderSummary -> AuthorizationProviderType
authorizationProviderType} -> AuthorizationProviderType
authorizationProviderType) (\s :: WebsiteAuthorizationProviderSummary
s@WebsiteAuthorizationProviderSummary' {} AuthorizationProviderType
a -> WebsiteAuthorizationProviderSummary
s {$sel:authorizationProviderType:WebsiteAuthorizationProviderSummary' :: AuthorizationProviderType
authorizationProviderType = AuthorizationProviderType
a} :: WebsiteAuthorizationProviderSummary)

instance
  Core.FromJSON
    WebsiteAuthorizationProviderSummary
  where
  parseJSON :: Value -> Parser WebsiteAuthorizationProviderSummary
parseJSON =
    String
-> (Object -> Parser WebsiteAuthorizationProviderSummary)
-> Value
-> Parser WebsiteAuthorizationProviderSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WebsiteAuthorizationProviderSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> AuthorizationProviderType
-> WebsiteAuthorizationProviderSummary
WebsiteAuthorizationProviderSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> AuthorizationProviderType
 -> WebsiteAuthorizationProviderSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> AuthorizationProviderType
      -> WebsiteAuthorizationProviderSummary)
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
"AuthorizationProviderId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> AuthorizationProviderType
   -> WebsiteAuthorizationProviderSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> AuthorizationProviderType
      -> WebsiteAuthorizationProviderSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser
  (Maybe Text
   -> AuthorizationProviderType
   -> WebsiteAuthorizationProviderSummary)
-> Parser (Maybe Text)
-> Parser
     (AuthorizationProviderType -> WebsiteAuthorizationProviderSummary)
forall (f :: * -> *) a b. Applicative f => 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
"DomainName")
            Parser
  (AuthorizationProviderType -> WebsiteAuthorizationProviderSummary)
-> Parser AuthorizationProviderType
-> Parser WebsiteAuthorizationProviderSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AuthorizationProviderType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AuthorizationProviderType")
      )

instance
  Prelude.Hashable
    WebsiteAuthorizationProviderSummary

instance
  Prelude.NFData
    WebsiteAuthorizationProviderSummary