{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WorkMail.GetImpersonationRole
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the impersonation role details for the given WorkMail organization.
module Amazonka.WorkMail.GetImpersonationRole
  ( -- * Creating a Request
    GetImpersonationRole (..),
    newGetImpersonationRole,

    -- * Request Lenses
    getImpersonationRole_organizationId,
    getImpersonationRole_impersonationRoleId,

    -- * Destructuring the Response
    GetImpersonationRoleResponse (..),
    newGetImpersonationRoleResponse,

    -- * Response Lenses
    getImpersonationRoleResponse_dateCreated,
    getImpersonationRoleResponse_dateModified,
    getImpersonationRoleResponse_description,
    getImpersonationRoleResponse_impersonationRoleId,
    getImpersonationRoleResponse_name,
    getImpersonationRoleResponse_rules,
    getImpersonationRoleResponse_type,
    getImpersonationRoleResponse_httpStatus,
  )
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types

-- | /See:/ 'newGetImpersonationRole' smart constructor.
data GetImpersonationRole = GetImpersonationRole'
  { -- | The WorkMail organization from which to retrieve the impersonation role.
    GetImpersonationRole -> Text
organizationId :: Prelude.Text,
    -- | The impersonation role ID to retrieve.
    GetImpersonationRole -> Text
impersonationRoleId :: Prelude.Text
  }
  deriving (GetImpersonationRole -> GetImpersonationRole -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImpersonationRole -> GetImpersonationRole -> Bool
$c/= :: GetImpersonationRole -> GetImpersonationRole -> Bool
== :: GetImpersonationRole -> GetImpersonationRole -> Bool
$c== :: GetImpersonationRole -> GetImpersonationRole -> Bool
Prelude.Eq, ReadPrec [GetImpersonationRole]
ReadPrec GetImpersonationRole
Int -> ReadS GetImpersonationRole
ReadS [GetImpersonationRole]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImpersonationRole]
$creadListPrec :: ReadPrec [GetImpersonationRole]
readPrec :: ReadPrec GetImpersonationRole
$creadPrec :: ReadPrec GetImpersonationRole
readList :: ReadS [GetImpersonationRole]
$creadList :: ReadS [GetImpersonationRole]
readsPrec :: Int -> ReadS GetImpersonationRole
$creadsPrec :: Int -> ReadS GetImpersonationRole
Prelude.Read, Int -> GetImpersonationRole -> ShowS
[GetImpersonationRole] -> ShowS
GetImpersonationRole -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImpersonationRole] -> ShowS
$cshowList :: [GetImpersonationRole] -> ShowS
show :: GetImpersonationRole -> String
$cshow :: GetImpersonationRole -> String
showsPrec :: Int -> GetImpersonationRole -> ShowS
$cshowsPrec :: Int -> GetImpersonationRole -> ShowS
Prelude.Show, forall x. Rep GetImpersonationRole x -> GetImpersonationRole
forall x. GetImpersonationRole -> Rep GetImpersonationRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetImpersonationRole x -> GetImpersonationRole
$cfrom :: forall x. GetImpersonationRole -> Rep GetImpersonationRole x
Prelude.Generic)

-- |
-- Create a value of 'GetImpersonationRole' 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:
--
-- 'organizationId', 'getImpersonationRole_organizationId' - The WorkMail organization from which to retrieve the impersonation role.
--
-- 'impersonationRoleId', 'getImpersonationRole_impersonationRoleId' - The impersonation role ID to retrieve.
newGetImpersonationRole ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'impersonationRoleId'
  Prelude.Text ->
  GetImpersonationRole
newGetImpersonationRole :: Text -> Text -> GetImpersonationRole
newGetImpersonationRole
  Text
pOrganizationId_
  Text
pImpersonationRoleId_ =
    GetImpersonationRole'
      { $sel:organizationId:GetImpersonationRole' :: Text
organizationId =
          Text
pOrganizationId_,
        $sel:impersonationRoleId:GetImpersonationRole' :: Text
impersonationRoleId = Text
pImpersonationRoleId_
      }

-- | The WorkMail organization from which to retrieve the impersonation role.
getImpersonationRole_organizationId :: Lens.Lens' GetImpersonationRole Prelude.Text
getImpersonationRole_organizationId :: Lens' GetImpersonationRole Text
getImpersonationRole_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRole' {Text
organizationId :: Text
$sel:organizationId:GetImpersonationRole' :: GetImpersonationRole -> Text
organizationId} -> Text
organizationId) (\s :: GetImpersonationRole
s@GetImpersonationRole' {} Text
a -> GetImpersonationRole
s {$sel:organizationId:GetImpersonationRole' :: Text
organizationId = Text
a} :: GetImpersonationRole)

