module Stratosphere.OpenSearchServerless.SecurityPolicy (
        SecurityPolicy(..), mkSecurityPolicy
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SecurityPolicy
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-securitypolicy.html>
    SecurityPolicy {SecurityPolicy -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-securitypolicy.html#cfn-opensearchserverless-securitypolicy-description>
                    SecurityPolicy -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-securitypolicy.html#cfn-opensearchserverless-securitypolicy-name>
                    SecurityPolicy -> Value Text
name :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-securitypolicy.html#cfn-opensearchserverless-securitypolicy-policy>
                    SecurityPolicy -> Value Text
policy :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchserverless-securitypolicy.html#cfn-opensearchserverless-securitypolicy-type>
                    SecurityPolicy -> Value Text
type' :: (Value Prelude.Text)}
  deriving stock (SecurityPolicy -> SecurityPolicy -> Bool
(SecurityPolicy -> SecurityPolicy -> Bool)
-> (SecurityPolicy -> SecurityPolicy -> Bool) -> Eq SecurityPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SecurityPolicy -> SecurityPolicy -> Bool
== :: SecurityPolicy -> SecurityPolicy -> Bool
$c/= :: SecurityPolicy -> SecurityPolicy -> Bool
/= :: SecurityPolicy -> SecurityPolicy -> Bool
Prelude.Eq, Int -> SecurityPolicy -> ShowS
[SecurityPolicy] -> ShowS
SecurityPolicy -> String
(Int -> SecurityPolicy -> ShowS)
-> (SecurityPolicy -> String)
-> ([SecurityPolicy] -> ShowS)
-> Show SecurityPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SecurityPolicy -> ShowS
showsPrec :: Int -> SecurityPolicy -> ShowS
$cshow :: SecurityPolicy -> String
show :: SecurityPolicy -> String
$cshowList :: [SecurityPolicy] -> ShowS
showList :: [SecurityPolicy] -> ShowS
Prelude.Show)
mkSecurityPolicy ::
  Value Prelude.Text
  -> Value Prelude.Text -> Value Prelude.Text -> SecurityPolicy
mkSecurityPolicy :: Value Text -> Value Text -> Value Text -> SecurityPolicy
mkSecurityPolicy Value Text
name Value Text
policy Value Text
type'
  = SecurityPolicy
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name, policy :: Value Text
policy = Value Text
policy,
       type' :: Value Text
type' = Value Text
type', description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SecurityPolicy where
  toResourceProperties :: SecurityPolicy -> ResourceProperties
toResourceProperties SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::OpenSearchServerless::SecurityPolicy",
         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
"Name" 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
name, Key
"Policy" 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
policy,
                            Key
"Type" 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
type']
                           ([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
"Description" (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)
description]))}
instance JSON.ToJSON SecurityPolicy where
  toJSON :: SecurityPolicy -> Value
toJSON SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: 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
"Name" 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
name, Key
"Policy" 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
policy,
               Key
"Type" 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
type']
              ([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
"Description" (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)
description])))
instance Property "Description" SecurityPolicy where
  type PropertyType "Description" SecurityPolicy = Value Prelude.Text
  set :: PropertyType "Description" SecurityPolicy
-> SecurityPolicy -> SecurityPolicy
set PropertyType "Description" SecurityPolicy
newValue SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
    = SecurityPolicy {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" SecurityPolicy
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
name :: Value Text
policy :: Value Text
type' :: Value Text
haddock_workaround_ :: ()
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
instance Property "Name" SecurityPolicy where
  type PropertyType "Name" SecurityPolicy = Value Prelude.Text
  set :: PropertyType "Name" SecurityPolicy
-> SecurityPolicy -> SecurityPolicy
set PropertyType "Name" SecurityPolicy
newValue SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
    = SecurityPolicy {name :: Value Text
name = PropertyType "Name" SecurityPolicy
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
policy :: Value Text
type' :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
policy :: Value Text
type' :: Value Text
..}
instance Property "Policy" SecurityPolicy where
  type PropertyType "Policy" SecurityPolicy = Value Prelude.Text
  set :: PropertyType "Policy" SecurityPolicy
-> SecurityPolicy -> SecurityPolicy
set PropertyType "Policy" SecurityPolicy
newValue SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
    = SecurityPolicy {policy :: Value Text
policy = PropertyType "Policy" SecurityPolicy
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
type' :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
type' :: Value Text
..}
instance Property "Type" SecurityPolicy where
  type PropertyType "Type" SecurityPolicy = Value Prelude.Text
  set :: PropertyType "Type" SecurityPolicy
-> SecurityPolicy -> SecurityPolicy
set PropertyType "Type" SecurityPolicy
newValue SecurityPolicy {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: SecurityPolicy -> ()
description :: SecurityPolicy -> Maybe (Value Text)
name :: SecurityPolicy -> Value Text
policy :: SecurityPolicy -> Value Text
type' :: SecurityPolicy -> Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
type' :: Value Text
..}
    = SecurityPolicy {type' :: Value Text
type' = PropertyType "Type" SecurityPolicy
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
policy :: Value Text
..}