class RamlQueryParameter(Model): name = String() description = String() example = Or(String(),Int(),Float()) displayName = String() type = String() enum = List(Or(String(),Float(),Int())) pattern = String() minLength = Int() maxLength = Int() repeat = Bool() required = Bool() default = Or(String(),Int(),Float()) minimum = Or(Int(),Float()) maximum = Or(Int(),Float())
class RamlNamedParameters(Model): """ http://raml.org/spec.html#named-parameters """ displayName = String() description = String() type = Choice(default='string', choices=NAMED_PARAMETER_TYPES) name = String() example = Or(String(), Int(), Float()) enum = List(Or(String(), Float(), Int())) pattern = String() minLength = Int() maxLength = Int() repeat = Bool() required = Bool() default = Or(String(), Int(), Float()) minimum = Or(Int(), Float()) maximum = Or(Int(), Float())
class RamlRoot(SecuredEntity, Model): """ http://raml.org/spec.html#root-section """ raml_version = String(required=True) title = String(required=True) version = Or(String(), Int(), Float()) baseUri = String(required=True) protocols = List( Choice(field_name='protocols', choices=RAML_VALID_PROTOCOLS)) mediaType = String() documentation = List(Reference(RamlDocumentation)) traits = Map(String(), Reference(RamlTrait)) resources = Map(String(), Reference(RamlResource)) resourceTypes = Map(String(), Reference(RamlResourceType)) schemas = Map(String(), Or(JSONData(), XMLData(), String())) baseUriParameters = RamlNamedParametersMap() securitySchemes = Map(String(), Reference(RamlSecurityScheme))
class RamlBody(Model): """ A method's body is defined in the body property as a hashmap, in which the key MUST be a valid media type. """ schema = Or(JSONData(), XMLData(), String()) example = String() notNull = Bool() formParameters = RamlNamedParametersMap()
class SecuredEntity(object): # [foo, {bar: {baz: [buz]}}, null] securedBy = List( Or(String(), Map(String(), Map(String(), List(String()))), Null()))
class ResourceTypedEntity(object): """ Represents entities that may have resourceTypes specified in ``type`` field. """ type = Or(String(), Map(String(), Map(String(), String())))
class RamlSecurityScheme(Model): """ http://raml.org/spec.html#security """ description = String() type = String() describedBy = Reference(RamlSecuritySchemeDescription) settings = Map(String(), Or(String(), List(String())))
class TraitedEntity(object): """ Represents entities that may have traits specified in ``is`` field. """ is_ = List(Or(String(), Map(String(), Map(String(), String()))), field_name='is')