-- | The impersonation role ID to retrieve.
getImpersonationRole_impersonationRoleId :: Lens.Lens' GetImpersonationRole Prelude.Text
getImpersonationRole_impersonationRoleId :: Lens' GetImpersonationRole Text
getImpersonationRole_impersonationRoleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRole' {Text
impersonationRoleId :: Text
$sel:impersonationRoleId:GetImpersonationRole' :: GetImpersonationRole -> Text
impersonationRoleId} -> Text
impersonationRoleId) (\s :: GetImpersonationRole
s@GetImpersonationRole' {} Text
a -> GetImpersonationRole
s {$sel:impersonationRoleId:GetImpersonationRole' :: Text
impersonationRoleId = Text
a} :: GetImpersonationRole)

instance Core.AWSRequest GetImpersonationRole where
  type
    AWSResponse GetImpersonationRole =
      GetImpersonationRoleResponse
  request :: (Service -> Service)
-> GetImpersonationRole -> Request GetImpersonationRole
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetImpersonationRole
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetImpersonationRole)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ImpersonationRule]
-> Maybe ImpersonationRoleType
-> Int
-> GetImpersonationRoleResponse
GetImpersonationRoleResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DateCreated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DateModified")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"ImpersonationRoleId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Rules" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ 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 -> Either String (Maybe a)
Data..?> Key
"Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetImpersonationRole where
  hashWithSalt :: Int -> GetImpersonationRole -> Int
hashWithSalt Int
_salt GetImpersonationRole' {Text
impersonationRoleId :: Text
organizationId :: Text
$sel:impersonationRoleId:GetImpersonationRole' :: GetImpersonationRole -> Text
$sel:organizationId:GetImpersonationRole' :: GetImpersonationRole -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
impersonationRoleId

instance Prelude.NFData GetImpersonationRole where
  rnf :: GetImpersonationRole -> ()
rnf GetImpersonationRole' {Text
impersonationRoleId :: Text
organizationId :: Text
$sel:impersonationRoleId:GetImpersonationRole' :: GetImpersonationRole -> Text
$sel:organizationId:GetImpersonationRole' :: GetImpersonationRole -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
impersonationRoleId

instance Data.ToHeaders GetImpersonationRole where
  toHeaders :: GetImpersonationRole -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.GetImpersonationRole" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetImpersonationRole where
  toJSON :: GetImpersonationRole -> Value
toJSON GetImpersonationRole' {Text
impersonationRoleId :: Text
organizationId :: Text
$sel:impersonationRoleId:GetImpersonationRole' :: GetImpersonationRole -> Text
$sel:organizationId:GetImpersonationRole' :: GetImpersonationRole -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ImpersonationRoleId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
impersonationRoleId)
          ]
      )

instance Data.ToPath GetImpersonationRole where
  toPath :: GetImpersonationRole -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery GetImpersonationRole where
  toQuery :: GetImpersonationRole -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetImpersonationRoleResponse' smart constructor.
