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