module Stratosphere.ACMPCA.Permission (
        Permission(..), mkPermission
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Permission
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-permission.html>
    Permission {Permission -> ()
haddock_workaround_ :: (),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-permission.html#cfn-acmpca-permission-actions>
                Permission -> ValueList Text
actions :: (ValueList Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-permission.html#cfn-acmpca-permission-certificateauthorityarn>
                Permission -> Value Text
certificateAuthorityArn :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-permission.html#cfn-acmpca-permission-principal>
                Permission -> Value Text
principal :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-acmpca-permission.html#cfn-acmpca-permission-sourceaccount>
                Permission -> Maybe (Value Text)
sourceAccount :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (Permission -> Permission -> Bool
(Permission -> Permission -> Bool)
-> (Permission -> Permission -> Bool) -> Eq Permission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Permission -> Permission -> Bool
== :: Permission -> Permission -> Bool
$c/= :: Permission -> Permission -> Bool
/= :: Permission -> Permission -> Bool
Prelude.Eq, Int -> Permission -> ShowS
[Permission] -> ShowS
Permission -> String
(Int -> Permission -> ShowS)
-> (Permission -> String)
-> ([Permission] -> ShowS)
-> Show Permission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Permission -> ShowS
showsPrec :: Int -> Permission -> ShowS
$cshow :: Permission -> String
show :: Permission -> String
$cshowList :: [Permission] -> ShowS
showList :: [Permission] -> ShowS
Prelude.Show)
mkPermission ::
  ValueList Prelude.Text
  -> Value Prelude.Text -> Value Prelude.Text -> Permission
mkPermission :: ValueList Text -> Value Text -> Value Text -> Permission
mkPermission ValueList Text
actions Value Text
certificateAuthorityArn Value Text
principal
  = Permission
      {haddock_workaround_ :: ()
haddock_workaround_ = (), actions :: ValueList Text
actions = ValueList Text
actions,
       certificateAuthorityArn :: Value Text
certificateAuthorityArn = Value Text
certificateAuthorityArn,
       principal :: Value Text
principal = Value Text
principal, sourceAccount :: Maybe (Value Text)
sourceAccount = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Permission where
  toResourceProperties :: Permission -> ResourceProperties
toResourceProperties Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ACMPCA::Permission", supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"Actions" 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..= ValueList Text
actions,
                            Key
"CertificateAuthorityArn" 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
certificateAuthorityArn,
                            Key
"Principal" 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
principal]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [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..=) Key
"SourceAccount" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
sourceAccount]))}
instance JSON.ToJSON Permission where
  toJSON :: Permission -> Value
toJSON Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
    = [(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
"Actions" 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..= ValueList Text
actions,
               Key
"CertificateAuthorityArn" 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
certificateAuthorityArn,
               Key
"Principal" 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
principal]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [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..=) Key
"SourceAccount" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
sourceAccount])))
instance Property "Actions" Permission where
  type PropertyType "Actions" Permission = ValueList Prelude.Text
  set :: PropertyType "Actions" Permission -> Permission -> Permission
set PropertyType "Actions" Permission
newValue Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..} = Permission {actions :: ValueList Text
actions = PropertyType "Actions" Permission
ValueList Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
haddock_workaround_ :: ()
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
instance Property "CertificateAuthorityArn" Permission where
  type PropertyType "CertificateAuthorityArn" Permission = Value Prelude.Text
  set :: PropertyType "CertificateAuthorityArn" Permission
-> Permission -> Permission
set PropertyType "CertificateAuthorityArn" Permission
newValue Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
    = Permission {certificateAuthorityArn :: Value Text
certificateAuthorityArn = PropertyType "CertificateAuthorityArn" Permission
Value Text
newValue, Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
instance Property "Principal" Permission where
  type PropertyType "Principal" Permission = Value Prelude.Text
  set :: PropertyType "Principal" Permission -> Permission -> Permission
set PropertyType "Principal" Permission
newValue Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
    = Permission {principal :: Value Text
principal = PropertyType "Principal" Permission
Value Text
newValue, Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
sourceAccount :: Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
sourceAccount :: Maybe (Value Text)
..}
instance Property "SourceAccount" Permission where
  type PropertyType "SourceAccount" Permission = Value Prelude.Text
  set :: PropertyType "SourceAccount" Permission -> Permission -> Permission
set PropertyType "SourceAccount" Permission
newValue Permission {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: Permission -> ()
actions :: Permission -> ValueList Text
certificateAuthorityArn :: Permission -> Value Text
principal :: Permission -> Value Text
sourceAccount :: Permission -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
sourceAccount :: Maybe (Value Text)
..}
    = Permission {sourceAccount :: Maybe (Value Text)
sourceAccount = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SourceAccount" Permission
Value Text
newValue, ()
ValueList Text
Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
certificateAuthorityArn :: Value Text
principal :: Value Text
..}