data GetImpersonationRoleResponse = GetImpersonationRoleResponse'
  { -- | The date when the impersonation role was created.
    GetImpersonationRoleResponse -> Maybe POSIX
dateCreated :: Prelude.Maybe Data.POSIX,
    -- | The date when the impersonation role was last modified.
    GetImpersonationRoleResponse -> Maybe POSIX
dateModified :: Prelude.Maybe Data.POSIX,
    -- | The impersonation role description.
    GetImpersonationRoleResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The impersonation role ID.
    GetImpersonationRoleResponse -> Maybe Text
impersonationRoleId :: Prelude.Maybe Prelude.Text,
    -- | The impersonation role name.
    GetImpersonationRoleResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The list of rules for the given impersonation role.
    GetImpersonationRoleResponse -> Maybe [ImpersonationRule]
rules :: Prelude.Maybe [ImpersonationRule],
    -- | The impersonation role type.
    GetImpersonationRoleResponse -> Maybe ImpersonationRoleType
type' :: Prelude.Maybe ImpersonationRoleType,
    -- | The response's http status code.
    GetImpersonationRoleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetImpersonationRoleResponse
-> GetImpersonationRoleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImpersonationRoleResponse
-> GetImpersonationRoleResponse -> Bool
$c/= :: GetImpersonationRoleResponse
-> GetImpersonationRoleResponse -> Bool
== :: GetImpersonationRoleResponse
-> GetImpersonationRoleResponse -> Bool
$c== :: GetImpersonationRoleResponse
-> GetImpersonationRoleResponse -> Bool
Prelude.Eq, ReadPrec [GetImpersonationRoleResponse]
ReadPrec GetImpersonationRoleResponse
Int -> ReadS GetImpersonationRoleResponse
ReadS [GetImpersonationRoleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImpersonationRoleResponse]
$creadListPrec :: ReadPrec [GetImpersonationRoleResponse]
readPrec :: ReadPrec GetImpersonationRoleResponse
$creadPrec :: ReadPrec GetImpersonationRoleResponse
readList :: ReadS [GetImpersonationRoleResponse]
$creadList :: ReadS [GetImpersonationRoleResponse]
readsPrec :: Int -> ReadS GetImpersonationRoleResponse
$creadsPrec :: Int -> ReadS GetImpersonationRoleResponse
Prelude.Read, Int -> GetImpersonationRoleResponse -> ShowS
[GetImpersonationRoleResponse] -> ShowS
GetImpersonationRoleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImpersonationRoleResponse] -> ShowS
$cshowList :: [GetImpersonationRoleResponse] -> ShowS
show :: GetImpersonationRoleResponse -> String
$cshow :: GetImpersonationRoleResponse -> String
showsPrec :: Int -> GetImpersonationRoleResponse -> ShowS
$cshowsPrec :: Int -> GetImpersonationRoleResponse -> ShowS
Prelude.Show, forall x.
Rep GetImpersonationRoleResponse x -> GetImpersonationRoleResponse
forall x.
GetImpersonationRoleResponse -> Rep GetImpersonationRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetImpersonationRoleResponse x -> GetImpersonationRoleResponse
$cfrom :: forall x.
GetImpersonationRoleResponse -> Rep GetImpersonationRoleResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetImpersonationRoleResponse' 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:
--
-- 'dateCreated', 'getImpersonationRoleResponse_dateCreated' - The date when the impersonation role was created.
--
-- 'dateModified', 'getImpersonationRoleResponse_dateModified' - The date when the impersonation role was last modified.
--
-- 'description', 'getImpersonationRoleResponse_description' - The impersonation role description.
--
-- 'impersonationRoleId', 'getImpersonationRoleResponse_impersonationRoleId' - The impersonation role ID.
--
-- 'name', 'getImpersonationRoleResponse_name' - The impersonation role name.
--
-- 'rules', 'getImpersonationRoleResponse_rules' - The list of rules for the given impersonation role.
--
-- 'type'', 'getImpersonationRoleResponse_type' - The impersonation role type.
--
-- 'httpStatus', 'getImpersonationRoleResponse_httpStatus' - The response's http status code.
newGetImpersonationRoleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetImpersonationRoleResponse
newGetImpersonationRoleResponse :: Int -> GetImpersonationRoleResponse
newGetImpersonationRoleResponse Int
pHttpStatus_ =
  GetImpersonationRoleResponse'
    { $sel:dateCreated:GetImpersonationRoleResponse' :: Maybe POSIX
dateCreated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dateModified:GetImpersonationRoleResponse' :: Maybe POSIX
dateModified = forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetImpersonationRoleResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:impersonationRoleId:GetImpersonationRoleResponse' :: Maybe Text
impersonationRoleId = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetImpersonationRoleResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:rules:GetImpersonationRoleResponse' :: Maybe [ImpersonationRule]
rules = forall a. Maybe a
Prelude.Nothing,
      $sel:type':GetImpersonationRoleResponse' :: Maybe ImpersonationRoleType
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetImpersonationRoleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date when the impersonation role was created.
getImpersonationRoleResponse_dateCreated :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe Prelude.UTCTime)
getImpersonationRoleResponse_dateCreated :: Lens' GetImpersonationRoleResponse (Maybe UTCTime)
getImpersonationRoleResponse_dateCreated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe POSIX
dateCreated :: Maybe POSIX
$sel:dateCreated:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe POSIX
dateCreated} -> Maybe POSIX
dateCreated) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe POSIX
a -> GetImpersonationRoleResponse
s {$sel:dateCreated:GetImpersonationRoleResponse' :: Maybe POSIX
dateCreated = Maybe POSIX
a} :: GetImpersonationRoleResponse) 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 date when the impersonation role was last modified.
getImpersonationRoleResponse_dateModified :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe Prelude.UTCTime)
getImpersonationRoleResponse_dateModified :: Lens' GetImpersonationRoleResponse (Maybe UTCTime)
getImpersonationRoleResponse_dateModified = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe POSIX
dateModified :: Maybe POSIX
$sel:dateModified:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe POSIX
dateModified} -> Maybe POSIX
dateModified) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe POSIX
a -> GetImpersonationRoleResponse
s {$sel:dateModified:GetImpersonationRoleResponse' :: Maybe POSIX
dateModified = Maybe POSIX
a} :: GetImpersonationRoleResponse) 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 impersonation role description.
getImpersonationRoleResponse_description :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe Prelude.Text)
getImpersonationRoleResponse_description :: Lens' GetImpersonationRoleResponse (Maybe Text)
getImpersonationRoleResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe Text
description :: Maybe Text
$sel:description:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe Text
a -> GetImpersonationRoleResponse
s {$sel:description:GetImpersonationRoleResponse' :: Maybe Text
description = Maybe Text
a} :: GetImpersonationRoleResponse)

