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

Public Member Functions

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

Data Fields

 api_declaration
 
 description
 
 file
 
 path
 

Static Public Attributes

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

Detailed Description

Model of an API listing in the resources.json file.

Definition at line 690 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Definition at line 696 of file swagger_model.py.

696 def __init__(self):
697 self.path = None
698 self.description = None
699 self.api_declaration = None
700

Member Function Documentation

◆ load()

def load (   self,
  api_json,
  processor,
  context 
)

Definition at line 701 of file swagger_model.py.

701 def load(self, api_json, processor, context):
702 context = context.next_stack(api_json, 'path')
703 validate_required_fields(api_json, self.required_fields, context)
704 self.path = api_json['path'].replace('{format}', 'json')
705 self.description = api_json['description']
706
707 if not self.path or self.path[0] != '/':
708 raise SwaggerError("Path must start with /", context)
709 processor.process_resource_api(self, context)
710 return self
711
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
Definition: func_strings.c:888
def validate_required_fields(json, required_fields, context)

References manager_action.description, ast_module_info.description, ast_switch.description, stasis_subscription_change.description, 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, ast_fax_tech.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, ast_bucket_file.path, ast_sip_contact.path, path_lock.path, ast_uri.path, Api.path, ResourceApi.path, replace(), 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 ApiDeclaration.load_file(), and ResourceListing.load_file().

◆ load_api_declaration()

def load_api_declaration (   self,
  base_dir,
  processor 
)

Definition at line 712 of file swagger_model.py.

712 def load_api_declaration(self, base_dir, processor):
713 self.file = (base_dir + self.path)
714 self.api_declaration = ApiDeclaration().load_file(self.file, processor)
715 processor.process_resource_api(self, [self.file])
716
717
static int load_file(const char *filename, char **ret)
Read a TEXT file into a string and return the length.

Field Documentation

◆ api_declaration

api_declaration

Definition at line 699 of file swagger_model.py.

◆ description

description

◆ file

file

Definition at line 713 of file swagger_model.py.

◆ path

path

Definition at line 697 of file swagger_model.py.

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

◆ required_fields

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

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