{-# 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.OpenSearchServerless.Types.SecurityConfigStats
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpenSearchServerless.Types.SecurityConfigStats where

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

-- | Statistics for an OpenSearch Serverless security configuration.
--
-- /See:/ 'newSecurityConfigStats' smart constructor.
data SecurityConfigStats = SecurityConfigStats'
  { -- | The number of security configurations in the current account.
    SecurityConfigStats -> Maybe Integer
samlConfigCount :: Prelude.Maybe Prelude.Integer
  }
  deriving (SecurityConfigStats -> SecurityConfigStats -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityConfigStats -> SecurityConfigStats -> Bool
$c/= :: SecurityConfigStats -> SecurityConfigStats -> Bool
== :: SecurityConfigStats -> SecurityConfigStats -> Bool
$c== :: SecurityConfigStats -> SecurityConfigStats -> Bool
Prelude.Eq, ReadPrec [SecurityConfigStats]
ReadPrec SecurityConfigStats
Int -> ReadS SecurityConfigStats
ReadS [SecurityConfigStats]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityConfigStats]
$creadListPrec :: ReadPrec [SecurityConfigStats]
readPrec :: ReadPrec SecurityConfigStats
$creadPrec :: ReadPrec SecurityConfigStats
readList :: ReadS [SecurityConfigStats]
$creadList :: ReadS [SecurityConfigStats]
readsPrec :: Int -> ReadS SecurityConfigStats
$creadsPrec :: Int -> ReadS SecurityConfigStats
Prelude.Read, Int -> SecurityConfigStats -> ShowS
[SecurityConfigStats] -> ShowS
SecurityConfigStats -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityConfigStats] -> ShowS
$cshowList :: [SecurityConfigStats] -> ShowS
show :: SecurityConfigStats -> String
$cshow :: SecurityConfigStats -> String
showsPrec :: Int -> SecurityConfigStats -> ShowS
$cshowsPrec :: Int -> SecurityConfigStats -> ShowS
Prelude.Show, forall x. Rep SecurityConfigStats x -> SecurityConfigStats
forall x. SecurityConfigStats -> Rep SecurityConfigStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityConfigStats x -> SecurityConfigStats
$cfrom :: forall x. SecurityConfigStats -> Rep SecurityConfigStats x
Prelude.Generic)

-- |
-- Create a value of 'SecurityConfigStats' 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:
--
-- 'samlConfigCount', 'securityConfigStats_samlConfigCount' - The number of security configurations in the current account.
newSecurityConfigStats ::
  SecurityConfigStats
newSecurityConfigStats :: SecurityConfigStats
newSecurityConfigStats =
  SecurityConfigStats'
    { $sel:samlConfigCount:SecurityConfigStats' :: Maybe Integer
samlConfigCount =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The number of security configurations in the current account.
securityConfigStats_samlConfigCount :: Lens.Lens' SecurityConfigStats (Prelude.Maybe Prelude.Integer)
securityConfigStats_samlConfigCount :: Lens' SecurityConfigStats (Maybe Integer)
securityConfigStats_samlConfigCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigStats' {Maybe Integer
samlConfigCount :: Maybe Integer
$sel:samlConfigCount:SecurityConfigStats' :: SecurityConfigStats -> Maybe Integer
samlConfigCount} -> Maybe Integer
samlConfigCount) (\s :: SecurityConfigStats
s@SecurityConfigStats' {} Maybe Integer
a -> SecurityConfigStats
s {$sel:samlConfigCount:SecurityConfigStats' :: Maybe Integer
samlConfigCount = Maybe Integer
a} :: SecurityConfigStats)

instance Data.FromJSON SecurityConfigStats where
  parseJSON :: Value -> Parser SecurityConfigStats
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SecurityConfigStats"
      ( \Object
x ->
          Maybe Integer -> SecurityConfigStats
SecurityConfigStats'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SamlConfigCount")
      )

instance Prelude.Hashable SecurityConfigStats where
  hashWithSalt :: Int -> SecurityConfigStats -> Int
hashWithSalt Int
_salt SecurityConfigStats' {Maybe Integer
samlConfigCount :: Maybe Integer
$sel:samlConfigCount:SecurityConfigStats' :: SecurityConfigStats -> Maybe Integer
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
samlConfigCount

instance Prelude.NFData SecurityConfigStats where
  rnf :: SecurityConfigStats -> ()
rnf SecurityConfigStats' {Maybe Integer
samlConfigCount :: Maybe Integer
$sel:samlConfigCount:SecurityConfigStats' :: SecurityConfigStats -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
samlConfigCount