{-# 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.Signer.Types.SigningProfileRevocationRecord
-- 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.Signer.Types.SigningProfileRevocationRecord 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

-- | Revocation information for a signing profile.
--
-- /See:/ 'newSigningProfileRevocationRecord' smart constructor.
data SigningProfileRevocationRecord = SigningProfileRevocationRecord'
  { -- | The time when revocation becomes effective.
    SigningProfileRevocationRecord -> Maybe POSIX
revocationEffectiveFrom :: Prelude.Maybe Data.POSIX,
    -- | The time when the signing profile was revoked.
    SigningProfileRevocationRecord -> Maybe POSIX
revokedAt :: Prelude.Maybe Data.POSIX,
    -- | The identity of the revoker.
    SigningProfileRevocationRecord -> Maybe Text
revokedBy :: Prelude.Maybe Prelude.Text
  }
  deriving (SigningProfileRevocationRecord
-> SigningProfileRevocationRecord -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigningProfileRevocationRecord
-> SigningProfileRevocationRecord -> Bool
$c/= :: SigningProfileRevocationRecord
-> SigningProfileRevocationRecord -> Bool
== :: SigningProfileRevocationRecord
-> SigningProfileRevocationRecord -> Bool
$c== :: SigningProfileRevocationRecord
-> SigningProfileRevocationRecord -> Bool
Prelude.Eq, ReadPrec [SigningProfileRevocationRecord]
ReadPrec SigningProfileRevocationRecord
Int -> ReadS SigningProfileRevocationRecord
ReadS [SigningProfileRevocationRecord]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SigningProfileRevocationRecord]
$creadListPrec :: ReadPrec [SigningProfileRevocationRecord]
readPrec :: ReadPrec SigningProfileRevocationRecord
$creadPrec :: ReadPrec SigningProfileRevocationRecord
readList :: ReadS [SigningProfileRevocationRecord]
$creadList :: ReadS [SigningProfileRevocationRecord]
readsPrec :: Int -> ReadS SigningProfileRevocationRecord
$creadsPrec :: Int -> ReadS SigningProfileRevocationRecord
Prelude.Read, Int -> SigningProfileRevocationRecord -> ShowS
[SigningProfileRevocationRecord] -> ShowS
SigningProfileRevocationRecord -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigningProfileRevocationRecord] -> ShowS
$cshowList :: [SigningProfileRevocationRecord] -> ShowS
show :: SigningProfileRevocationRecord -> String
$cshow :: SigningProfileRevocationRecord -> String
showsPrec :: Int -> SigningProfileRevocationRecord -> ShowS
$cshowsPrec :: Int -> SigningProfileRevocationRecord -> ShowS
Prelude.Show, forall x.
Rep SigningProfileRevocationRecord x
-> SigningProfileRevocationRecord
forall x.
SigningProfileRevocationRecord
-> Rep SigningProfileRevocationRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SigningProfileRevocationRecord x
-> SigningProfileRevocationRecord
$cfrom :: forall x.
SigningProfileRevocationRecord
-> Rep SigningProfileRevocationRecord x
Prelude.Generic)

-- |
-- Create a value of 'SigningProfileRevocationRecord' 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:
--
-- 'revocationEffectiveFrom', 'signingProfileRevocationRecord_revocationEffectiveFrom' - The time when revocation becomes effective.
--
-- 'revokedAt', 'signingProfileRevocationRecord_revokedAt' - The time when the signing profile was revoked.
--
-- 'revokedBy', 'signingProfileRevocationRecord_revokedBy' - The identity of the revoker.
newSigningProfileRevocationRecord ::
  SigningProfileRevocationRecord
newSigningProfileRevocationRecord :: SigningProfileRevocationRecord
newSigningProfileRevocationRecord =
  SigningProfileRevocationRecord'
    { $sel:revocationEffectiveFrom:SigningProfileRevocationRecord' :: Maybe POSIX
revocationEffectiveFrom =
        forall a. Maybe a
Prelude.Nothing,
      $sel:revokedAt:SigningProfileRevocationRecord' :: Maybe POSIX
revokedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:revokedBy:SigningProfileRevocationRecord' :: Maybe Text
revokedBy = forall a. Maybe a
Prelude.Nothing
    }

