{-# 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.IoT.Types.AuthorizerSummary
-- 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.IoT.Types.AuthorizerSummary where

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

-- | The authorizer summary.
--
-- /See:/ 'newAuthorizerSummary' smart constructor.
data AuthorizerSummary = AuthorizerSummary'
  { -- | The authorizer name.
    AuthorizerSummary -> Maybe Text
authorizerName :: Prelude.Maybe Prelude.Text,
    -- | The authorizer ARN.
    AuthorizerSummary -> Maybe Text
authorizerArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AuthorizerSummary -> AuthorizerSummary -> Bool
(AuthorizerSummary -> AuthorizerSummary -> Bool)
-> (AuthorizerSummary -> AuthorizerSummary -> Bool)
-> Eq AuthorizerSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizerSummary -> AuthorizerSummary -> Bool
$c/= :: AuthorizerSummary -> AuthorizerSummary -> Bool
== :: AuthorizerSummary -> AuthorizerSummary -> Bool
$c== :: AuthorizerSummary -> AuthorizerSummary -> Bool
Prelude.Eq, ReadPrec [AuthorizerSummary]
ReadPrec AuthorizerSummary
Int -> ReadS AuthorizerSummary
ReadS [AuthorizerSummary]
(Int -> ReadS AuthorizerSummary)
-> ReadS [AuthorizerSummary]
-> ReadPrec AuthorizerSummary
-> ReadPrec [AuthorizerSummary]
-> Read AuthorizerSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizerSummary]
$creadListPrec :: ReadPrec [AuthorizerSummary]
readPrec :: ReadPrec AuthorizerSummary
$creadPrec :: ReadPrec AuthorizerSummary
readList :: ReadS [AuthorizerSummary]
$creadList :: ReadS [AuthorizerSummary]
readsPrec :: Int -> ReadS AuthorizerSummary
$creadsPrec :: Int -> ReadS AuthorizerSummary
Prelude.Read, Int -> AuthorizerSummary -> ShowS
[AuthorizerSummary] -> ShowS
AuthorizerSummary -> String
(Int -> AuthorizerSummary -> ShowS)
-> (AuthorizerSummary -> String)
-> ([AuthorizerSummary] -> ShowS)
-> Show AuthorizerSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizerSummary] -> ShowS
$cshowList :: [AuthorizerSummary] -> ShowS
show :: AuthorizerSummary -> String
$cshow :: AuthorizerSummary -> String
showsPrec :: Int -> AuthorizerSummary -> ShowS
$cshowsPrec :: Int -> AuthorizerSummary -> ShowS
Prelude.Show, (forall x. AuthorizerSummary -> Rep AuthorizerSummary x)
-> (forall x. Rep AuthorizerSummary x -> AuthorizerSummary)
-> Generic AuthorizerSummary
forall x. Rep AuthorizerSummary x -> AuthorizerSummary
forall x. AuthorizerSummary -> Rep AuthorizerSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthorizerSummary x -> AuthorizerSummary
$cfrom :: forall x. AuthorizerSummary -> Rep AuthorizerSummary x
Prelude.Generic)

-- |
-- Create a value of 'AuthorizerSummary' 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:
--
-- 'authorizerName', 'authorizerSummary_authorizerName' - The authorizer name.
--
-- 'authorizerArn', 'authorizerSummary_authorizerArn' - The authorizer ARN.
newAuthorizerSummary ::
  AuthorizerSummary
newAuthorizerSummary :: AuthorizerSummary
newAuthorizerSummary =
  AuthorizerSummary' :: Maybe Text -> Maybe Text -> AuthorizerSummary
AuthorizerSummary'
    { $sel:authorizerName:AuthorizerSummary' :: Maybe Text
authorizerName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizerArn:AuthorizerSummary' :: Maybe Text
authorizerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The authorizer name.
authorizerSummary_authorizerName :: Lens.Lens' AuthorizerSummary (Prelude.Maybe Prelude.Text)
authorizerSummary_authorizerName :: (Maybe Text -> f (Maybe Text))
-> AuthorizerSummary -> f AuthorizerSummary
authorizerSummary_authorizerName = (AuthorizerSummary -> Maybe Text)
-> (AuthorizerSummary -> Maybe Text -> AuthorizerSummary)
-> Lens
     AuthorizerSummary AuthorizerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizerSummary' {Maybe Text
authorizerName :: Maybe Text
$sel:authorizerName:AuthorizerSummary' :: AuthorizerSummary -> Maybe Text
authorizerName} -> Maybe Text
authorizerName) (\s :: AuthorizerSummary
s@AuthorizerSummary' {} Maybe Text
a -> AuthorizerSummary
s {$sel:authorizerName:AuthorizerSummary' :: Maybe Text
authorizerName = Maybe Text
a} :: AuthorizerSummary)

-- | The authorizer ARN.
authorizerSummary_authorizerArn :: Lens.Lens' AuthorizerSummary (Prelude.Maybe Prelude.Text)
authorizerSummary_authorizerArn :: (Maybe Text -> f (Maybe Text))
-> AuthorizerSummary -> f AuthorizerSummary
authorizerSummary_authorizerArn = (AuthorizerSummary -> Maybe Text)
-> (AuthorizerSummary -> Maybe Text -> AuthorizerSummary)
-> Lens
     AuthorizerSummary AuthorizerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizerSummary' {Maybe Text
authorizerArn :: Maybe Text
$sel:authorizerArn:AuthorizerSummary' :: AuthorizerSummary -> Maybe Text
authorizerArn} -> Maybe Text
authorizerArn) (\s :: AuthorizerSummary
s@AuthorizerSummary' {} Maybe Text
a -> AuthorizerSummary
s {$sel:authorizerArn:AuthorizerSummary' :: Maybe Text
authorizerArn = Maybe Text
a} :: AuthorizerSummary)

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

instance Prelude.Hashable AuthorizerSummary

instance Prelude.NFData AuthorizerSummary