{-# 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.EMR.Types.SessionMappingSummary
-- 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.EMR.Types.SessionMappingSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types.IdentityType
import qualified Amazonka.Prelude as Prelude

-- | Details for an Amazon EMR Studio session mapping. The details do not
-- include the time the session mapping was last modified.
--
-- /See:/ 'newSessionMappingSummary' smart constructor.
data SessionMappingSummary = SessionMappingSummary'
  { -- | The time the session mapping was created.
    SessionMappingSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The globally unique identifier (GUID) of the user or group from the IAM
    -- Identity Center Identity Store.
    SessionMappingSummary -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
    -- | The name of the user or group. For more information, see
    -- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName UserName>
    -- and
    -- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName DisplayName>
    -- in the /IAM Identity Center Identity Store API Reference/.
    SessionMappingSummary -> Maybe Text
identityName :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the identity mapped to the Amazon EMR Studio is a user
    -- or a group.
    SessionMappingSummary -> Maybe IdentityType
identityType :: Prelude.Maybe IdentityType,
    -- | The Amazon Resource Name (ARN) of the session policy associated with the
    -- user or group.
    SessionMappingSummary -> Maybe Text
sessionPolicyArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon EMR Studio.
    SessionMappingSummary -> Maybe Text
studioId :: Prelude.Maybe Prelude.Text
  }
  deriving (SessionMappingSummary -> SessionMappingSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionMappingSummary -> SessionMappingSummary -> Bool
$c/= :: SessionMappingSummary -> SessionMappingSummary -> Bool
== :: SessionMappingSummary -> SessionMappingSummary -> Bool
$c== :: SessionMappingSummary -> SessionMappingSummary -> Bool
Prelude.Eq, ReadPrec [SessionMappingSummary]
ReadPrec SessionMappingSummary
Int -> ReadS SessionMappingSummary
ReadS [SessionMappingSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionMappingSummary]
$creadListPrec :: ReadPrec [SessionMappingSummary]
readPrec :: ReadPrec SessionMappingSummary
$creadPrec :: ReadPrec SessionMappingSummary
readList :: ReadS [SessionMappingSummary]
$creadList :: ReadS [SessionMappingSummary]
readsPrec :: Int -> ReadS SessionMappingSummary
$creadsPrec :: Int -> ReadS SessionMappingSummary
Prelude.Read, Int -> SessionMappingSummary -> ShowS
[SessionMappingSummary] -> ShowS
SessionMappingSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionMappingSummary] -> ShowS
$cshowList :: [SessionMappingSummary] -> ShowS
show :: SessionMappingSummary -> String
$cshow :: SessionMappingSummary -> String
showsPrec :: Int -> SessionMappingSummary -> ShowS
$cshowsPrec :: Int -> SessionMappingSummary -> ShowS
Prelude.Show, forall x. Rep SessionMappingSummary x -> SessionMappingSummary
forall x. SessionMappingSummary -> Rep SessionMappingSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionMappingSummary x -> SessionMappingSummary
$cfrom :: forall x. SessionMappingSummary -> Rep SessionMappingSummary x
Prelude.Generic)

-- |
-- Create a value of 'SessionMappingSummary' 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:
--
-- 'creationTime', 'sessionMappingSummary_creationTime' - The time the session mapping was created.
--
-- 'identityId', 'sessionMappingSummary_identityId' - The globally unique identifier (GUID) of the user or group from the IAM
-- Identity Center Identity Store.
--
-- 'identityName', 'sessionMappingSummary_identityName' - The name of the user or group. For more information, see
-- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName UserName>
-- and
-- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName DisplayName>
-- in the /IAM Identity Center Identity Store API Reference/.
--
-- 'identityType', 'sessionMappingSummary_identityType' - Specifies whether the identity mapped to the Amazon EMR Studio is a user
-- or a group.
--
-- 'sessionPolicyArn', 'sessionMappingSummary_sessionPolicyArn' - The Amazon Resource Name (ARN) of the session policy associated with the
-- user or group.
--
-- 'studioId', 'sessionMappingSummary_studioId' - The ID of the Amazon EMR Studio.
newSessionMappingSummary ::
  SessionMappingSummary
newSessionMappingSummary :: SessionMappingSummary
newSessionMappingSummary =
  SessionMappingSummary'
    { $sel:creationTime:SessionMappingSummary' :: Maybe POSIX
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:SessionMappingSummary' :: Maybe Text
identityId = forall a. Maybe a
Prelude.Nothing,
      $sel:identityName:SessionMappingSummary' :: Maybe Text
identityName = forall a. Maybe a
Prelude.Nothing,
      $sel:identityType:SessionMappingSummary' :: Maybe IdentityType
identityType = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionPolicyArn:SessionMappingSummary' :: Maybe Text
sessionPolicyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:SessionMappingSummary' :: Maybe Text
studioId = forall a. Maybe a
Prelude.Nothing
    }

