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