-- | The time when revocation becomes effective.
signingProfileRevocationRecord_revocationEffectiveFrom :: Lens.Lens' SigningProfileRevocationRecord (Prelude.Maybe Prelude.UTCTime)
signingProfileRevocationRecord_revocationEffectiveFrom :: Lens' SigningProfileRevocationRecord (Maybe UTCTime)
signingProfileRevocationRecord_revocationEffectiveFrom = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileRevocationRecord' {Maybe POSIX
revocationEffectiveFrom :: Maybe POSIX
$sel:revocationEffectiveFrom:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
revocationEffectiveFrom} -> Maybe POSIX
revocationEffectiveFrom) (\s :: SigningProfileRevocationRecord
s@SigningProfileRevocationRecord' {} Maybe POSIX
a -> SigningProfileRevocationRecord
s {$sel:revocationEffectiveFrom:SigningProfileRevocationRecord' :: Maybe POSIX
revocationEffectiveFrom = Maybe POSIX
a} :: SigningProfileRevocationRecord) 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 time when the signing profile was revoked.
signingProfileRevocationRecord_revokedAt :: Lens.Lens' SigningProfileRevocationRecord (Prelude.Maybe Prelude.UTCTime)
signingProfileRevocationRecord_revokedAt :: Lens' SigningProfileRevocationRecord (Maybe UTCTime)
signingProfileRevocationRecord_revokedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileRevocationRecord' {Maybe POSIX
revokedAt :: Maybe POSIX
$sel:revokedAt:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
revokedAt} -> Maybe POSIX
revokedAt) (\s :: SigningProfileRevocationRecord
s@SigningProfileRevocationRecord' {} Maybe POSIX
a -> SigningProfileRevocationRecord
s {$sel:revokedAt:SigningProfileRevocationRecord' :: Maybe POSIX
revokedAt = Maybe POSIX
a} :: SigningProfileRevocationRecord) 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 identity of the revoker.
signingProfileRevocationRecord_revokedBy :: Lens.Lens' SigningProfileRevocationRecord (Prelude.Maybe Prelude.Text)
signingProfileRevocationRecord_revokedBy :: Lens' SigningProfileRevocationRecord (Maybe Text)
signingProfileRevocationRecord_revokedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileRevocationRecord' {Maybe Text
revokedBy :: Maybe Text
$sel:revokedBy:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe Text
revokedBy} -> Maybe Text
revokedBy) (\s :: SigningProfileRevocationRecord
s@SigningProfileRevocationRecord' {} Maybe Text
a -> SigningProfileRevocationRecord
s {$sel:revokedBy:SigningProfileRevocationRecord' :: Maybe Text
revokedBy = Maybe Text
a} :: SigningProfileRevocationRecord)

instance Data.FromJSON SigningProfileRevocationRecord where
  parseJSON :: Value -> Parser SigningProfileRevocationRecord
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SigningProfileRevocationRecord"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX -> Maybe Text -> SigningProfileRevocationRecord
SigningProfileRevocationRecord'
            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
"revocationEffectiveFrom")
            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
"revokedAt")
            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
"revokedBy")
      )

instance
  Prelude.Hashable
    SigningProfileRevocationRecord
  where
  hashWithSalt :: Int -> SigningProfileRevocationRecord -> Int
hashWithSalt
    Int
_salt
    SigningProfileRevocationRecord' {Maybe Text
Maybe POSIX
revokedBy :: Maybe Text
revokedAt :: Maybe POSIX
revocationEffectiveFrom :: Maybe POSIX
$sel:revokedBy:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe Text
$sel:revokedAt:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
$sel:revocationEffectiveFrom:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
revocationEffectiveFrom
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
revokedAt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revokedBy

instance
  Prelude.NFData
    SigningProfileRevocationRecord
  where
  rnf :: SigningProfileRevocationRecord -> ()
rnf SigningProfileRevocationRecord' {Maybe Text
Maybe POSIX
revokedBy :: Maybe Text
revokedAt :: Maybe POSIX
revocationEffectiveFrom :: Maybe POSIX
$sel:revokedBy:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe Text
$sel:revokedAt:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
$sel:revocationEffectiveFrom:SigningProfileRevocationRecord' :: SigningProfileRevocationRecord -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
revocationEffectiveFrom
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
revokedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revokedBy