packages feed

amazonka-sts-2.0: gen/Amazonka/STS/Types/AssumedRoleUser.hs

{-# 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.STS.Types.AssumedRoleUser
-- 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.STS.Types.AssumedRoleUser 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

-- | The identifiers for the temporary security credentials that the
-- operation returns.
--
-- /See:/ 'newAssumedRoleUser' smart constructor.
data AssumedRoleUser = AssumedRoleUser'
  { -- | A unique identifier that contains the role ID and the role session name
    -- of the role that is being assumed. The role ID is generated by Amazon
    -- Web Services when the role is created.
    assumedRoleId :: Prelude.Text,
    -- | The ARN of the temporary security credentials that are returned from the
    -- AssumeRole action. For more information about ARNs and how to use them
    -- in policies, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html IAM Identifiers>
    -- in the /IAM User Guide/.
    arn :: Prelude.Text
  }
  deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)

-- |
-- Create a value of 'AssumedRoleUser' 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:
--
-- 'assumedRoleId', 'assumedRoleUser_assumedRoleId' - A unique identifier that contains the role ID and the role session name
-- of the role that is being assumed. The role ID is generated by Amazon
-- Web Services when the role is created.
--
-- 'arn', 'assumedRoleUser_arn' - The ARN of the temporary security credentials that are returned from the
-- AssumeRole action. For more information about ARNs and how to use them
-- in policies, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html IAM Identifiers>
-- in the /IAM User Guide/.
newAssumedRoleUser ::
  -- | 'assumedRoleId'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  AssumedRoleUser
newAssumedRoleUser pAssumedRoleId_ pArn_ =
  AssumedRoleUser'
    { assumedRoleId = pAssumedRoleId_,
      arn = pArn_
    }

-- | A unique identifier that contains the role ID and the role session name
-- of the role that is being assumed. The role ID is generated by Amazon
-- Web Services when the role is created.
assumedRoleUser_assumedRoleId :: Lens.Lens' AssumedRoleUser Prelude.Text
assumedRoleUser_assumedRoleId = Lens.lens (\AssumedRoleUser' {assumedRoleId} -> assumedRoleId) (\s@AssumedRoleUser' {} a -> s {assumedRoleId = a} :: AssumedRoleUser)

-- | The ARN of the temporary security credentials that are returned from the
-- AssumeRole action. For more information about ARNs and how to use them
-- in policies, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html IAM Identifiers>
-- in the /IAM User Guide/.
assumedRoleUser_arn :: Lens.Lens' AssumedRoleUser Prelude.Text
assumedRoleUser_arn = Lens.lens (\AssumedRoleUser' {arn} -> arn) (\s@AssumedRoleUser' {} a -> s {arn = a} :: AssumedRoleUser)

instance Data.FromXML AssumedRoleUser where
  parseXML x =
    AssumedRoleUser'
      Prelude.<$> (x Data..@ "AssumedRoleId")
      Prelude.<*> (x Data..@ "Arn")

instance Prelude.Hashable AssumedRoleUser where
  hashWithSalt _salt AssumedRoleUser' {..} =
    _salt
      `Prelude.hashWithSalt` assumedRoleId
      `Prelude.hashWithSalt` arn

instance Prelude.NFData AssumedRoleUser where
  rnf AssumedRoleUser' {..} =
    Prelude.rnf assumedRoleId
      `Prelude.seq` Prelude.rnf arn