Asterisk - The Open Source Telephony Project GIT-master-f36a736
Public Member Functions | Data Fields | Static Public Attributes
Api Class Reference
Inheritance diagram for Api:
Inheritance graph
[legend]
Collaboration diagram for Api:
Collaboration graph
[legend]

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 432 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Definition at line 440 of file swagger_model.py.

440 def __init__(self,):
441 self.path = None
442 self.description = None
443 self.operations = []
444

Member Function Documentation

◆ load()

def load (   self,
  api_json,
  processor,
  context 
)

Definition at line 445 of file swagger_model.py.

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

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

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

Field Documentation

◆ description

description

◆ has_websocket

has_websocket

Definition at line 453 of file swagger_model.py.

◆ operations

operations

Definition at line 443 of file swagger_model.py.

Referenced by Api.load().

◆ path

path

Definition at line 441 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: