Asterisk - The Open Source Telephony Project GIT-master-754dea3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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 696 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Definition at line 702 of file swagger_model.py.

702 def __init__(self):
703 self.path = None
704 self.description = None
705 self.api_declaration = None
706

Member Function Documentation

◆ load()

def load (   self,
  api_json,
  processor,
  context 
)

Definition at line 707 of file swagger_model.py.

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

References iax2_peer.description, stasis_subscription_change.description, dahdi_pvt.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, 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_sip_contact.path, path_lock.path, config_included_file.path, ast_bucket_file.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 718 of file swagger_model.py.

718 def load_api_declaration(self, base_dir, processor):
719 self.file = (base_dir + self.path)
720 self.api_declaration = ApiDeclaration().load_file(self.file, processor)
721 processor.process_resource_api(self, [self.file])
722
723
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 705 of file swagger_model.py.

◆ description

description

◆ file

file

Definition at line 719 of file swagger_model.py.

◆ path

path

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