{-# 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.CertificateManagerPCA.Types.ApiPassthrough where
import Amazonka.CertificateManagerPCA.Types.ASN1Subject
import Amazonka.CertificateManagerPCA.Types.Extensions
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApiPassthrough = ApiPassthrough'
{ ApiPassthrough -> Maybe ASN1Subject
subject :: Prelude.Maybe ASN1Subject,
ApiPassthrough -> Maybe Extensions
extensions :: Prelude.Maybe Extensions
}
deriving (ApiPassthrough -> ApiPassthrough -> Bool
(ApiPassthrough -> ApiPassthrough -> Bool)
-> (ApiPassthrough -> ApiPassthrough -> Bool) -> Eq ApiPassthrough
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiPassthrough -> ApiPassthrough -> Bool
$c/= :: ApiPassthrough -> ApiPassthrough -> Bool
== :: ApiPassthrough -> ApiPassthrough -> Bool
$c== :: ApiPassthrough -> ApiPassthrough -> Bool
Prelude.Eq, ReadPrec [ApiPassthrough]
ReadPrec ApiPassthrough
Int -> ReadS ApiPassthrough
ReadS [ApiPassthrough]
(Int -> ReadS ApiPassthrough)
-> ReadS [ApiPassthrough]
-> ReadPrec ApiPassthrough
-> ReadPrec [ApiPassthrough]
-> Read ApiPassthrough
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiPassthrough]
$creadListPrec :: ReadPrec [ApiPassthrough]
readPrec :: ReadPrec ApiPassthrough
$creadPrec :: ReadPrec ApiPassthrough
readList :: ReadS [ApiPassthrough]
$creadList :: ReadS [ApiPassthrough]
readsPrec :: Int -> ReadS ApiPassthrough
$creadsPrec :: Int -> ReadS ApiPassthrough
Prelude.Read, Int -> ApiPassthrough -> ShowS
[ApiPassthrough] -> ShowS
ApiPassthrough -> String
(Int -> ApiPassthrough -> ShowS)
-> (ApiPassthrough -> String)
-> ([ApiPassthrough] -> ShowS)
-> Show ApiPassthrough
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiPassthrough] -> ShowS
$cshowList :: [ApiPassthrough] -> ShowS
show :: ApiPassthrough -> String
$cshow :: ApiPassthrough -> String
showsPrec :: Int -> ApiPassthrough -> ShowS
$cshowsPrec :: Int -> ApiPassthrough -> ShowS
Prelude.Show, (forall x. ApiPassthrough -> Rep ApiPassthrough x)
-> (forall x. Rep ApiPassthrough x -> ApiPassthrough)
-> Generic ApiPassthrough
forall x. Rep ApiPassthrough x -> ApiPassthrough
forall x. ApiPassthrough -> Rep ApiPassthrough x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiPassthrough x -> ApiPassthrough
$cfrom :: forall x. ApiPassthrough -> Rep ApiPassthrough x
Prelude.Generic)
newApiPassthrough ::
ApiPassthrough
newApiPassthrough :: ApiPassthrough
newApiPassthrough =
ApiPassthrough' :: Maybe ASN1Subject -> Maybe Extensions -> ApiPassthrough
ApiPassthrough'
{ $sel:subject:ApiPassthrough' :: Maybe ASN1Subject
subject = Maybe ASN1Subject
forall a. Maybe a
Prelude.Nothing,
$sel:extensions:ApiPassthrough' :: Maybe Extensions
extensions = Maybe Extensions
forall a. Maybe a
Prelude.Nothing
}
apiPassthrough_subject :: Lens.Lens' ApiPassthrough (Prelude.Maybe ASN1Subject)
apiPassthrough_subject :: (Maybe ASN1Subject -> f (Maybe ASN1Subject))
-> ApiPassthrough -> f ApiPassthrough
apiPassthrough_subject = (ApiPassthrough -> Maybe ASN1Subject)
-> (ApiPassthrough -> Maybe ASN1Subject -> ApiPassthrough)
-> Lens
ApiPassthrough
ApiPassthrough
(Maybe ASN1Subject)
(Maybe ASN1Subject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiPassthrough' {Maybe ASN1Subject
subject :: Maybe ASN1Subject
$sel:subject:ApiPassthrough' :: ApiPassthrough -> Maybe ASN1Subject
subject} -> Maybe ASN1Subject
subject) (\s :: ApiPassthrough
s@ApiPassthrough' {} Maybe ASN1Subject
a -> ApiPassthrough
s {$sel:subject:ApiPassthrough' :: Maybe ASN1Subject
subject = Maybe ASN1Subject
a} :: ApiPassthrough)
apiPassthrough_extensions :: Lens.Lens' ApiPassthrough (Prelude.Maybe Extensions)
apiPassthrough_extensions :: (Maybe Extensions -> f (Maybe Extensions))
-> ApiPassthrough -> f ApiPassthrough
apiPassthrough_extensions = (ApiPassthrough -> Maybe Extensions)
-> (ApiPassthrough -> Maybe Extensions -> ApiPassthrough)
-> Lens
ApiPassthrough ApiPassthrough (Maybe Extensions) (Maybe Extensions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiPassthrough' {Maybe Extensions
extensions :: Maybe Extensions
$sel:extensions:ApiPassthrough' :: ApiPassthrough -> Maybe Extensions
extensions} -> Maybe Extensions
extensions) (\s :: ApiPassthrough
s@ApiPassthrough' {} Maybe Extensions
a -> ApiPassthrough
s {$sel:extensions:ApiPassthrough' :: Maybe Extensions
extensions = Maybe Extensions
a} :: ApiPassthrough)
instance Prelude.Hashable ApiPassthrough
instance Prelude.NFData ApiPassthrough
instance Core.ToJSON ApiPassthrough where
toJSON :: ApiPassthrough -> Value
toJSON ApiPassthrough' {Maybe ASN1Subject
Maybe Extensions
extensions :: Maybe Extensions
subject :: Maybe ASN1Subject
$sel:extensions:ApiPassthrough' :: ApiPassthrough -> Maybe Extensions
$sel:subject:ApiPassthrough' :: ApiPassthrough -> Maybe ASN1Subject
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Subject" Text -> ASN1Subject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ASN1Subject -> Pair) -> Maybe ASN1Subject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ASN1Subject
subject,
(Text
"Extensions" Text -> Extensions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Extensions -> Pair) -> Maybe Extensions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Extensions
extensions
]
)