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