module Stratosphere.Lightsail.Certificate (
        Certificate(..), mkCertificate
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Certificate
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-certificate.html>
    Certificate {Certificate -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-certificate.html#cfn-lightsail-certificate-certificatename>
                 Certificate -> Value Text
certificateName :: (Value Prelude.Text),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-certificate.html#cfn-lightsail-certificate-domainname>
                 Certificate -> Value Text
domainName :: (Value Prelude.Text),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-certificate.html#cfn-lightsail-certificate-subjectalternativenames>
                 Certificate -> Maybe (ValueList Text)
subjectAlternativeNames :: (Prelude.Maybe (ValueList Prelude.Text)),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-certificate.html#cfn-lightsail-certificate-tags>
                 Certificate -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Certificate -> Certificate -> Bool
(Certificate -> Certificate -> Bool)
-> (Certificate -> Certificate -> Bool) -> Eq Certificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Certificate -> Certificate -> Bool
== :: Certificate -> Certificate -> Bool
$c/= :: Certificate -> Certificate -> Bool
/= :: Certificate -> Certificate -> Bool
Prelude.Eq, Int -> Certificate -> ShowS
[Certificate] -> ShowS
Certificate -> String
(Int -> Certificate -> ShowS)
-> (Certificate -> String)
-> ([Certificate] -> ShowS)
-> Show Certificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Certificate -> ShowS
showsPrec :: Int -> Certificate -> ShowS
$cshow :: Certificate -> String
show :: Certificate -> String
$cshowList :: [Certificate] -> ShowS
showList :: [Certificate] -> ShowS
Prelude.Show)
mkCertificate ::
  Value Prelude.Text -> Value Prelude.Text -> Certificate
mkCertificate :: Value Text -> Value Text -> Certificate
mkCertificate Value Text
certificateName Value Text
domainName
  = Certificate
      {haddock_workaround_ :: ()
haddock_workaround_ = (), certificateName :: Value Text
certificateName = Value Text
certificateName,
       domainName :: Value Text
domainName = Value Text
domainName, subjectAlternativeNames :: Maybe (ValueList Text)
subjectAlternativeNames = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Certificate where
  toResourceProperties :: Certificate -> ResourceProperties
toResourceProperties Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Lightsail::Certificate",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"CertificateName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
certificateName,
                            Key
"DomainName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
domainName]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SubjectAlternativeNames"
                                 (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
subjectAlternativeNames,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Certificate where
  toJSON :: Certificate -> Value
toJSON Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"CertificateName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
certificateName,
               Key
"DomainName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
domainName]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SubjectAlternativeNames"
                    (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
subjectAlternativeNames,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "CertificateName" Certificate where
  type PropertyType "CertificateName" Certificate = Value Prelude.Text
  set :: PropertyType "CertificateName" Certificate
-> Certificate -> Certificate
set PropertyType "CertificateName" Certificate
newValue Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = Certificate {certificateName :: Value Text
certificateName = PropertyType "CertificateName" Certificate
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
instance Property "DomainName" Certificate where
  type PropertyType "DomainName" Certificate = Value Prelude.Text
  set :: PropertyType "DomainName" Certificate -> Certificate -> Certificate
set PropertyType "DomainName" Certificate
newValue Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = Certificate {domainName :: Value Text
domainName = PropertyType "DomainName" Certificate
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
certificateName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
instance Property "SubjectAlternativeNames" Certificate where
  type PropertyType "SubjectAlternativeNames" Certificate = ValueList Prelude.Text
  set :: PropertyType "SubjectAlternativeNames" Certificate
-> Certificate -> Certificate
set PropertyType "SubjectAlternativeNames" Certificate
newValue Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = Certificate {subjectAlternativeNames :: Maybe (ValueList Text)
subjectAlternativeNames = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SubjectAlternativeNames" Certificate
ValueList Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" Certificate where
  type PropertyType "Tags" Certificate = [Tag]
  set :: PropertyType "Tags" Certificate -> Certificate -> Certificate
set PropertyType "Tags" Certificate
newValue Certificate {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Certificate -> ()
certificateName :: Certificate -> Value Text
domainName :: Certificate -> Value Text
subjectAlternativeNames :: Certificate -> Maybe (ValueList Text)
tags :: Certificate -> Maybe [Tag]
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
    = Certificate {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Certificate
newValue, Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
haddock_workaround_ :: ()
certificateName :: Value Text
domainName :: Value Text
subjectAlternativeNames :: Maybe (ValueList Text)
..}