Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
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

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

Data Fields

 api_declaration
 
 description
 
 file
 
 path
 
 required_fields
 

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__()

__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()

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)

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

◆ load_api_declaration()

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

Definition at line 704 of file swagger_model.py.

◆ file

file

Definition at line 719 of file swagger_model.py.

◆ path

path

Definition at line 703 of file swagger_model.py.

◆ required_fields [1/2]

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

Definition at line 700 of file swagger_model.py.

◆ required_fields [2/2]

required_fields

Definition at line 709 of file swagger_model.py.


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