MCPcopy
hub / github.com/apache/caldera / PlannerSchema

Class PlannerSchema

app/objects/c_planner.py:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class PlannerSchema(ma.Schema):
11 planner_id = ma.fields.String(data_key='id')
12 name = ma.fields.String()
13 module = ma.fields.String()
14 params = ma.fields.Dict()
15 description = ma.fields.String()
16 stopping_conditions = ma.fields.List(ma.fields.Nested(FactSchema()))
17 ignore_enforcement_modules = ma.fields.List(ma.fields.String())
18 allow_repeatable_abilities = ma.fields.Boolean()
19 plugin = ma.fields.String(load_default=None)
20
21 @ma.pre_load
22 def fix_id(self, data, **_):
23 if 'planner_id' in data:
24 data['id'] = data.pop('planner_id')
25 return data
26
27 @ma.post_load()
28 def build_planner(self, data, **kwargs):
29 return None if kwargs.get('partial') is True else Planner(**data)
30
31
32class Planner(FirstClassObjectInterface, BaseObject):

Callers 5

OperationSchemaClass · 0.90
test_plannerFunction · 0.90
test_operationFunction · 0.90
PlannerClass · 0.85

Calls 1

FactSchemaClass · 0.90

Tested by 2

test_plannerFunction · 0.72
test_operationFunction · 0.72