{-# 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.CrlDetailResponse
-- 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.CrlDetailResponse 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 Amazonka.RolesAnywhere.Types.CrlDetail

-- | /See:/ 'newCrlDetailResponse' smart constructor.
data CrlDetailResponse = CrlDetailResponse'
  { -- | The state of the certificate revocation list (CRL) after a read or write
    -- operation.
    CrlDetailResponse -> CrlDetail
crl :: CrlDetail
  }
  deriving (CrlDetailResponse -> CrlDetailResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CrlDetailResponse -> CrlDetailResponse -> Bool
$c/= :: CrlDetailResponse -> CrlDetailResponse -> Bool
== :: CrlDetailResponse -> CrlDetailResponse -> Bool
$c== :: CrlDetailResponse -> CrlDetailResponse -> Bool
Prelude.Eq, ReadPrec [CrlDetailResponse]
ReadPrec CrlDetailResponse
Int -> ReadS CrlDetailResponse
ReadS [CrlDetailResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CrlDetailResponse]
$creadListPrec :: ReadPrec [CrlDetailResponse]
readPrec :: ReadPrec CrlDetailResponse
$creadPrec :: ReadPrec CrlDetailResponse
readList :: ReadS [CrlDetailResponse]
$creadList :: ReadS [CrlDetailResponse]
readsPrec :: Int -> ReadS CrlDetailResponse
$creadsPrec :: Int -> ReadS CrlDetailResponse
Prelude.Read, Int -> CrlDetailResponse -> ShowS
[CrlDetailResponse] -> ShowS
CrlDetailResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CrlDetailResponse] -> ShowS
$cshowList :: [CrlDetailResponse] -> ShowS
show :: CrlDetailResponse -> String
$cshow :: CrlDetailResponse -> String
showsPrec :: Int -> CrlDetailResponse -> ShowS
$cshowsPrec :: Int -> CrlDetailResponse -> ShowS
Prelude.Show, forall x. Rep CrlDetailResponse x -> CrlDetailResponse
forall x. CrlDetailResponse -> Rep CrlDetailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CrlDetailResponse x -> CrlDetailResponse
$cfrom :: forall x. CrlDetailResponse -> Rep CrlDetailResponse x
Prelude.Generic)

-- |
-- Create a value of 'CrlDetailResponse' 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:
--
-- 'crl', 'crlDetailResponse_crl' - The state of the certificate revocation list (CRL) after a read or write
-- operation.
newCrlDetailResponse ::
  -- | 'crl'
  CrlDetail ->
  CrlDetailResponse
newCrlDetailResponse :: CrlDetail -> CrlDetailResponse
newCrlDetailResponse CrlDetail
pCrl_ =
  CrlDetailResponse' {$sel:crl:CrlDetailResponse' :: CrlDetail
crl = CrlDetail
pCrl_}

-- | The state of the certificate revocation list (CRL) after a read or write
-- operation.
crlDetailResponse_crl :: Lens.Lens' CrlDetailResponse CrlDetail
crlDetailResponse_crl :: Lens' CrlDetailResponse CrlDetail
crlDetailResponse_crl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrlDetailResponse' {CrlDetail
crl :: CrlDetail
$sel:crl:CrlDetailResponse' :: CrlDetailResponse -> CrlDetail
crl} -> CrlDetail
crl) (\s :: CrlDetailResponse
s@CrlDetailResponse' {} CrlDetail
a -> CrlDetailResponse
s {$sel:crl:CrlDetailResponse' :: CrlDetail
crl = CrlDetail
a} :: CrlDetailResponse)

instance Data.FromJSON CrlDetailResponse where
  parseJSON :: Value -> Parser CrlDetailResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CrlDetailResponse"
      ( \Object
x ->
          CrlDetail -> CrlDetailResponse
CrlDetailResponse' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"crl")
      )

instance Prelude.Hashable CrlDetailResponse where
  hashWithSalt :: Int -> CrlDetailResponse -> Int
hashWithSalt Int
_salt CrlDetailResponse' {CrlDetail
crl :: CrlDetail
$sel:crl:CrlDetailResponse' :: CrlDetailResponse -> CrlDetail
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CrlDetail
crl

instance Prelude.NFData CrlDetailResponse where
  rnf :: CrlDetailResponse -> ()
rnf CrlDetailResponse' {CrlDetail
crl :: CrlDetail
$sel:crl:CrlDetailResponse' :: CrlDetailResponse -> CrlDetail
..} = forall a. NFData a => a -> ()
Prelude.rnf CrlDetail
crl