{-# 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.SecurityConfigSummary
-- 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.SecurityConfigSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearchServerless.Types.SecurityConfigType
import qualified Amazonka.Prelude as Prelude

-- | A summary of a security configuration for OpenSearch Serverless.
--
-- /See:/ 'newSecurityConfigSummary' smart constructor.
data SecurityConfigSummary = SecurityConfigSummary'
  { -- | The version of the security configuration.
    SecurityConfigSummary -> Maybe Text
configVersion :: Prelude.Maybe Prelude.Text,
    -- | The Epoch time when the security configuration was created.
    SecurityConfigSummary -> Maybe Integer
createdDate :: Prelude.Maybe Prelude.Integer,
    -- | The description of the security configuration.
    SecurityConfigSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the security configuration.
    SecurityConfigSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the configuration was last modified.
    SecurityConfigSummary -> Maybe Integer
lastModifiedDate :: Prelude.Maybe Prelude.Integer,
    -- | The type of security configuration.
    SecurityConfigSummary -> Maybe SecurityConfigType
type' :: Prelude.Maybe SecurityConfigType
  }
  deriving (SecurityConfigSummary -> SecurityConfigSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityConfigSummary -> SecurityConfigSummary -> Bool
$c/= :: SecurityConfigSummary -> SecurityConfigSummary -> Bool
== :: SecurityConfigSummary -> SecurityConfigSummary -> Bool
$c== :: SecurityConfigSummary -> SecurityConfigSummary -> Bool
Prelude.Eq, ReadPrec [SecurityConfigSummary]
ReadPrec SecurityConfigSummary
Int -> ReadS SecurityConfigSummary
ReadS [SecurityConfigSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityConfigSummary]
$creadListPrec :: ReadPrec [SecurityConfigSummary]
readPrec :: ReadPrec SecurityConfigSummary
$creadPrec :: ReadPrec SecurityConfigSummary
readList :: ReadS [SecurityConfigSummary]
$creadList :: ReadS [SecurityConfigSummary]
readsPrec :: Int -> ReadS SecurityConfigSummary
$creadsPrec :: Int -> ReadS SecurityConfigSummary
Prelude.Read, Int -> SecurityConfigSummary -> ShowS
[SecurityConfigSummary] -> ShowS
SecurityConfigSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityConfigSummary] -> ShowS
$cshowList :: [SecurityConfigSummary] -> ShowS
show :: SecurityConfigSummary -> String
$cshow :: SecurityConfigSummary -> String
showsPrec :: Int -> SecurityConfigSummary -> ShowS
$cshowsPrec :: Int -> SecurityConfigSummary -> ShowS
Prelude.Show, forall x. Rep SecurityConfigSummary x -> SecurityConfigSummary
forall x. SecurityConfigSummary -> Rep SecurityConfigSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityConfigSummary x -> SecurityConfigSummary
$cfrom :: forall x. SecurityConfigSummary -> Rep SecurityConfigSummary x
Prelude.Generic)

-- |
-- Create a value of 'SecurityConfigSummary' 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:
--
-- 'configVersion', 'securityConfigSummary_configVersion' - The version of the security configuration.
--
-- 'createdDate', 'securityConfigSummary_createdDate' - The Epoch time when the security configuration was created.
--
-- 'description', 'securityConfigSummary_description' - The description of the security configuration.
--
-- 'id', 'securityConfigSummary_id' - The unique identifier of the security configuration.
--
-- 'lastModifiedDate', 'securityConfigSummary_lastModifiedDate' - The timestamp of when the configuration was last modified.
--
-- 'type'', 'securityConfigSummary_type' - The type of security configuration.
newSecurityConfigSummary ::
  SecurityConfigSummary
newSecurityConfigSummary :: SecurityConfigSummary
newSecurityConfigSummary =
  SecurityConfigSummary'
    { $sel:configVersion:SecurityConfigSummary' :: Maybe Text
configVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:SecurityConfigSummary' :: Maybe Integer
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SecurityConfigSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:SecurityConfigSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:SecurityConfigSummary' :: Maybe Integer
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:type':SecurityConfigSummary' :: Maybe SecurityConfigType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The version of the security configuration.
securityConfigSummary_configVersion :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe Prelude.Text)
securityConfigSummary_configVersion :: Lens' SecurityConfigSummary (Maybe Text)
securityConfigSummary_configVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe Text
configVersion :: Maybe Text
$sel:configVersion:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
configVersion} -> Maybe Text
configVersion) (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe Text
a -> SecurityConfigSummary
s {$sel:configVersion:SecurityConfigSummary' :: Maybe Text
configVersion = Maybe Text
a} :: SecurityConfigSummary)

