{-# 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.SSOAdmin.Types.PermissionSetProvisioningStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSOAdmin.Types.PermissionSetProvisioningStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSOAdmin.Types.StatusValues

-- | A structure that is used to provide the status of the provisioning
-- operation for a specified permission set.
--
-- /See:/ 'newPermissionSetProvisioningStatus' smart constructor.
data PermissionSetProvisioningStatus = PermissionSetProvisioningStatus'
  { -- | The identifier for tracking the request operation that is generated by
    -- the universally unique identifier (UUID) workflow.
    PermissionSetProvisioningStatus -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The status of the permission set provisioning process.
    PermissionSetProvisioningStatus -> Maybe StatusValues
status :: Prelude.Maybe StatusValues,
    -- | The message that contains an error or exception in case of an operation
    -- failure.
    PermissionSetProvisioningStatus -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon Web Services account from which to list the
    -- assignments.
    PermissionSetProvisioningStatus -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The date that the permission set was created.
    PermissionSetProvisioningStatus -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the permission set that is being provisioned. For more
    -- information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
    -- in the /Amazon Web Services General Reference/.
    PermissionSetProvisioningStatus -> Maybe Text
permissionSetArn :: Prelude.Maybe Prelude.Text
  }
  deriving (PermissionSetProvisioningStatus
-> PermissionSetProvisioningStatus -> Bool
(PermissionSetProvisioningStatus
 -> PermissionSetProvisioningStatus -> Bool)
-> (PermissionSetProvisioningStatus
    -> PermissionSetProvisioningStatus -> Bool)
-> Eq PermissionSetProvisioningStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PermissionSetProvisioningStatus
-> PermissionSetProvisioningStatus -> Bool
$c/= :: PermissionSetProvisioningStatus
-> PermissionSetProvisioningStatus -> Bool
== :: PermissionSetProvisioningStatus
-> PermissionSetProvisioningStatus -> Bool
$c== :: PermissionSetProvisioningStatus
-> PermissionSetProvisioningStatus -> Bool
Prelude.Eq, ReadPrec [PermissionSetProvisioningStatus]
ReadPrec PermissionSetProvisioningStatus
Int -> ReadS PermissionSetProvisioningStatus
ReadS [PermissionSetProvisioningStatus]
(Int -> ReadS PermissionSetProvisioningStatus)
-> ReadS [PermissionSetProvisioningStatus]
-> ReadPrec PermissionSetProvisioningStatus
-> ReadPrec [PermissionSetProvisioningStatus]
-> Read PermissionSetProvisioningStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PermissionSetProvisioningStatus]
$creadListPrec :: ReadPrec [PermissionSetProvisioningStatus]
readPrec :: ReadPrec PermissionSetProvisioningStatus
$creadPrec :: ReadPrec PermissionSetProvisioningStatus
readList :: ReadS [PermissionSetProvisioningStatus]
$creadList :: ReadS [PermissionSetProvisioningStatus]
readsPrec :: Int -> ReadS PermissionSetProvisioningStatus
$creadsPrec :: Int -> ReadS PermissionSetProvisioningStatus
Prelude.Read, Int -> PermissionSetProvisioningStatus -> ShowS
[PermissionSetProvisioningStatus] -> ShowS
PermissionSetProvisioningStatus -> String
(Int -> PermissionSetProvisioningStatus -> ShowS)
-> (PermissionSetProvisioningStatus -> String)
-> ([PermissionSetProvisioningStatus] -> ShowS)
-> Show PermissionSetProvisioningStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PermissionSetProvisioningStatus] -> ShowS
$cshowList :: [PermissionSetProvisioningStatus] -> ShowS
show :: PermissionSetProvisioningStatus -> String
$cshow :: PermissionSetProvisioningStatus -> String
showsPrec :: Int -> PermissionSetProvisioningStatus -> ShowS
$cshowsPrec :: Int -> PermissionSetProvisioningStatus -> ShowS
Prelude.Show, (forall x.
 PermissionSetProvisioningStatus
 -> Rep PermissionSetProvisioningStatus x)
-> (forall x.
    Rep PermissionSetProvisioningStatus x
    -> PermissionSetProvisioningStatus)
