{-# 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 #-}
module Amazonka.Lightsail.Types.CertificateSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.Certificate
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude
data CertificateSummary = CertificateSummary'
{
CertificateSummary -> Maybe Certificate
certificateDetail :: Prelude.Maybe Certificate,
CertificateSummary -> Maybe Text
certificateName :: Prelude.Maybe Prelude.Text,
CertificateSummary -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
CertificateSummary -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
CertificateSummary -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (CertificateSummary -> CertificateSummary -> Bool
(CertificateSummary -> CertificateSummary -> Bool)
-> (CertificateSummary -> CertificateSummary -> Bool)
-> Eq CertificateSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CertificateSummary -> CertificateSummary -> Bool
$c/= :: CertificateSummary -> CertificateSummary -> Bool
== :: CertificateSummary -> CertificateSummary -> Bool
$c== :: CertificateSummary -> CertificateSummary -> Bool
Prelude.Eq, ReadPrec [CertificateSummary]
ReadPrec CertificateSummary
Int -> ReadS CertificateSummary
ReadS [CertificateSummary]
(Int -> ReadS CertificateSummary)
-> ReadS [CertificateSummary]
-> ReadPrec CertificateSummary
-> ReadPrec [CertificateSummary]
-> Read CertificateSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CertificateSummary]
$creadListPrec :: ReadPrec [CertificateSummary]
readPrec :: ReadPrec CertificateSummary
$creadPrec :: ReadPrec CertificateSummary
readList :: ReadS [CertificateSummary]
$creadList :: ReadS [CertificateSummary]
readsPrec :: Int -> ReadS CertificateSummary
$creadsPrec :: Int -> ReadS CertificateSummary
Prelude.Read, Int -> CertificateSummary -> ShowS
[CertificateSummary] -> ShowS
CertificateSummary -> String
(Int -> CertificateSummary -> ShowS)
-> (CertificateSummary -> String)
-> ([CertificateSummary] -> ShowS)
-> Show CertificateSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CertificateSummary] -> ShowS
$cshowList :: [CertificateSummary] -> ShowS
show :: CertificateSummary -> String
$cshow :: CertificateSummary -> String
showsPrec :: Int -> CertificateSummary -> ShowS
$cshowsPrec :: Int -> CertificateSummary -> ShowS
Prelude.Show, (forall x. CertificateSummary -> Rep CertificateSummary x)
-> (forall x. Rep CertificateSummary x -> CertificateSummary)
-> Generic CertificateSummary
forall x. Rep CertificateSummary x -> CertificateSummary
forall x. CertificateSummary -> Rep CertificateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CertificateSummary x -> CertificateSummary
$cfrom :: forall x. CertificateSummary -> Rep CertificateSummary x
Prelude.Generic)
newCertificateSummary ::
CertificateSummary
newCertificateSummary :: CertificateSummary
newCertificateSummary =
CertificateSummary' :: Maybe Certificate
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> CertificateSummary
CertificateSummary'
{ $sel:certificateDetail:CertificateSummary' :: Maybe Certificate
certificateDetail =
Maybe Certificate
forall a. Maybe a
Prelude.Nothing,
$sel:certificateName:CertificateSummary' :: Maybe Text
certificateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateArn:CertificateSummary' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:CertificateSummary' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CertificateSummary' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
certificateSummary_certificateDetail :: Lens.Lens' CertificateSummary (Prelude.Maybe Certificate)
certificateSummary_certificateDetail :: (Maybe Certificate -> f (Maybe Certificate))
-> CertificateSummary -> f CertificateSummary
certificateSummary_certificateDetail = (CertificateSummary -> Maybe Certificate)
-> (CertificateSummary -> Maybe Certificate -> CertificateSummary)
-> Lens
CertificateSummary
CertificateSummary
(Maybe Certificate)
(Maybe Certificate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Certificate
certificateDetail :: Maybe Certificate
$sel:certificateDetail:CertificateSummary' :: CertificateSummary -> Maybe Certificate
certificateDetail} -> Maybe Certificate
certificateDetail) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Certificate
a -> CertificateSummary
s {$sel:certificateDetail:CertificateSummary' :: Maybe Certificate
certificateDetail = Maybe Certificate
a} :: CertificateSummary)
certificateSummary_certificateName :: Lens.Lens' CertificateSummary (Prelude.Maybe Prelude.Text)
certificateSummary_certificateName :: (Maybe Text -> f (Maybe Text))
-> CertificateSummary -> f CertificateSummary
certificateSummary_certificateName = (CertificateSummary -> Maybe Text)
-> (CertificateSummary -> Maybe Text -> CertificateSummary)
-> Lens
CertificateSummary CertificateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Text
certificateName :: Maybe Text
$sel:certificateName:CertificateSummary' :: CertificateSummary -> Maybe Text
certificateName} -> Maybe Text
certificateName) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Text
a -> CertificateSummary
s {$sel:certificateName:CertificateSummary' :: Maybe Text
certificateName = Maybe Text
a} :: CertificateSummary)
certificateSummary_certificateArn :: Lens.Lens' CertificateSummary (Prelude.Maybe Prelude.Text)
certificateSummary_certificateArn :: (Maybe Text -> f (Maybe Text))
-> CertificateSummary -> f CertificateSummary
certificateSummary_certificateArn = (CertificateSummary -> Maybe Text)
-> (CertificateSummary -> Maybe Text -> CertificateSummary)
-> Lens
CertificateSummary CertificateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CertificateSummary' :: CertificateSummary -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Text
a -> CertificateSummary
s {$sel:certificateArn:CertificateSummary' :: Maybe Text
certificateArn = Maybe Text
a} :: CertificateSummary)
certificateSummary_domainName :: Lens.Lens' CertificateSummary (Prelude.Maybe Prelude.Text)
certificateSummary_domainName :: (Maybe Text -> f (Maybe Text))
-> CertificateSummary -> f CertificateSummary
certificateSummary_domainName = (CertificateSummary -> Maybe Text)
-> (CertificateSummary -> Maybe Text -> CertificateSummary)
-> Lens
CertificateSummary CertificateSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe Text
domainName :: Maybe Text
$sel:domainName:CertificateSummary' :: CertificateSummary -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe Text
a -> CertificateSummary
s {$sel:domainName:CertificateSummary' :: Maybe Text
domainName = Maybe Text
a} :: CertificateSummary)
certificateSummary_tags :: Lens.Lens' CertificateSummary (Prelude.Maybe [Tag])
certificateSummary_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CertificateSummary -> f CertificateSummary
certificateSummary_tags = (CertificateSummary -> Maybe [Tag])
-> (CertificateSummary -> Maybe [Tag] -> CertificateSummary)
-> Lens
CertificateSummary CertificateSummary (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateSummary' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CertificateSummary' :: CertificateSummary -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CertificateSummary
s@CertificateSummary' {} Maybe [Tag]
a -> CertificateSummary
s {$sel:tags:CertificateSummary' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CertificateSummary) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CertificateSummary -> f CertificateSummary)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CertificateSummary
-> f CertificateSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CertificateSummary where
parseJSON :: Value -> Parser CertificateSummary
parseJSON =
String
-> (Object -> Parser CertificateSummary)
-> Value
-> Parser CertificateSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CertificateSummary"
( \Object
x ->
Maybe Certificate
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> CertificateSummary
CertificateSummary'
(Maybe Certificate
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> CertificateSummary)
-> Parser (Maybe Certificate)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> CertificateSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Certificate)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificateDetail")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> CertificateSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe [Tag] -> CertificateSummary)
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
"certificateName")
Parser
(Maybe Text -> Maybe Text -> Maybe [Tag] -> CertificateSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> CertificateSummary)
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
"certificateArn")
Parser (Maybe Text -> Maybe [Tag] -> CertificateSummary)
-> Parser (Maybe Text)
-> Parser (Maybe [Tag] -> CertificateSummary)
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
"domainName")
Parser (Maybe [Tag] -> CertificateSummary)
-> Parser (Maybe [Tag]) -> Parser CertificateSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CertificateSummary
instance Prelude.NFData CertificateSummary