-- | The Epoch time when the security configuration was created.
securityConfigSummary_createdDate :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe Prelude.Integer)
securityConfigSummary_createdDate :: Lens' SecurityConfigSummary (Maybe Integer)
securityConfigSummary_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe Integer
createdDate :: Maybe Integer
$sel:createdDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
createdDate} -> Maybe Integer
createdDate) (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe Integer
a -> SecurityConfigSummary
s {$sel:createdDate:SecurityConfigSummary' :: Maybe Integer
createdDate = Maybe Integer
a} :: SecurityConfigSummary)

-- | The description of the security configuration.
securityConfigSummary_description :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe Prelude.Text)
securityConfigSummary_description :: Lens' SecurityConfigSummary (Maybe Text)
securityConfigSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe Text
description :: Maybe Text
$sel:description:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe Text
a -> SecurityConfigSummary
s {$sel:description:SecurityConfigSummary' :: Maybe Text
description = Maybe Text
a} :: SecurityConfigSummary)

-- | The unique identifier of the security configuration.
securityConfigSummary_id :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe Prelude.Text)
securityConfigSummary_id :: Lens' SecurityConfigSummary (Maybe Text)
securityConfigSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe Text
id :: Maybe Text
$sel:id:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe Text
a -> SecurityConfigSummary
s {$sel:id:SecurityConfigSummary' :: Maybe Text
id = Maybe Text
a} :: SecurityConfigSummary)

-- | The timestamp of when the configuration was last modified.
securityConfigSummary_lastModifiedDate :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe Prelude.Integer)
securityConfigSummary_lastModifiedDate :: Lens' SecurityConfigSummary (Maybe Integer)
securityConfigSummary_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe Integer
lastModifiedDate :: Maybe Integer
$sel:lastModifiedDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
lastModifiedDate} -> Maybe Integer
lastModifiedDate) (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe Integer
a -> SecurityConfigSummary
s {$sel:lastModifiedDate:SecurityConfigSummary' :: Maybe Integer
lastModifiedDate = Maybe Integer
a} :: SecurityConfigSummary)

-- | The type of security configuration.
securityConfigSummary_type :: Lens.Lens' SecurityConfigSummary (Prelude.Maybe SecurityConfigType)
securityConfigSummary_type :: Lens' SecurityConfigSummary (Maybe SecurityConfigType)
securityConfigSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigSummary' {Maybe SecurityConfigType
type' :: Maybe SecurityConfigType
$sel:type':SecurityConfigSummary' :: SecurityConfigSummary -> Maybe SecurityConfigType
type'} -> Maybe SecurityConfigType
type') (\s :: SecurityConfigSummary
s@SecurityConfigSummary' {} Maybe SecurityConfigType
a -> SecurityConfigSummary
s {$sel:type':SecurityConfigSummary' :: Maybe SecurityConfigType
type' = Maybe SecurityConfigType
a} :: SecurityConfigSummary)

instance Data.FromJSON SecurityConfigSummary where
  parseJSON :: Value -> Parser SecurityConfigSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SecurityConfigSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe SecurityConfigType
-> SecurityConfigSummary
SecurityConfigSummary'
            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
"configVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastModifiedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
      )

instance Prelude.Hashable SecurityConfigSummary where
  hashWithSalt :: Int -> SecurityConfigSummary -> Int
hashWithSalt Int
_salt SecurityConfigSummary' {Maybe Integer
Maybe Text
Maybe SecurityConfigType
type' :: Maybe SecurityConfigType
lastModifiedDate :: Maybe Integer
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
configVersion :: Maybe Text
$sel:type':SecurityConfigSummary' :: SecurityConfigSummary -> Maybe SecurityConfigType
$sel:lastModifiedDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
$sel:id:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
$sel:description:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
$sel:createdDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
$sel:configVersion:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SecurityConfigType
type'

instance Prelude.NFData SecurityConfigSummary where
  rnf :: SecurityConfigSummary -> ()
rnf SecurityConfigSummary' {Maybe Integer
Maybe Text
Maybe SecurityConfigType
type' :: Maybe SecurityConfigType
lastModifiedDate :: Maybe Integer
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
configVersion :: Maybe Text
$sel:type':SecurityConfigSummary' :: SecurityConfigSummary -> Maybe SecurityConfigType
$sel:lastModifiedDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
$sel:id:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
$sel:description:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
$sel:createdDate:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Integer
$sel:configVersion:SecurityConfigSummary' :: SecurityConfigSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SecurityConfigType
type'