-> Generic PermissionSetProvisioningStatus
forall x.
Rep PermissionSetProvisioningStatus x
-> PermissionSetProvisioningStatus
forall x.
PermissionSetProvisioningStatus
-> Rep PermissionSetProvisioningStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PermissionSetProvisioningStatus x
-> PermissionSetProvisioningStatus
$cfrom :: forall x.
PermissionSetProvisioningStatus
-> Rep PermissionSetProvisioningStatus x
Prelude.Generic)

-- |
-- Create a value of 'PermissionSetProvisioningStatus' 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:
--
-- 'requestId', 'permissionSetProvisioningStatus_requestId' - The identifier for tracking the request operation that is generated by
-- the universally unique identifier (UUID) workflow.
--
-- 'status', 'permissionSetProvisioningStatus_status' - The status of the permission set provisioning process.
--
-- 'failureReason', 'permissionSetProvisioningStatus_failureReason' - The message that contains an error or exception in case of an operation
-- failure.
--
-- 'accountId', 'permissionSetProvisioningStatus_accountId' - The identifier of the Amazon Web Services account from which to list the
-- assignments.
--
-- 'createdDate', 'permissionSetProvisioningStatus_createdDate' - The date that the permission set was created.
--
-- 'permissionSetArn', 'permissionSetProvisioningStatus_permissionSetArn' - The ARN of the permission set that is being provisioned. For more
-- information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
newPermissionSetProvisioningStatus ::
  PermissionSetProvisioningStatus
newPermissionSetProvisioningStatus :: PermissionSetProvisioningStatus
newPermissionSetProvisioningStatus =
  PermissionSetProvisioningStatus' :: Maybe Text
-> Maybe StatusValues
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> PermissionSetProvisioningStatus
PermissionSetProvisioningStatus'
    { $sel:requestId:PermissionSetProvisioningStatus' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:PermissionSetProvisioningStatus' :: Maybe StatusValues
status = Maybe StatusValues
forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:PermissionSetProvisioningStatus' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:PermissionSetProvisioningStatus' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:PermissionSetProvisioningStatus' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionSetArn:PermissionSetProvisioningStatus' :: Maybe Text
permissionSetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier for tracking the request operation that is generated by
-- the universally unique identifier (UUID) workflow.
permissionSetProvisioningStatus_requestId :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe Prelude.Text)
permissionSetProvisioningStatus_requestId :: (Maybe Text -> f (Maybe Text))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_requestId = (PermissionSetProvisioningStatus -> Maybe Text)
-> (PermissionSetProvisioningStatus
    -> Maybe Text -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe Text
requestId :: Maybe Text
$sel:requestId:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe Text
a -> PermissionSetProvisioningStatus
s {$sel:requestId:PermissionSetProvisioningStatus' :: Maybe Text
requestId = Maybe Text
a} :: PermissionSetProvisioningStatus)

-- | The status of the permission set provisioning process.
permissionSetProvisioningStatus_status :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe StatusValues)
permissionSetProvisioningStatus_status :: (Maybe StatusValues -> f (Maybe StatusValues))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_status = (PermissionSetProvisioningStatus -> Maybe StatusValues)
-> (PermissionSetProvisioningStatus
    -> Maybe StatusValues -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe StatusValues)
     (Maybe StatusValues)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe StatusValues
status :: Maybe StatusValues
$sel:status:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe StatusValues
status} -> Maybe StatusValues
status) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe StatusValues
a -> PermissionSetProvisioningStatus
s {$sel:status:PermissionSetProvisioningStatus' :: Maybe StatusValues
status = Maybe StatusValues
a} :: PermissionSetProvisioningStatus)

-- | The message that contains an error or exception in case of an operation
-- failure.
permissionSetProvisioningStatus_failureReason :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe Prelude.Text)
permissionSetProvisioningStatus_failureReason :: (Maybe Text -> f (Maybe Text))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_failureReason = (PermissionSetProvisioningStatus -> Maybe Text)
-> (PermissionSetProvisioningStatus
    -> Maybe Text -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe Text
a -> PermissionSetProvisioningStatus
s {$sel:failureReason:PermissionSetProvisioningStatus' :: Maybe Text
failureReason = Maybe Text
a} :: PermissionSetProvisioningStatus)

-- | The identifier of the Amazon Web Services account from which to list the
-- assignments.
permissionSetProvisioningStatus_accountId :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe Prelude.Text)
permissionSetProvisioningStatus_accountId :: (Maybe Text -> f (Maybe Text))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_accountId = (PermissionSetProvisioningStatus -> Maybe Text)
-> (PermissionSetProvisioningStatus
    -> Maybe Text -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe Text
accountId :: Maybe Text
$sel:accountId:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe Text
a -> PermissionSetProvisioningStatus
s {$sel:accountId:PermissionSetProvisioningStatus' :: Maybe Text
accountId = Maybe Text
a} :: PermissionSetProvisioningStatus)

-- | The date that the permission set was created.
permissionSetProvisioningStatus_createdDate :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe Prelude.UTCTime)
permissionSetProvisioningStatus_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_createdDate = (PermissionSetProvisioningStatus -> Maybe POSIX)
-> (PermissionSetProvisioningStatus
    -> Maybe POSIX -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe POSIX
a -> PermissionSetProvisioningStatus
s {$sel:createdDate:PermissionSetProvisioningStatus' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: PermissionSetProvisioningStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> PermissionSetProvisioningStatus
 -> f PermissionSetProvisioningStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the permission set that is being provisioned. For more
-- information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
permissionSetProvisioningStatus_permissionSetArn :: Lens.Lens' PermissionSetProvisioningStatus (Prelude.Maybe Prelude.Text)
permissionSetProvisioningStatus_permissionSetArn :: (Maybe Text -> f (Maybe Text))
-> PermissionSetProvisioningStatus
-> f PermissionSetProvisioningStatus
permissionSetProvisioningStatus_permissionSetArn = (PermissionSetProvisioningStatus -> Maybe Text)
-> (PermissionSetProvisioningStatus
    -> Maybe Text -> PermissionSetProvisioningStatus)
-> Lens
     PermissionSetProvisioningStatus
     PermissionSetProvisioningStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PermissionSetProvisioningStatus' {Maybe Text
permissionSetArn :: Maybe Text
$sel:permissionSetArn:PermissionSetProvisioningStatus' :: PermissionSetProvisioningStatus -> Maybe Text
permissionSetArn} -> Maybe Text
permissionSetArn) (\s :: PermissionSetProvisioningStatus
s@PermissionSetProvisioningStatus' {} Maybe Text
a -> PermissionSetProvisioningStatus
s {$sel:permissionSetArn:PermissionSetProvisioningStatus' :: Maybe Text
permissionSetArn = Maybe Text
a} :: PermissionSetProvisioningStatus)

instance
  Core.FromJSON
    PermissionSetProvisioningStatus
  where
  parseJSON :: Value -> Parser PermissionSetProvisioningStatus
parseJSON =
    String
-> (Object -> Parser PermissionSetProvisioningStatus)
-> Value
-> Parser PermissionSetProvisioningStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PermissionSetProvisioningStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe StatusValues
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> PermissionSetProvisioningStatus
PermissionSetProvisioningStatus'
            (Maybe Text
 -> Maybe StatusValues
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> PermissionSetProvisioningStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe StatusValues
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> PermissionSetProvisioningStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestId")
            Parser
  (Maybe StatusValues
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> PermissionSetProvisioningStatus)
-> Parser (Maybe StatusValues)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> PermissionSetProvisioningStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StatusValues)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> PermissionSetProvisioningStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> PermissionSetProvisioningStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureReason")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> PermissionSetProvisioningStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> PermissionSetProvisioningStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccountId")
            Parser
  (Maybe POSIX -> Maybe Text -> PermissionSetProvisioningStatus)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> PermissionSetProvisioningStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedDate")
            Parser (Maybe Text -> PermissionSetProvisioningStatus)
-> Parser (Maybe Text) -> Parser PermissionSetProvisioningStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PermissionSetArn")
      )

instance
  Prelude.Hashable
    PermissionSetProvisioningStatus

instance
  Prelude.NFData
    PermissionSetProvisioningStatus