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