Asterisk - The Open Source Telephony Project  21.4.1
Public Member Functions | Properties
ParsingContext Class Reference
Inheritance diagram for ParsingContext:

Public Member Functions

def __init__ (self, swagger_version, stack)
 
def __repr__ (self)
 
def get_stack (self)
 
def get_swagger_version (self)
 
def next
 
def next_stack (self, json, id_field)
 
def version_less_than (self, ver)
 

Properties

 stack = property(get_stack)
 
 swagger_version = property(get_swagger_version)
 

Detailed Description

Context information for parsing.

This object is immutable. To change contexts (like adding an item to the
stack), use the next() and next_stack() functions to build a new one.

Definition at line 82 of file swagger_model.py.

Member Function Documentation

def next_stack (   self,
  json,
  id_field 
)
Returns a new item pushed to the stack.

@param json: Current JSON object.
@param id_field: Field identifying this object.
@return New context with additional item in the stack.

Definition at line 110 of file swagger_model.py.

References ParsingContext.stack, ast_xmpp_client.stack, ParsingContext.swagger_version, ast_sip_api_tech.version, dundi_ies.version, dialog_info_xml_state.version, iax_ies.version, hashhdr.version, ast_threadpool_options.version, ast_xmpp_capabilities.version, ast_fax_t38_parameters.version, ast_websocket_protocol.version, ast_cel_event_record.version, ast_security_event_common.version, ast_aoc_encoded.version, ast_framehook_interface.version, ast_fax_tech.version, ast_iax2_firmware_header.version, _btmeta.version, adsi_funcs.version, ast_control_t38_parameters.version, version, ast_sip_subscription.version, ast_chan_write_info_t.version, and websocket_client.version.

110  def next_stack(self, json, id_field):
111  """Returns a new item pushed to the stack.
112 
113  @param json: Current JSON object.
114  @param id_field: Field identifying this object.
115  @return New context with additional item in the stack.
116  """
117  if not id_field in json:
118  raise SwaggerError("Missing id_field: %s" % id_field, self)
119  new_stack = self.stack + ['%s=%s' % (id_field, str(json[id_field]))]
120  return ParsingContext(self.swagger_version, new_stack)
121 
def next_stack(self, json, id_field)

The documentation for this class was generated from the following file: