module Stratosphere.OpenSearchServerless.Index.MappingsProperty (
module Exports, MappingsProperty(..), mkMappingsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.OpenSearchServerless.Index.PropertyMappingProperty as Exports
import Stratosphere.ResourceProperties
data MappingsProperty
=
MappingsProperty {MappingsProperty -> ()
haddock_workaround_ :: (),
MappingsProperty -> Maybe (Map Text PropertyMappingProperty)
properties :: (Prelude.Maybe (Prelude.Map Prelude.Text PropertyMappingProperty))}
deriving stock (MappingsProperty -> MappingsProperty -> Bool
(MappingsProperty -> MappingsProperty -> Bool)
-> (MappingsProperty -> MappingsProperty -> Bool)
-> Eq MappingsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MappingsProperty -> MappingsProperty -> Bool
== :: MappingsProperty -> MappingsProperty -> Bool
$c/= :: MappingsProperty -> MappingsProperty -> Bool
/= :: MappingsProperty -> MappingsProperty -> Bool
Prelude.Eq, Int -> MappingsProperty -> ShowS
[MappingsProperty] -> ShowS
MappingsProperty -> String
(Int -> MappingsProperty -> ShowS)
-> (MappingsProperty -> String)
-> ([MappingsProperty] -> ShowS)
-> Show MappingsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MappingsProperty -> ShowS
showsPrec :: Int -> MappingsProperty -> ShowS
$cshow :: MappingsProperty -> String
show :: MappingsProperty -> String
$cshowList :: [MappingsProperty] -> ShowS
showList :: [MappingsProperty] -> ShowS
Prelude.Show)
mkMappingsProperty :: MappingsProperty
mkMappingsProperty :: MappingsProperty
mkMappingsProperty
= MappingsProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), properties :: Maybe (Map Text PropertyMappingProperty)
properties = Maybe (Map Text PropertyMappingProperty)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MappingsProperty where
toResourceProperties :: MappingsProperty -> ResourceProperties
toResourceProperties MappingsProperty {Maybe (Map Text PropertyMappingProperty)
()
haddock_workaround_ :: MappingsProperty -> ()
properties :: MappingsProperty -> Maybe (Map Text PropertyMappingProperty)
haddock_workaround_ :: ()
properties :: Maybe (Map Text PropertyMappingProperty)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::OpenSearchServerless::Index.Mappings",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Map Text PropertyMappingProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Properties" (Map Text PropertyMappingProperty -> (Key, Value))
-> Maybe (Map Text PropertyMappingProperty) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text PropertyMappingProperty)
properties])}
instance JSON.ToJSON MappingsProperty where
toJSON :: MappingsProperty -> Value
toJSON MappingsProperty {Maybe (Map Text PropertyMappingProperty)
()
haddock_workaround_ :: MappingsProperty -> ()
properties :: MappingsProperty -> Maybe (Map Text PropertyMappingProperty)
haddock_workaround_ :: ()
properties :: Maybe (Map Text PropertyMappingProperty)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Map Text PropertyMappingProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Properties" (Map Text PropertyMappingProperty -> (Key, Value))
-> Maybe (Map Text PropertyMappingProperty) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text PropertyMappingProperty)
properties]))
instance Property "Properties" MappingsProperty where
type PropertyType "Properties" MappingsProperty = Prelude.Map Prelude.Text PropertyMappingProperty
set :: PropertyType "Properties" MappingsProperty
-> MappingsProperty -> MappingsProperty
set PropertyType "Properties" MappingsProperty
newValue MappingsProperty {Maybe (Map Text PropertyMappingProperty)
()
haddock_workaround_ :: MappingsProperty -> ()
properties :: MappingsProperty -> Maybe (Map Text PropertyMappingProperty)
haddock_workaround_ :: ()
properties :: Maybe (Map Text PropertyMappingProperty)
..}
= MappingsProperty {properties :: Maybe (Map Text PropertyMappingProperty)
properties = Map Text PropertyMappingProperty
-> Maybe (Map Text PropertyMappingProperty)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Map Text PropertyMappingProperty
PropertyType "Properties" MappingsProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}