{-# 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.Connect.Types.SecurityProfile
-- 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.Connect.Types.SecurityProfile 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

-- | Contains information about a security profile.
--
-- /See:/ 'newSecurityProfile' smart constructor.
data SecurityProfile = SecurityProfile'
  { -- | The list of tags that a security profile uses to restrict access to
    -- resources in Amazon Connect.
    SecurityProfile -> Maybe (HashMap Text Text)
allowedAccessControlTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) for the secruity profile.
    SecurityProfile -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The description of the security profile.
    SecurityProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the security profile.
    SecurityProfile -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The organization resource identifier for the security profile.
    SecurityProfile -> Maybe Text
organizationResourceId :: Prelude.Maybe Prelude.Text,
    -- | The name for the security profile.
    SecurityProfile -> Maybe Text
securityProfileName :: Prelude.Maybe Prelude.Text,
    -- | The list of resources that a security profile applies tag restrictions
    -- to in Amazon Connect.
    SecurityProfile -> Maybe [Text]
tagRestrictedResources :: Prelude.Maybe [Prelude.Text],
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    SecurityProfile -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (SecurityProfile -> SecurityProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityProfile -> SecurityProfile -> Bool
$c/= :: SecurityProfile -> SecurityProfile -> Bool
== :: SecurityProfile -> SecurityProfile -> Bool
$c== :: SecurityProfile -> SecurityProfile -> Bool
Prelude.Eq, ReadPrec [SecurityProfile]
ReadPrec SecurityProfile
Int -> ReadS SecurityProfile
ReadS [SecurityProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityProfile]
$creadListPrec :: ReadPrec [SecurityProfile]
readPrec :: ReadPrec SecurityProfile
$creadPrec :: ReadPrec SecurityProfile
readList :: ReadS [SecurityProfile]
$creadList :: ReadS [SecurityProfile]
readsPrec :: Int -> ReadS SecurityProfile
$creadsPrec :: Int -> ReadS SecurityProfile
Prelude.Read, Int -> SecurityProfile -> ShowS
[SecurityProfile] -> ShowS
SecurityProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityProfile] -> ShowS
$cshowList :: [SecurityProfile] -> ShowS
show :: SecurityProfile -> String
$cshow :: SecurityProfile -> String
showsPrec :: Int -> SecurityProfile -> ShowS
$cshowsPrec :: Int -> SecurityProfile -> ShowS
Prelude.Show, forall x. Rep SecurityProfile x -> SecurityProfile
forall x. SecurityProfile -> Rep SecurityProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityProfile x -> SecurityProfile
$cfrom :: forall x. SecurityProfile -> Rep SecurityProfile x
Prelude.Generic)

-- |
-- Create a value of 'SecurityProfile' 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:
--
-- 'allowedAccessControlTags', 'securityProfile_allowedAccessControlTags' - The list of tags that a security profile uses to restrict access to
-- resources in Amazon Connect.
--
-- 'arn', 'securityProfile_arn' - The Amazon Resource Name (ARN) for the secruity profile.
--
-- 'description', 'securityProfile_description' - The description of the security profile.
--
-- 'id', 'securityProfile_id' - The identifier for the security profile.
--
-- 'organizationResourceId', 'securityProfile_organizationResourceId' - The organization resource identifier for the security profile.
--
-- 'securityProfileName', 'securityProfile_securityProfileName' - The name for the security profile.
--
-- 'tagRestrictedResources', 'securityProfile_tagRestrictedResources' - The list of resources that a security profile applies tag restrictions
-- to in Amazon Connect.
--
-- 'tags', 'securityProfile_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
newSecurityProfile ::
  SecurityProfile
newSecurityProfile :: SecurityProfile
newSecurityProfile =
  SecurityProfile'
    { $sel:allowedAccessControlTags:SecurityProfile' :: Maybe (HashMap Text Text)
allowedAccessControlTags =
        forall a. Maybe a
Prelude.Nothing,
      $sel:arn:SecurityProfile' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SecurityProfile' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:SecurityProfile' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationResourceId:SecurityProfile' :: Maybe Text
organizationResourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:SecurityProfile' :: Maybe Text
securityProfileName = forall a. Maybe a
Prelude.Nothing,
      $sel:tagRestrictedResources:SecurityProfile' :: Maybe [Text]
tagRestrictedResources = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SecurityProfile' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of tags that a security profile uses to restrict access to
-- resources in Amazon Connect.
securityProfile_allowedAccessControlTags :: Lens.Lens' SecurityProfile (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
securityProfile_allowedAccessControlTags :: Lens' SecurityProfile (Maybe (HashMap Text Text))
securityProfile_allowedAccessControlTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe (HashMap Text Text)
allowedAccessControlTags :: Maybe (HashMap Text Text)
$sel:allowedAccessControlTags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
allowedAccessControlTags} -> Maybe (HashMap Text Text)
allowedAccessControlTags) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe (HashMap Text Text)
a -> SecurityProfile
s {$sel:allowedAccessControlTags:SecurityProfile' :: Maybe (HashMap Text Text)
allowedAccessControlTags = Maybe (HashMap Text Text)
a} :: SecurityProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) for the secruity profile.
securityProfile_arn :: Lens.Lens' SecurityProfile (Prelude.Maybe Prelude.Text)
securityProfile_arn :: Lens' SecurityProfile (Maybe Text)
securityProfile_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe Text
arn :: Maybe Text
$sel:arn:SecurityProfile' :: SecurityProfile -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe Text
a -> SecurityProfile
s {$sel:arn:SecurityProfile' :: Maybe Text
arn = Maybe Text
a} :: SecurityProfile)

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