-- | The time the session mapping was created.
sessionMappingSummary_creationTime :: Lens.Lens' SessionMappingSummary (Prelude.Maybe Prelude.UTCTime)
sessionMappingSummary_creationTime :: Lens' SessionMappingSummary (Maybe UTCTime)
sessionMappingSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:SessionMappingSummary' :: SessionMappingSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe POSIX
a -> SessionMappingSummary
s {$sel:creationTime:SessionMappingSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: SessionMappingSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The globally unique identifier (GUID) of the user or group from the IAM
-- Identity Center Identity Store.
sessionMappingSummary_identityId :: Lens.Lens' SessionMappingSummary (Prelude.Maybe Prelude.Text)
sessionMappingSummary_identityId :: Lens' SessionMappingSummary (Maybe Text)
sessionMappingSummary_identityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe Text
identityId :: Maybe Text
$sel:identityId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe Text
a -> SessionMappingSummary
s {$sel:identityId:SessionMappingSummary' :: Maybe Text
identityId = Maybe Text
a} :: SessionMappingSummary)

-- | The name of the user or group. For more information, see
-- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName UserName>
-- and
-- <https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName DisplayName>
-- in the /IAM Identity Center Identity Store API Reference/.
sessionMappingSummary_identityName :: Lens.Lens' SessionMappingSummary (Prelude.Maybe Prelude.Text)
sessionMappingSummary_identityName :: Lens' SessionMappingSummary (Maybe Text)
sessionMappingSummary_identityName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe Text
identityName :: Maybe Text
$sel:identityName:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
identityName} -> Maybe Text
identityName) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe Text
a -> SessionMappingSummary
s {$sel:identityName:SessionMappingSummary' :: Maybe Text
identityName = Maybe Text
a} :: SessionMappingSummary)

-- | Specifies whether the identity mapped to the Amazon EMR Studio is a user
-- or a group.
sessionMappingSummary_identityType :: Lens.Lens' SessionMappingSummary (Prelude.Maybe IdentityType)
sessionMappingSummary_identityType :: Lens' SessionMappingSummary (Maybe IdentityType)
sessionMappingSummary_identityType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe IdentityType
identityType :: Maybe IdentityType
$sel:identityType:SessionMappingSummary' :: SessionMappingSummary -> Maybe IdentityType
identityType} -> Maybe IdentityType
identityType) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe IdentityType
a -> SessionMappingSummary
s {$sel:identityType:SessionMappingSummary' :: Maybe IdentityType
identityType = Maybe IdentityType
a} :: SessionMappingSummary)

-- | The Amazon Resource Name (ARN) of the session policy associated with the
-- user or group.
sessionMappingSummary_sessionPolicyArn :: Lens.Lens' SessionMappingSummary (Prelude.Maybe Prelude.Text)
sessionMappingSummary_sessionPolicyArn :: Lens' SessionMappingSummary (Maybe Text)
sessionMappingSummary_sessionPolicyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe Text
sessionPolicyArn :: Maybe Text
$sel:sessionPolicyArn:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
sessionPolicyArn} -> Maybe Text
sessionPolicyArn) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe Text
a -> SessionMappingSummary
s {$sel:sessionPolicyArn:SessionMappingSummary' :: Maybe Text
sessionPolicyArn = Maybe Text
a} :: SessionMappingSummary)

-- | The ID of the Amazon EMR Studio.
sessionMappingSummary_studioId :: Lens.Lens' SessionMappingSummary (Prelude.Maybe Prelude.Text)
sessionMappingSummary_studioId :: Lens' SessionMappingSummary (Maybe Text)
sessionMappingSummary_studioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionMappingSummary' {Maybe Text
studioId :: Maybe Text
$sel:studioId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
studioId} -> Maybe Text
studioId) (\s :: SessionMappingSummary
s@SessionMappingSummary' {} Maybe Text
a -> SessionMappingSummary
s {$sel:studioId:SessionMappingSummary' :: Maybe Text
studioId = Maybe Text
a} :: SessionMappingSummary)

instance Data.FromJSON SessionMappingSummary where
  parseJSON :: Value -> Parser SessionMappingSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SessionMappingSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> SessionMappingSummary
SessionMappingSummary'
            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
"CreationTime")
            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
"IdentityId")
            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
"IdentityName")
            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
"IdentityType")
            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
"SessionPolicyArn")
            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
"StudioId")
      )

instance Prelude.Hashable SessionMappingSummary where
  hashWithSalt :: Int -> SessionMappingSummary -> Int
hashWithSalt Int
_salt SessionMappingSummary' {Maybe Text
Maybe POSIX
Maybe IdentityType
studioId :: Maybe Text
sessionPolicyArn :: Maybe Text
identityType :: Maybe IdentityType
identityName :: Maybe Text
identityId :: Maybe Text
creationTime :: Maybe POSIX
$sel:studioId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:sessionPolicyArn:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:identityType:SessionMappingSummary' :: SessionMappingSummary -> Maybe IdentityType
$sel:identityName:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:identityId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:creationTime:SessionMappingSummary' :: SessionMappingSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IdentityType
identityType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sessionPolicyArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
studioId

instance Prelude.NFData SessionMappingSummary where
  rnf :: SessionMappingSummary -> ()
rnf SessionMappingSummary' {Maybe Text
Maybe POSIX
Maybe IdentityType
studioId :: Maybe Text
sessionPolicyArn :: Maybe Text
identityType :: Maybe IdentityType
identityName :: Maybe Text
identityId :: Maybe Text
creationTime :: Maybe POSIX
$sel:studioId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:sessionPolicyArn:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:identityType:SessionMappingSummary' :: SessionMappingSummary -> Maybe IdentityType
$sel:identityName:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:identityId:SessionMappingSummary' :: SessionMappingSummary -> Maybe Text
$sel:creationTime:SessionMappingSummary' :: SessionMappingSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentityType
identityType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sessionPolicyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
studioId