{-# 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.SecurityConfigDetail
-- 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.SecurityConfigDetail 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.SamlConfigOptions
import Amazonka.OpenSearchServerless.Types.SecurityConfigType
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'SecurityConfigDetail' 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', 'securityConfigDetail_configVersion' - The version of the security configuration.
--
-- 'createdDate', 'securityConfigDetail_createdDate' - The date the configuration was created.
--
-- 'description', 'securityConfigDetail_description' - The description of the security configuration.
--
-- 'id', 'securityConfigDetail_id' - The unique identifier of the security configuration.
--
-- 'lastModifiedDate', 'securityConfigDetail_lastModifiedDate' - The timestamp of when the configuration was last modified.
--
-- 'samlOptions', 'securityConfigDetail_samlOptions' - SAML options for the security configuration in the form of a key-value
-- map.
--
-- 'type'', 'securityConfigDetail_type' - The type of security configuration.
newSecurityConfigDetail ::
  SecurityConfigDetail
newSecurityConfigDetail :: SecurityConfigDetail
newSecurityConfigDetail =
  SecurityConfigDetail'
    { $sel:configVersion:SecurityConfigDetail' :: Maybe Text
configVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:SecurityConfigDetail' :: Maybe Integer
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SecurityConfigDetail' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:SecurityConfigDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:SecurityConfigDetail' :: Maybe Integer
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:samlOptions:SecurityConfigDetail' :: Maybe SamlConfigOptions
samlOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:type':SecurityConfigDetail' :: Maybe SecurityConfigType
type' = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The date the configuration was created.
securityConfigDetail_createdDate :: Lens.Lens' SecurityConfigDetail (Prelude.Maybe Prelude.Integer)
securityConfigDetail_createdDate :: Lens' SecurityConfigDetail (Maybe Integer)
securityConfigDetail_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigDetail' {Maybe Integer
createdDate :: Maybe Integer
$sel:createdDate:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Integer
createdDate} -> Maybe Integer
createdDate) (\s :: SecurityConfigDetail
s@SecurityConfigDetail' {} Maybe Integer
a -> SecurityConfigDetail
s {$sel:createdDate:SecurityConfigDetail' :: Maybe Integer
createdDate = Maybe Integer
a} :: SecurityConfigDetail)

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

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

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

-- | SAML options for the security configuration in the form of a key-value
-- map.
securityConfigDetail_samlOptions :: Lens.Lens' SecurityConfigDetail (Prelude.Maybe SamlConfigOptions)
securityConfigDetail_samlOptions :: Lens' SecurityConfigDetail (Maybe SamlConfigOptions)
securityConfigDetail_samlOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigDetail' {Maybe SamlConfigOptions
samlOptions :: Maybe SamlConfigOptions
$sel:samlOptions:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe SamlConfigOptions
samlOptions} -> Maybe SamlConfigOptions
samlOptions) (\s :: SecurityConfigDetail
s@SecurityConfigDetail' {} Maybe SamlConfigOptions
a -> SecurityConfigDetail
s {$sel:samlOptions:SecurityConfigDetail' :: Maybe SamlConfigOptions
samlOptions = Maybe SamlConfigOptions
a} :: SecurityConfigDetail)

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

instance Data.FromJSON SecurityConfigDetail where
  parseJSON :: Value -> Parser SecurityConfigDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SecurityConfigDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe SamlConfigOptions
-> Maybe SecurityConfigType
-> SecurityConfigDetail
SecurityConfigDetail'
            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
"samlOptions")
            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 SecurityConfigDetail where
  hashWithSalt :: Int -> SecurityConfigDetail -> Int
hashWithSalt Int
_salt SecurityConfigDetail' {Maybe Integer
Maybe Text
Maybe SamlConfigOptions
Maybe SecurityConfigType
type' :: Maybe SecurityConfigType
samlOptions :: Maybe SamlConfigOptions
lastModifiedDate :: Maybe Integer
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
configVersion :: Maybe Text
$sel:type':SecurityConfigDetail' :: SecurityConfigDetail -> Maybe SecurityConfigType
$sel:samlOptions:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe SamlConfigOptions
$sel:lastModifiedDate:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Integer
$sel:id:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Text
$sel:description:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Text
$sel:createdDate:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Integer
$sel:configVersion:SecurityConfigDetail' :: SecurityConfigDetail -> 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 SamlConfigOptions
samlOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SecurityConfigType
type'

instance Prelude.NFData SecurityConfigDetail where
  rnf :: SecurityConfigDetail -> ()
rnf SecurityConfigDetail' {Maybe Integer
Maybe Text
Maybe SamlConfigOptions
Maybe SecurityConfigType
type' :: Maybe SecurityConfigType
samlOptions :: Maybe SamlConfigOptions
lastModifiedDate :: Maybe Integer
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
configVersion :: Maybe Text
$sel:type':SecurityConfigDetail' :: SecurityConfigDetail -> Maybe SecurityConfigType
$sel:samlOptions:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe SamlConfigOptions
$sel:lastModifiedDate:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Integer
$sel:id:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Text
$sel:description:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Text
$sel:createdDate:SecurityConfigDetail' :: SecurityConfigDetail -> Maybe Integer
$sel:configVersion:SecurityConfigDetail' :: SecurityConfigDetail -> 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 SamlConfigOptions
samlOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SecurityConfigType
type'