mightstone.services.wotc.models.ComprehensiveRules

pydantic model mightstone.services.wotc.models.ComprehensiveRules

Show JSON schema
{
   "title": "ComprehensiveRules",
   "type": "object",
   "properties": {
      "id": {
         "anyOf": [
            {
               "format": "uuid",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Id"
      },
      "effective": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Effective"
      },
      "ruleset": {
         "allOf": [
            {
               "$ref": "#/$defs/Ruleset"
            }
         ],
         "default": {
            "rules": {},
            "last_rule": null
         }
      },
      "glossary": {
         "allOf": [
            {
               "$ref": "#/$defs/Glossary"
            }
         ],
         "default": {
            "terms": {}
         }
      }
   },
   "$defs": {
      "Glossary": {
         "properties": {
            "terms": {
               "additionalProperties": {
                  "$ref": "#/$defs/Term"
               },
               "default": {},
               "title": "Terms",
               "type": "object"
            }
         },
         "title": "Glossary",
         "type": "object"
      },
      "Rule": {
         "properties": {
            "ref": {
               "title": "Ref",
               "type": "string"
            },
            "text": {
               "title": "Text",
               "type": "string"
            },
            "examples": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Examples",
               "type": "array"
            }
         },
         "required": [
            "ref",
            "text"
         ],
         "title": "Rule",
         "type": "object"
      },
      "Ruleset": {
         "properties": {
            "rules": {
               "additionalProperties": {
                  "$ref": "#/$defs/Rule"
               },
               "default": {},
               "title": "Rules",
               "type": "object"
            },
            "last_rule": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Rule"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "Ruleset",
         "type": "object"
      },
      "Term": {
         "properties": {
            "term": {
               "title": "Term",
               "type": "string"
            },
            "description": {
               "title": "Description",
               "type": "string"
            }
         },
         "required": [
            "term",
            "description"
         ],
         "title": "Term",
         "type": "object"
      }
   }
}

Fields:
Validators:
field effective: Effectiveness | None = None
Validated by:
field glossary: Glossary = Glossary(terms={})
Validated by:
field id: UUID | None = None
Validated by:
field ruleset: Ruleset = Ruleset(rules={}, last_rule=None)
Validated by:
diff(cr: ComprehensiveRules)

Compare two comprehensive rule set for change in rules and terms

For both, terms and rules, provide a dict for:
  • added a dict of added object

  • changed a dict of dict (before/after) object

  • removed a dict of removed object

Parameters:

cr – An other comprehensive rule set to compare

Returns:

a dict of changes

validator enforce_id  »  all fields
classmethod parse(buffer: TextIO)
search(string)