Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes
Parameter Class Reference
Inheritance diagram for Parameter:
Inheritance graph
[legend]
Collaboration diagram for Parameter:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self)
 
 is_type (self, other_type)
 
 load (self, parameter_json, processor, context)
 
- Public Member Functions inherited from Stringify
 __repr__ (self)
 

Data Fields

 allow_multiple
 
 allowable_values
 
 data_type
 
 default_value
 
 description
 
 name
 
 param_type
 
 required
 
 required_fields
 

Static Public Attributes

list required_fields = ['name', 'paramType', 'dataType']
 

Detailed Description

Model of an operation's parameter.

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

Definition at line 266 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self)

Definition at line 274 of file swagger_model.py.

274 def __init__(self):
275 self.param_type = None
276 self.name = None
277 self.description = None
278 self.data_type = None
279 self.required = None
280 self.allowable_values = None
281 self.allow_multiple = None
282

Member Function Documentation

◆ is_type()

is_type (   self,
  other_type 
)

Definition at line 302 of file swagger_model.py.

302 def is_type(self, other_type):
303 return self.param_type == other_type
304
305

References Parameter.param_type.

◆ load()

load (   self,
  parameter_json,
  processor,
  context 
)

Definition at line 283 of file swagger_model.py.

283 def load(self, parameter_json, processor, context):
284 context = context.next_stack(parameter_json, 'name')
285 validate_required_fields(parameter_json, self.required_fields, context)
286 self.name = parameter_json.get('name')
287 self.param_type = parameter_json.get('paramType')
288 self.description = parameter_json.get('description') or ''
289 self.data_type = parameter_json.get('dataType')
290 self.required = parameter_json.get('required') or False
291 self.default_value = parameter_json.get('defaultValue')
292 self.allowable_values = load_allowable_values(
293 parameter_json.get('allowableValues'), context)
294 self.allow_multiple = parameter_json.get('allowMultiple') or False
295 processor.process_parameter(self, context)
296 if parameter_json.get('allowedValues'):
297 raise SwaggerError(
298 "Field 'allowedValues' invalid; use 'allowableValues'",
299 context)
300 return self
301

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

Field Documentation

◆ allow_multiple

allow_multiple

Definition at line 281 of file swagger_model.py.

◆ allowable_values

allowable_values

Definition at line 280 of file swagger_model.py.

◆ data_type

data_type

Definition at line 278 of file swagger_model.py.

◆ default_value

default_value

Definition at line 291 of file swagger_model.py.

◆ description

description

Definition at line 277 of file swagger_model.py.

◆ name

name

Definition at line 276 of file swagger_model.py.

Referenced by PathSegment.get_child(), and SwaggerType.load().

◆ param_type

Definition at line 275 of file swagger_model.py.

Referenced by Parameter.is_type().

◆ required

required

Definition at line 279 of file swagger_model.py.

◆ required_fields [1/2]

list required_fields = ['name', 'paramType', 'dataType']
static

Definition at line 272 of file swagger_model.py.

◆ required_fields [2/2]

required_fields

Definition at line 285 of file swagger_model.py.


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