{-# 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.AccountAssignmentOperationStatusMetadata
-- 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.AccountAssignmentOperationStatusMetadata where

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

-- | Provides information about the AccountAssignment creation request.
--
-- /See:/ 'newAccountAssignmentOperationStatusMetadata' smart constructor.
data AccountAssignmentOperationStatusMetadata = AccountAssignmentOperationStatusMetadata'
  { -- | The identifier for tracking the request operation that is generated by
    -- the universally unique identifier (UUID) workflow.
    AccountAssignmentOperationStatusMetadata -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The status of the permission set provisioning process.
    AccountAssignmentOperationStatusMetadata -> Maybe StatusValues
status :: Prelude.Maybe StatusValues,
    -- | The date that the permission set was created.
    AccountAssignmentOperationStatusMetadata -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX
  }
  deriving (AccountAssignmentOperationStatusMetadata
-> AccountAssignmentOperationStatusMetadata -> Bool
(AccountAssignmentOperationStatusMetadata
 -> AccountAssignmentOperationStatusMetadata -> Bool)
-> (AccountAssignmentOperationStatusMetadata
    -> AccountAssignmentOperationStatusMetadata -> Bool)
-> Eq AccountAssignmentOperationStatusMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountAssignmentOperationStatusMetadata
-> AccountAssignmentOperationStatusMetadata -> Bool
$c/= :: AccountAssignmentOperationStatusMetadata
-> AccountAssignmentOperationStatusMetadata -> Bool
== :: AccountAssignmentOperationStatusMetadata
-> AccountAssignmentOperationStatusMetadata -> Bool
$c== :: AccountAssignmentOperationStatusMetadata
-> AccountAssignmentOperationStatusMetadata -> Bool
Prelude.Eq, ReadPrec [AccountAssignmentOperationStatusMetadata]
ReadPrec AccountAssignmentOperationStatusMetadata
Int -> ReadS AccountAssignmentOperationStatusMetadata
ReadS [AccountAssignmentOperationStatusMetadata]
(Int -> ReadS AccountAssignmentOperationStatusMetadata)
-> ReadS [AccountAssignmentOperationStatusMetadata]
-> ReadPrec AccountAssignmentOperationStatusMetadata
-> ReadPrec [AccountAssignmentOperationStatusMetadata]
-> Read AccountAssignmentOperationStatusMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountAssignmentOperationStatusMetadata]
$creadListPrec :: ReadPrec [AccountAssignmentOperationStatusMetadata]
readPrec :: ReadPrec AccountAssignmentOperationStatusMetadata
$creadPrec :: ReadPrec AccountAssignmentOperationStatusMetadata
readList :: ReadS [AccountAssignmentOperationStatusMetadata]
$creadList :: ReadS [AccountAssignmentOperationStatusMetadata]
readsPrec :: Int -> ReadS AccountAssignmentOperationStatusMetadata
$creadsPrec :: Int -> ReadS AccountAssignmentOperationStatusMetadata
Prelude.Read, Int -> AccountAssignmentOperationStatusMetadata -> ShowS
[AccountAssignmentOperationStatusMetadata] -> ShowS
AccountAssignmentOperationStatusMetadata -> String
(Int -> AccountAssignmentOperationStatusMetadata -> ShowS)
-> (AccountAssignmentOperationStatusMetadata -> String)
-> ([AccountAssignmentOperationStatusMetadata] -> ShowS)
-> Show AccountAssignmentOperationStatusMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountAssignmentOperationStatusMetadata] -> ShowS
$cshowList :: [AccountAssignmentOperationStatusMetadata] -> ShowS
show :: AccountAssignmentOperationStatusMetadata -> String
$cshow :: AccountAssignmentOperationStatusMetadata -> String
showsPrec :: Int -> AccountAssignmentOperationStatusMetadata -> ShowS
$cshowsPrec :: Int -> AccountAssignmentOperationStatusMetadata -> ShowS
Prelude.Show, (forall x.
 AccountAssignmentOperationStatusMetadata
 -> Rep AccountAssignmentOperationStatusMetadata x)
-> (forall x.
    Rep AccountAssignmentOperationStatusMetadata x
    -> AccountAssignmentOperationStatusMetadata)
-> Generic AccountAssignmentOperationStatusMetadata
forall x.
Rep AccountAssignmentOperationStatusMetadata x
-> AccountAssignmentOperationStatusMetadata
forall x.
AccountAssignmentOperationStatusMetadata
-> Rep AccountAssignmentOperationStatusMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AccountAssignmentOperationStatusMetadata x
-> AccountAssignmentOperationStatusMetadata
$cfrom :: forall x.
AccountAssignmentOperationStatusMetadata
-> Rep AccountAssignmentOperationStatusMetadata x
Prelude.Generic)

-- |
-- Create a value of 'AccountAssignmentOperationStatusMetadata' 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', 'accountAssignmentOperationStatusMetadata_requestId' - The identifier for tracking the request operation that is generated by
-- the universally unique identifier (UUID) workflow.
--
-- 'status', 'accountAssignmentOperationStatusMetadata_status' - The status of the permission set provisioning process.
--
-- 'createdDate', 'accountAssignmentOperationStatusMetadata_createdDate' - The date that the permission set was created.
newAccountAssignmentOperationStatusMetadata ::
  AccountAssignmentOperationStatusMetadata
newAccountAssignmentOperationStatusMetadata :: AccountAssignmentOperationStatusMetadata
newAccountAssignmentOperationStatusMetadata =
  AccountAssignmentOperationStatusMetadata' :: Maybe Text
-> Maybe StatusValues
-> Maybe POSIX
-> AccountAssignmentOperationStatusMetadata
AccountAssignmentOperationStatusMetadata'
    { $sel:requestId:AccountAssignmentOperationStatusMetadata' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:AccountAssignmentOperationStatusMetadata' :: Maybe StatusValues
status = Maybe StatusValues
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:AccountAssignmentOperationStatusMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The date that the permission set was created.
accountAssignmentOperationStatusMetadata_createdDate :: Lens.Lens' AccountAssignmentOperationStatusMetadata (Prelude.Maybe Prelude.UTCTime)
accountAssignmentOperationStatusMetadata_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AccountAssignmentOperationStatusMetadata
-> f AccountAssignmentOperationStatusMetadata
accountAssignmentOperationStatusMetadata_createdDate = (AccountAssignmentOperationStatusMetadata -> Maybe POSIX)
-> (AccountAssignmentOperationStatusMetadata
    -> Maybe POSIX -> AccountAssignmentOperationStatusMetadata)
-> Lens
     AccountAssignmentOperationStatusMetadata
     AccountAssignmentOperationStatusMetadata
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssignmentOperationStatusMetadata' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:AccountAssignmentOperationStatusMetadata' :: AccountAssignmentOperationStatusMetadata -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: AccountAssignmentOperationStatusMetadata
s@AccountAssignmentOperationStatusMetadata' {} Maybe POSIX
a -> AccountAssignmentOperationStatusMetadata
s {$sel:createdDate:AccountAssignmentOperationStatusMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: AccountAssignmentOperationStatusMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> AccountAssignmentOperationStatusMetadata
 -> f AccountAssignmentOperationStatusMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AccountAssignmentOperationStatusMetadata
-> f AccountAssignmentOperationStatusMetadata
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

instance
  Core.FromJSON
    AccountAssignmentOperationStatusMetadata
  where
  parseJSON :: Value -> Parser AccountAssignmentOperationStatusMetadata
parseJSON =
    String
-> (Object -> Parser AccountAssignmentOperationStatusMetadata)
-> Value
-> Parser AccountAssignmentOperationStatusMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AccountAssignmentOperationStatusMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe StatusValues
-> Maybe POSIX
-> AccountAssignmentOperationStatusMetadata
AccountAssignmentOperationStatusMetadata'
            (Maybe Text
 -> Maybe StatusValues
 -> Maybe POSIX
 -> AccountAssignmentOperationStatusMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe StatusValues
      -> Maybe POSIX -> AccountAssignmentOperationStatusMetadata)
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 POSIX -> AccountAssignmentOperationStatusMetadata)
-> Parser (Maybe StatusValues)
-> Parser (Maybe POSIX -> AccountAssignmentOperationStatusMetadata)
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 POSIX -> AccountAssignmentOperationStatusMetadata)
-> Parser (Maybe POSIX)
-> Parser AccountAssignmentOperationStatusMetadata
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")
      )

instance
  Prelude.Hashable
    AccountAssignmentOperationStatusMetadata

instance
  Prelude.NFData
    AccountAssignmentOperationStatusMetadata