-- | The impersonation role ID.
getImpersonationRoleResponse_impersonationRoleId :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe Prelude.Text)
getImpersonationRoleResponse_impersonationRoleId :: Lens' GetImpersonationRoleResponse (Maybe Text)
getImpersonationRoleResponse_impersonationRoleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe Text
impersonationRoleId :: Maybe Text
$sel:impersonationRoleId:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
impersonationRoleId} -> Maybe Text
impersonationRoleId) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe Text
a -> GetImpersonationRoleResponse
s {$sel:impersonationRoleId:GetImpersonationRoleResponse' :: Maybe Text
impersonationRoleId = Maybe Text
a} :: GetImpersonationRoleResponse)

-- | The impersonation role name.
getImpersonationRoleResponse_name :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe Prelude.Text)
getImpersonationRoleResponse_name :: Lens' GetImpersonationRoleResponse (Maybe Text)
getImpersonationRoleResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe Text
a -> GetImpersonationRoleResponse
s {$sel:name:GetImpersonationRoleResponse' :: Maybe Text
name = Maybe Text
a} :: GetImpersonationRoleResponse)

-- | The list of rules for the given impersonation role.
getImpersonationRoleResponse_rules :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe [ImpersonationRule])
getImpersonationRoleResponse_rules :: Lens' GetImpersonationRoleResponse (Maybe [ImpersonationRule])
getImpersonationRoleResponse_rules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe [ImpersonationRule]
rules :: Maybe [ImpersonationRule]
$sel:rules:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe [ImpersonationRule]
rules} -> Maybe [ImpersonationRule]
rules) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe [ImpersonationRule]
a -> GetImpersonationRoleResponse
s {$sel:rules:GetImpersonationRoleResponse' :: Maybe [ImpersonationRule]
rules = Maybe [ImpersonationRule]
a} :: GetImpersonationRoleResponse) 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 impersonation role type.
getImpersonationRoleResponse_type :: Lens.Lens' GetImpersonationRoleResponse (Prelude.Maybe ImpersonationRoleType)
getImpersonationRoleResponse_type :: Lens' GetImpersonationRoleResponse (Maybe ImpersonationRoleType)
getImpersonationRoleResponse_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Maybe ImpersonationRoleType
type' :: Maybe ImpersonationRoleType
$sel:type':GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe ImpersonationRoleType
type'} -> Maybe ImpersonationRoleType
type') (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Maybe ImpersonationRoleType
a -> GetImpersonationRoleResponse
s {$sel:type':GetImpersonationRoleResponse' :: Maybe ImpersonationRoleType
type' = Maybe ImpersonationRoleType
a} :: GetImpersonationRoleResponse)

-- | The response's http status code.
getImpersonationRoleResponse_httpStatus :: Lens.Lens' GetImpersonationRoleResponse Prelude.Int
getImpersonationRoleResponse_httpStatus :: Lens' GetImpersonationRoleResponse Int
getImpersonationRoleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImpersonationRoleResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetImpersonationRoleResponse
s@GetImpersonationRoleResponse' {} Int
a -> GetImpersonationRoleResponse
s {$sel:httpStatus:GetImpersonationRoleResponse' :: Int
httpStatus = Int
a} :: GetImpersonationRoleResponse)

instance Prelude.NFData GetImpersonationRoleResponse where
  rnf :: GetImpersonationRoleResponse -> ()
rnf GetImpersonationRoleResponse' {Int
Maybe [ImpersonationRule]
Maybe Text
Maybe POSIX
Maybe ImpersonationRoleType
httpStatus :: Int
type' :: Maybe ImpersonationRoleType
rules :: Maybe [ImpersonationRule]
name :: Maybe Text
impersonationRoleId :: Maybe Text
description :: Maybe Text
dateModified :: Maybe POSIX
dateCreated :: Maybe POSIX
$sel:httpStatus:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Int
$sel:type':GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe ImpersonationRoleType
$sel:rules:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe [ImpersonationRule]
$sel:name:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
$sel:impersonationRoleId:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
$sel:description:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe Text
$sel:dateModified:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe POSIX
$sel:dateCreated:GetImpersonationRoleResponse' :: GetImpersonationRoleResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
dateCreated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
dateModified
      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
impersonationRoleId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ImpersonationRule]
rules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImpersonationRoleType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus