{-# 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.WorkLink.Types.WebsiteCaSummary
-- 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.WorkLink.Types.WebsiteCaSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The summary of the certificate authority (CA).
--
-- /See:/ 'newWebsiteCaSummary' smart constructor.
data WebsiteCaSummary = WebsiteCaSummary'
  { -- | The time when the CA was added.
    WebsiteCaSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | A unique identifier for the CA.
    WebsiteCaSummary -> Maybe Text
websiteCaId :: Prelude.Maybe Prelude.Text,
    -- | The name to display.
    WebsiteCaSummary -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text
  }
  deriving (WebsiteCaSummary -> WebsiteCaSummary -> Bool
(WebsiteCaSummary -> WebsiteCaSummary -> Bool)
-> (WebsiteCaSummary -> WebsiteCaSummary -> Bool)
-> Eq WebsiteCaSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebsiteCaSummary -> WebsiteCaSummary -> Bool
$c/= :: WebsiteCaSummary -> WebsiteCaSummary -> Bool
== :: WebsiteCaSummary -> WebsiteCaSummary -> Bool
$c== :: WebsiteCaSummary -> WebsiteCaSummary -> Bool
Prelude.Eq, ReadPrec [WebsiteCaSummary]
ReadPrec WebsiteCaSummary
Int -> ReadS WebsiteCaSummary
ReadS [WebsiteCaSummary]
(Int -> ReadS WebsiteCaSummary)
-> ReadS [WebsiteCaSummary]
-> ReadPrec WebsiteCaSummary
-> ReadPrec [WebsiteCaSummary]
-> Read WebsiteCaSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebsiteCaSummary]
$creadListPrec :: ReadPrec [WebsiteCaSummary]
readPrec :: ReadPrec WebsiteCaSummary
$creadPrec :: ReadPrec WebsiteCaSummary
readList :: ReadS [WebsiteCaSummary]
$creadList :: ReadS [WebsiteCaSummary]
readsPrec :: Int -> ReadS WebsiteCaSummary
$creadsPrec :: Int -> ReadS WebsiteCaSummary
Prelude.Read, Int -> WebsiteCaSummary -> ShowS
[WebsiteCaSummary] -> ShowS
WebsiteCaSummary -> String
(Int -> WebsiteCaSummary -> ShowS)
-> (WebsiteCaSummary -> String)
-> ([WebsiteCaSummary] -> ShowS)
-> Show WebsiteCaSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebsiteCaSummary] -> ShowS
$cshowList :: [WebsiteCaSummary] -> ShowS
show :: WebsiteCaSummary -> String
$cshow :: WebsiteCaSummary -> String
showsPrec :: Int -> WebsiteCaSummary -> ShowS
$cshowsPrec :: Int -> WebsiteCaSummary -> ShowS
Prelude.Show, (forall x. WebsiteCaSummary -> Rep WebsiteCaSummary x)
-> (forall x. Rep WebsiteCaSummary x -> WebsiteCaSummary)
-> Generic WebsiteCaSummary
forall x. Rep WebsiteCaSummary x -> WebsiteCaSummary
forall x. WebsiteCaSummary -> Rep WebsiteCaSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebsiteCaSummary x -> WebsiteCaSummary
$cfrom :: forall x. WebsiteCaSummary -> Rep WebsiteCaSummary x
Prelude.Generic)

-- |
-- Create a value of 'WebsiteCaSummary' 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:
--
-- 'createdTime', 'websiteCaSummary_createdTime' - The time when the CA was added.
--
-- 'websiteCaId', 'websiteCaSummary_websiteCaId' - A unique identifier for the CA.
--
-- 'displayName', 'websiteCaSummary_displayName' - The name to display.
newWebsiteCaSummary ::
  WebsiteCaSummary
newWebsiteCaSummary :: WebsiteCaSummary
newWebsiteCaSummary =
  WebsiteCaSummary' :: Maybe POSIX -> Maybe Text -> Maybe Text -> WebsiteCaSummary
WebsiteCaSummary'
    { $sel:createdTime:WebsiteCaSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:websiteCaId:WebsiteCaSummary' :: Maybe Text
websiteCaId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:WebsiteCaSummary' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time when the CA was added.
websiteCaSummary_createdTime :: Lens.Lens' WebsiteCaSummary (Prelude.Maybe Prelude.UTCTime)
websiteCaSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WebsiteCaSummary -> f WebsiteCaSummary
websiteCaSummary_createdTime = (WebsiteCaSummary -> Maybe POSIX)
-> (WebsiteCaSummary -> Maybe POSIX -> WebsiteCaSummary)
-> Lens
     WebsiteCaSummary WebsiteCaSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteCaSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:WebsiteCaSummary' :: WebsiteCaSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: WebsiteCaSummary
s@WebsiteCaSummary' {} Maybe POSIX
a -> WebsiteCaSummary
s {$sel:createdTime:WebsiteCaSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: WebsiteCaSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WebsiteCaSummary -> f WebsiteCaSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WebsiteCaSummary
-> f WebsiteCaSummary
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

-- | A unique identifier for the CA.
websiteCaSummary_websiteCaId :: Lens.Lens' WebsiteCaSummary (Prelude.Maybe Prelude.Text)
websiteCaSummary_websiteCaId :: (Maybe Text -> f (Maybe Text))
-> WebsiteCaSummary -> f WebsiteCaSummary
websiteCaSummary_websiteCaId = (WebsiteCaSummary -> Maybe Text)
-> (WebsiteCaSummary -> Maybe Text -> WebsiteCaSummary)
-> Lens WebsiteCaSummary WebsiteCaSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteCaSummary' {Maybe Text
websiteCaId :: Maybe Text
$sel:websiteCaId:WebsiteCaSummary' :: WebsiteCaSummary -> Maybe Text
websiteCaId} -> Maybe Text
websiteCaId) (\s :: WebsiteCaSummary
s@WebsiteCaSummary' {} Maybe Text
a -> WebsiteCaSummary
s {$sel:websiteCaId:WebsiteCaSummary' :: Maybe Text
websiteCaId = Maybe Text
a} :: WebsiteCaSummary)

-- | The name to display.
websiteCaSummary_displayName :: Lens.Lens' WebsiteCaSummary (Prelude.Maybe Prelude.Text)
websiteCaSummary_displayName :: (Maybe Text -> f (Maybe Text))
-> WebsiteCaSummary -> f WebsiteCaSummary
websiteCaSummary_displayName = (WebsiteCaSummary -> Maybe Text)
-> (WebsiteCaSummary -> Maybe Text -> WebsiteCaSummary)
-> Lens WebsiteCaSummary WebsiteCaSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebsiteCaSummary' {Maybe Text
displayName :: Maybe Text
$sel:displayName:WebsiteCaSummary' :: WebsiteCaSummary -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: WebsiteCaSummary
s@WebsiteCaSummary' {} Maybe Text
a -> WebsiteCaSummary
s {$sel:displayName:WebsiteCaSummary' :: Maybe Text
displayName = Maybe Text
a} :: WebsiteCaSummary)

instance Core.FromJSON WebsiteCaSummary where
  parseJSON :: Value -> Parser WebsiteCaSummary
parseJSON =
    String
-> (Object -> Parser WebsiteCaSummary)
-> Value
-> Parser WebsiteCaSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WebsiteCaSummary"
      ( \Object
x ->
          Maybe POSIX -> Maybe Text -> Maybe Text -> WebsiteCaSummary
WebsiteCaSummary'
            (Maybe POSIX -> Maybe Text -> Maybe Text -> WebsiteCaSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> WebsiteCaSummary)
forall (f :: * -> *) a b. Functor 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
"CreatedTime")
            Parser (Maybe Text -> Maybe Text -> WebsiteCaSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> WebsiteCaSummary)
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
"WebsiteCaId")
            Parser (Maybe Text -> WebsiteCaSummary)
-> Parser (Maybe Text) -> Parser WebsiteCaSummary
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
"DisplayName")
      )

instance Prelude.Hashable WebsiteCaSummary

instance Prelude.NFData WebsiteCaSummary