{-# 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.RolesAnywhere.Types.CrlDetail
-- 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.RolesAnywhere.Types.CrlDetail 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 state of the certificate revocation list (CRL) after a read or write
-- operation.
--
-- /See:/ 'newCrlDetail' smart constructor.
data CrlDetail = CrlDetail'
  { -- | The ISO-8601 timestamp when the certificate revocation list (CRL) was
    -- created.
    CrlDetail -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
    -- | The ARN of the certificate revocation list (CRL).
    CrlDetail -> Maybe Text
crlArn :: Prelude.Maybe Prelude.Text,
    -- | The state of the certificate revocation list (CRL) after a read or write
    -- operation.
    CrlDetail -> Maybe Base64
crlData :: Prelude.Maybe Data.Base64,
    -- | The unique identifier of the certificate revocation list (CRL).
    CrlDetail -> Maybe Text
crlId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the certificate revocation list (CRL) is enabled.
    CrlDetail -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The name of the certificate revocation list (CRL).
    CrlDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the TrustAnchor the certificate revocation list (CRL) will
    -- provide revocation for.
    CrlDetail -> Maybe Text
trustAnchorArn :: Prelude.Maybe Prelude.Text,
    -- | The ISO-8601 timestamp when the certificate revocation list (CRL) was
    -- last updated.
    CrlDetail -> Maybe ISO8601
updatedAt :: Prelude.Maybe Data.ISO8601
  }
  deriving (CrlDetail -> CrlDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CrlDetail -> CrlDetail -> Bool
$c/= :: CrlDetail -> CrlDetail -> Bool
== :: CrlDetail -> CrlDetail -> Bool
$c== :: CrlDetail -> CrlDetail -> Bool
Prelude.Eq, ReadPrec [CrlDetail]
ReadPrec CrlDetail
Int -> ReadS CrlDetail
ReadS [CrlDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CrlDetail]
$creadListPrec :: ReadPrec [CrlDetail]
readPrec :: ReadPrec CrlDetail
$creadPrec :: ReadPrec CrlDetail
readList :: ReadS [CrlDetail]
$creadList :: ReadS [CrlDetail]
readsPrec :: Int -> ReadS CrlDetail
$creadsPrec :: Int -> ReadS CrlDetail
Prelude.Read, Int -> CrlDetail -> ShowS
[CrlDetail] -> ShowS
CrlDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CrlDetail] -> ShowS
$cshowList :: [CrlDetail] -> ShowS
show :: CrlDetail -> String
$cshow :: CrlDetail -> String
showsPrec :: Int -> CrlDetail -> ShowS
$cshowsPrec :: Int -> CrlDetail -> ShowS
Prelude.Show, forall x. Rep CrlDetail x -> CrlDetail
forall x. CrlDetail -> Rep CrlDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CrlDetail x -> CrlDetail
$cfrom :: forall x. CrlDetail -> Rep CrlDetail x
Prelude.Generic)

-- |
-- Create a value of 'CrlDetail' 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:
--
-- 'createdAt', 'crlDetail_createdAt' - The ISO-8601 timestamp when the certificate revocation list (CRL) was
-- created.
--
-- 'crlArn', 'crlDetail_crlArn' - The ARN of the certificate revocation list (CRL).
--
-- 'crlData', 'crlDetail_crlData' - The state of the certificate revocation list (CRL) after a read or write
-- operation.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'crlId', 'crlDetail_crlId' - The unique identifier of the certificate revocation list (CRL).
--
-- 'enabled', 'crlDetail_enabled' - Indicates whether the certificate revocation list (CRL) is enabled.
--
-- 'name', 'crlDetail_name' - The name of the certificate revocation list (CRL).
--
-- 'trustAnchorArn', 'crlDetail_trustAnchorArn' - The ARN of the TrustAnchor the certificate revocation list (CRL) will
-- provide revocation for.
--
-- 'updatedAt', 'crlDetail_updatedAt' - The ISO-8601 timestamp when the certificate revocation list (CRL) was
-- last updated.
newCrlDetail ::
  CrlDetail
newCrlDetail :: CrlDetail
newCrlDetail =
  CrlDetail'
    { $sel:createdAt:CrlDetail' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:crlArn:CrlDetail' :: Maybe Text
crlArn = forall a. Maybe a
Prelude.Nothing,
      $sel:crlData:CrlDetail' :: Maybe Base64
crlData = forall a. Maybe a
Prelude.Nothing,
      $sel:crlId:CrlDetail' :: Maybe Text
crlId = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:CrlDetail' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CrlDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:trustAnchorArn:CrlDetail' :: Maybe Text
trustAnchorArn = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:CrlDetail' :: Maybe ISO8601
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | The ISO-8601 timestamp when the certificate revocation list (CRL) was
-- created.
crlDetail_createdAt :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.UTCTime)
crlDetail_createdAt :: Lens' CrlDetail (Maybe UTCTime)
crlDetail_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: CrlDetail
s@CrlDetail' {} Maybe ISO8601
a -> CrlDetail
s {$sel:createdAt:CrlDetail' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: CrlDetail) 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 ARN of the certificate revocation list (CRL).
crlDetail_crlArn :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.Text)
crlDetail_crlArn :: Lens' CrlDetail (Maybe Text)
crlDetail_crlArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Text
crlArn :: Maybe Text
$sel:crlArn:CrlDetail' :: CrlDetail -> Maybe Text
crlArn} -> Maybe Text
crlArn) (\s :: CrlDetail
s@CrlDetail' {} Maybe Text
a -> CrlDetail
s {$sel:crlArn:CrlDetail' :: Maybe Text
crlArn = Maybe Text
a} :: CrlDetail)

-- | The state of the certificate revocation list (CRL) after a read or write
-- operation.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
crlDetail_crlData :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.ByteString)
crlDetail_crlData :: Lens' CrlDetail (Maybe ByteString)
crlDetail_crlData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Base64
crlData :: Maybe Base64
$sel:crlData:CrlDetail' :: CrlDetail -> Maybe Base64
crlData} -> Maybe Base64
crlData) (\s :: CrlDetail
s@CrlDetail' {} Maybe Base64
a -> CrlDetail
s {$sel:crlData:CrlDetail' :: Maybe Base64
crlData = Maybe Base64
a} :: CrlDetail) 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 Iso' Base64 ByteString
Data._Base64

-- | The unique identifier of the certificate revocation list (CRL).
crlDetail_crlId :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.Text)
crlDetail_crlId :: Lens' CrlDetail (Maybe Text)
crlDetail_crlId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Text
crlId :: Maybe Text
$sel:crlId:CrlDetail' :: CrlDetail -> Maybe Text
crlId} -> Maybe Text
crlId) (\s :: CrlDetail
s@CrlDetail' {} Maybe Text
a -> CrlDetail
s {$sel:crlId:CrlDetail' :: Maybe Text
crlId = Maybe Text
a} :: CrlDetail)

-- | Indicates whether the certificate revocation list (CRL) is enabled.
crlDetail_enabled :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.Bool)
crlDetail_enabled :: Lens' CrlDetail (Maybe Bool)
crlDetail_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:CrlDetail' :: CrlDetail -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: CrlDetail
s@CrlDetail' {} Maybe Bool
a -> CrlDetail
s {$sel:enabled:CrlDetail' :: Maybe Bool
enabled = Maybe Bool
a} :: CrlDetail)

-- | The name of the certificate revocation list (CRL).
crlDetail_name :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.Text)
crlDetail_name :: Lens' CrlDetail (Maybe Text)
crlDetail_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Text
name :: Maybe Text
$sel:name:CrlDetail' :: CrlDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: CrlDetail
s@CrlDetail' {} Maybe Text
a -> CrlDetail
s {$sel:name:CrlDetail' :: Maybe Text
name = Maybe Text
a} :: CrlDetail)

-- | The ARN of the TrustAnchor the certificate revocation list (CRL) will
-- provide revocation for.
crlDetail_trustAnchorArn :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.Text)
crlDetail_trustAnchorArn :: Lens' CrlDetail (Maybe Text)
crlDetail_trustAnchorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe Text
trustAnchorArn :: Maybe Text
$sel:trustAnchorArn:CrlDetail' :: CrlDetail -> Maybe Text
trustAnchorArn} -> Maybe Text
trustAnchorArn) (\s :: CrlDetail
s@CrlDetail' {} Maybe Text
a -> CrlDetail
s {$sel:trustAnchorArn:CrlDetail' :: Maybe Text
trustAnchorArn = Maybe Text
a} :: CrlDetail)

-- | The ISO-8601 timestamp when the certificate revocation list (CRL) was
-- last updated.
crlDetail_updatedAt :: Lens.Lens' CrlDetail (Prelude.Maybe Prelude.UTCTime)
crlDetail_updatedAt :: Lens' CrlDetail (Maybe UTCTime)
crlDetail_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetail' {Maybe ISO8601
updatedAt :: Maybe ISO8601
$sel:updatedAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
updatedAt} -> Maybe ISO8601
updatedAt) (\s :: CrlDetail
s@CrlDetail' {} Maybe ISO8601
a -> CrlDetail
s {$sel:updatedAt:CrlDetail' :: Maybe ISO8601
updatedAt = Maybe ISO8601
a} :: CrlDetail) 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

instance Data.FromJSON CrlDetail where
  parseJSON :: Value -> Parser CrlDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CrlDetail"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe Base64
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> CrlDetail
CrlDetail'
            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
"createdAt")
            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
"crlArn")
            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
"crlData")
            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
"crlId")
            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
"enabled")
            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
"name")
            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
"trustAnchorArn")
            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
"updatedAt")
      )

instance Prelude.Hashable CrlDetail where
  hashWithSalt :: Int -> CrlDetail -> Int
hashWithSalt Int
_salt CrlDetail' {Maybe Bool
Maybe Text
Maybe Base64
Maybe ISO8601
updatedAt :: Maybe ISO8601
trustAnchorArn :: Maybe Text
name :: Maybe Text
enabled :: Maybe Bool
crlId :: Maybe Text
crlData :: Maybe Base64
crlArn :: Maybe Text
createdAt :: Maybe ISO8601
$sel:updatedAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
$sel:trustAnchorArn:CrlDetail' :: CrlDetail -> Maybe Text
$sel:name:CrlDetail' :: CrlDetail -> Maybe Text
$sel:enabled:CrlDetail' :: CrlDetail -> Maybe Bool
$sel:crlId:CrlDetail' :: CrlDetail -> Maybe Text
$sel:crlData:CrlDetail' :: CrlDetail -> Maybe Base64
$sel:crlArn:CrlDetail' :: CrlDetail -> Maybe Text
$sel:createdAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
crlArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Base64
crlData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
crlId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trustAnchorArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
updatedAt

instance Prelude.NFData CrlDetail where
  rnf :: CrlDetail -> ()
rnf CrlDetail' {Maybe Bool
Maybe Text
Maybe Base64
Maybe ISO8601
updatedAt :: Maybe ISO8601
trustAnchorArn :: Maybe Text
name :: Maybe Text
enabled :: Maybe Bool
crlId :: Maybe Text
crlData :: Maybe Base64
crlArn :: Maybe Text
createdAt :: Maybe ISO8601
$sel:updatedAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
$sel:trustAnchorArn:CrlDetail' :: CrlDetail -> Maybe Text
$sel:name:CrlDetail' :: CrlDetail -> Maybe Text
$sel:enabled:CrlDetail' :: CrlDetail -> Maybe Bool
$sel:crlId:CrlDetail' :: CrlDetail -> Maybe Text
$sel:crlData:CrlDetail' :: CrlDetail -> Maybe Base64
$sel:crlArn:CrlDetail' :: CrlDetail -> Maybe Text
$sel:createdAt:CrlDetail' :: CrlDetail -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
crlArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
crlData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
crlId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      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 Text
trustAnchorArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updatedAt