-- | The identifier for the security profile.
securityProfile_id :: Lens.Lens' SecurityProfile (Prelude.Maybe Prelude.Text)
securityProfile_id :: Lens' SecurityProfile (Maybe Text)
securityProfile_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe Text
id :: Maybe Text
$sel:id:SecurityProfile' :: SecurityProfile -> Maybe Text
id} -> Maybe Text
id) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe Text
a -> SecurityProfile
s {$sel:id:SecurityProfile' :: Maybe Text
id = Maybe Text
a} :: SecurityProfile)

-- | The organization resource identifier for the security profile.
securityProfile_organizationResourceId :: Lens.Lens' SecurityProfile (Prelude.Maybe Prelude.Text)
securityProfile_organizationResourceId :: Lens' SecurityProfile (Maybe Text)
securityProfile_organizationResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe Text
organizationResourceId :: Maybe Text
$sel:organizationResourceId:SecurityProfile' :: SecurityProfile -> Maybe Text
organizationResourceId} -> Maybe Text
organizationResourceId) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe Text
a -> SecurityProfile
s {$sel:organizationResourceId:SecurityProfile' :: Maybe Text
organizationResourceId = Maybe Text
a} :: SecurityProfile)

-- | The name for the security profile.
securityProfile_securityProfileName :: Lens.Lens' SecurityProfile (Prelude.Maybe Prelude.Text)
securityProfile_securityProfileName :: Lens' SecurityProfile (Maybe Text)
securityProfile_securityProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:SecurityProfile' :: SecurityProfile -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe Text
a -> SecurityProfile
s {$sel:securityProfileName:SecurityProfile' :: Maybe Text
securityProfileName = Maybe Text
a} :: SecurityProfile)

-- | The list of resources that a security profile applies tag restrictions
-- to in Amazon Connect.
securityProfile_tagRestrictedResources :: Lens.Lens' SecurityProfile (Prelude.Maybe [Prelude.Text])
securityProfile_tagRestrictedResources :: Lens' SecurityProfile (Maybe [Text])
securityProfile_tagRestrictedResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe [Text]
tagRestrictedResources :: Maybe [Text]
$sel:tagRestrictedResources:SecurityProfile' :: SecurityProfile -> Maybe [Text]
tagRestrictedResources} -> Maybe [Text]
tagRestrictedResources) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe [Text]
a -> SecurityProfile
s {$sel:tagRestrictedResources:SecurityProfile' :: Maybe [Text]
tagRestrictedResources = Maybe [Text]
a} :: SecurityProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
securityProfile_tags :: Lens.Lens' SecurityProfile (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
securityProfile_tags :: Lens' SecurityProfile (Maybe (HashMap Text Text))
securityProfile_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfile' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SecurityProfile
s@SecurityProfile' {} Maybe (HashMap Text Text)
a -> SecurityProfile
s {$sel:tags:SecurityProfile' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SecurityProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON SecurityProfile where
  parseJSON :: Value -> Parser SecurityProfile
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SecurityProfile"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> SecurityProfile
SecurityProfile'
            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
"AllowedAccessControlTags"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"Arn")
            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
"OrganizationResourceId")
            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
"SecurityProfileName")
            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
"TagRestrictedResources"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable SecurityProfile where
  hashWithSalt :: Int -> SecurityProfile -> Int
hashWithSalt Int
_salt SecurityProfile' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
tagRestrictedResources :: Maybe [Text]
securityProfileName :: Maybe Text
organizationResourceId :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
allowedAccessControlTags :: Maybe (HashMap Text Text)
$sel:tags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
$sel:tagRestrictedResources:SecurityProfile' :: SecurityProfile -> Maybe [Text]
$sel:securityProfileName:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:organizationResourceId:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:id:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:description:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:arn:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:allowedAccessControlTags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
allowedAccessControlTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      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 Text
organizationResourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityProfileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagRestrictedResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData SecurityProfile where
  rnf :: SecurityProfile -> ()
rnf SecurityProfile' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
tagRestrictedResources :: Maybe [Text]
securityProfileName :: Maybe Text
organizationResourceId :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
allowedAccessControlTags :: Maybe (HashMap Text Text)
$sel:tags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
$sel:tagRestrictedResources:SecurityProfile' :: SecurityProfile -> Maybe [Text]
$sel:securityProfileName:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:organizationResourceId:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:id:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:description:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:arn:SecurityProfile' :: SecurityProfile -> Maybe Text
$sel:allowedAccessControlTags:SecurityProfile' :: SecurityProfile -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
allowedAccessControlTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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 Text
organizationResourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagRestrictedResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags