Asterisk - The Open Source Telephony Project  GIT-master-a1fa8df
Public Member Functions | Data Fields | Static Public Attributes
Api Class Reference

Inherits Stringify.

Public Member Functions

def __init__ (self)
 
def load (self, api_json, processor, context)
 
- Public Member Functions inherited from Stringify
def __repr__ (self)
 

Data Fields

 description
 
 has_websocket
 
 operations
 
 path
 

Static Public Attributes

list required_fields = ['path', 'operations']
 

Detailed Description

Model of a single API in an API declaration.

See https://github.com/wordnik/swagger-core/wiki/API-Declaration

Definition at line 427 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Definition at line 435 of file swagger_model.py.

435  def __init__(self,):
436  self.path = None
437  self.description = None
438  self.operations = []
439 

Member Function Documentation

◆ load()

def load (   self,
  api_json,
  processor,
  context 
)

Definition at line 440 of file swagger_model.py.

References ast_codec.description, media_variant.description, ast_app.description, ast_xml_doc_item.description, ast_calendar_tech.description, ast_tone_zone.description, ast_xmpp_resource.description, ast_calendar_event.description, ast_http_uri.description, manager_action.description, ast_switch.description, ast_fax_tech.description, ast_test_info.description, Parameter.description, ast_module_info.description, Api.description, dahdi_pvt.description, iax2_peer.description, ast_channel_tech.description, stasis_subscription_change.description, ast_value_translation.description, sip_peer.description, PathSegment.operations, Api.operations, ast_uri.path, stir_shaken_store.path, stir_shaken_certificate.path, ast_bucket_file.path, ast_sip_contact.path, Api.path, sip_peer.path, path_lock.path, Parameter.required_fields, ErrorResponse.required_fields, Operation.required_fields, Api.required_fields, and swagger_model.validate_required_fields().

Referenced by ApiDeclaration.load_file(), and ResourceListing.load_file().

440  def load(self, api_json, processor, context):
441  context = context.next_stack(api_json, 'path')
442  validate_required_fields(api_json, self.required_fields, context)
443  self.path = api_json.get('path')
444  self.description = api_json.get('description')
445  op_json = api_json.get('operations')
446  self.operations = [
447  Operation().load(j, processor, context) for j in op_json]
448  self.has_websocket = any(op.is_websocket for op in self.operations)
449  processor.process_api(self, context)
450  return self
451 
452 
def validate_required_fields(json, required_fields, context)

Field Documentation

◆ description

description

Definition at line 437 of file swagger_model.py.

Referenced by Api.load(), Property.load(), Model.load(), and ResourceApi.load().

◆ has_websocket

has_websocket

Definition at line 448 of file swagger_model.py.

◆ operations

operations

Definition at line 438 of file swagger_model.py.

Referenced by Api.load().

◆ path

path

Definition at line 436 of file swagger_model.py.

Referenced by Api.load(), and ResourceApi.load().

◆ required_fields

list required_fields = ['path', 'operations']
static

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