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

Public Member Functions

def __init__ (self, name, parent)
 
def children (self)
 
def get_child (self, path)
 
def num_children (self)
 
- Public Member Functions inherited from Stringify
def __repr__ (self)
 

Data Fields

 full_name
 
 is_wildcard
 
 name
 
 operations
 

Detailed Description

Tree representation of a Swagger API declaration.

Definition at line 70 of file asterisk_processor.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  parent 
)
Ctor.

@param name: Name of this path segment. May have {pathVar} markers.
@param parent: Parent PathSegment.

Definition at line 73 of file asterisk_processor.py.

73 def __init__(self, name, parent):
74 """Ctor.
75
76 @param name: Name of this path segment. May have {pathVar} markers.
77 @param parent: Parent PathSegment.
78 """
79 #: Segment name, with {pathVar} markers removed
80 self.name = simple_name(name)
81 #: True if segment is a {pathVar}, else None.
82 self.is_wildcard = None
83 #: Underscore seperated name all ancestor segments
84 self.full_name = None
85 #: Dictionary of child PathSegements
86 self.__children = OrderedDict()
87 #: List of operations on this segement
88 self.operations = []
89
90 if self.name != name:
91 self.is_wildcard = True
92
93 if not self.name:
94 assert(not parent)
95 self.full_name = ''
96 if not parent or not parent.name:
97 self.full_name = name
98 else:
99 self.full_name = "%s_%s" % (parent.full_name, self.name)
100

Member Function Documentation

◆ children()

def children (   self)
Gets list of children.

Definition at line 116 of file asterisk_processor.py.

116 def children(self):
117 """Gets list of children.
118 """
119 return self.__children.values()
120

References PathSegment.__children.

◆ get_child()

def get_child (   self,
  path 
)
Walks descendants to get path, creating it if necessary.

@param path: List of path names.
@return: PageSegment corresponding to path.

Definition at line 101 of file asterisk_processor.py.

101 def get_child(self, path):
102 """Walks descendants to get path, creating it if necessary.
103
104 @param path: List of path names.
105 @return: PageSegment corresponding to path.
106 """
107 assert simple_name(path[0]) == self.name
108 if (len(path) == 1):
109 return self
110 child = self.__children.get(path[1])
111 if not child:
112 child = PathSegment(path[1], self)
113 self.__children[path[1]] = child
114 return child.get_child(path[1:])
115
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)

References PathSegment.__children, len(), columns.name, tables.name, adsi_event.name, adsi_key_cmd.name, wait_bridge_wrapper.name, multi_autochan.name, pickup_by_name_args.name, mixmonitor.name, strategy.name, autopause.name, call_queue.name, skel_level.name, sla_trunk.name, wait_type.name, confbridge_state.name, console_pvt.name, name, iax2_user.name, iax2_peer.name, jingle_endpoint.name, grab_desc.name, iax2_ie.name, iax_flag.name, video_codec_desc.name, Vardesc.name, Namelist.name, lock_frame.name, dsn.name, ael_extension.name, ast_bridge_methods.name, ast_bridge_snapshot.name, ast_bridge.name, ast_bridge_technology.name, ast_bucket_metadata.name, ast_calendar.name, ast_party_id.name, ast_set_party_id.name, aco_type.name, ast_aeap_message_type.name, ast_var_t.name, ast_codec.name, ast_variable.name, ast_config_engine.name, ast_dns_query.name, ast_dns_query_recurring.name, ast_dns_resolver.name, ast_applicationmap_item.name, ast_websocket_protocol.name, ast_imager.name, ast_tone_zone_sound.name, ast_msg_tech.name, ast_msg_handler.name, ast_module_info.name, ast_custom_function.name, ast_switch.name, ast_refer_tech.name, ast_aeap_message_handler.name, odbc_cache_columns.name, ast_sip_contact_status.name, ooh323_user.name, ooh323_peer.name, minivm_template.name, minivm_zone.name, rule_list.name, vm_zone.name, unistim_line.name, ast_netsock.name, iax_template.name, ast_format_def.name, ast_acl.name, group_entry.name, ast_jb_impl.name, signalitem.name, directory_item.name, ast_unreal_pvt.name, call_followme.name, group.name, unistim_device.name, confbridge_conference.name, conf_menu.name, user_profile.name, bridge_profile.name, ast_sip_cli_formatter_entry.name, prometheus_metrics_provider.name, prometheus_label.name, prometheus_metric.name, prometheus_callback.name, ast_rtp_engine.name, ast_sip_api_tech.name, ast_smdi_mwi_message.name, ast_smdi_md_message.name, ast_sorcery_wizard.name, ast_speech_engine.name, stasis_app_recording_options.name, ast_channel_snapshot_caller.name, ast_channel_snapshot_connected.name, ast_channel_snapshot_base.name, ast_tcptls_session_args.name, ast_test_info.name, ast_timing_interface.name, ast_xml_doc_item.name, ast_xmpp_client.name, dscp_codepoint.name, profile_entry.name, ast_bucket_scheme.name, cdr_beitem.name, callerid_state.name, ast_translator.name, aoc_ie_currency.name, ast_value_translation.name, cdr_object_fn_table.name, cdr_object.name, cel_backend.name, causes_map.name, namedgroup_member.name, ast_party_id_ies.name, ast_channel.name, ast_config_map.name, ast_category_template_instance.name, ast_category.name, manager_channel_variable.name, cfg_hook.name, aco_option.name, progalias.name, ie_map.name, featuregroup.name, ast_format.name, ast_http_server.name, load_results_map.name, logformatter.name, category_t.name, media_info.name, msg_data.name, ast_exten.name, ast_context.name, ast_include.name, ast_sw.name, refer_data.name, stasis_topic.name, topic_proxy.name, topic_pool_entry.name, stasis_message_type.name, locale_entry.name, ast_stream.name, ast_taskprocessor.name, thr_arg.name, dundi_ie.name, permission.name, direntry.name, ast_ari_bridges_create_args.name, ast_ari_bridges_create_with_id_args.name, ast_ari_bridges_record_args.name, ast_ari_channels_record_args.name, parking_lot_cfg.name, parking_lot.name, bridge_metric_defs.name, channel_metric_defs.name, endpoint_metric_defs.name, category_and_metric.name, realtime_sqlite3_db.name, geoloc_gml_attr_def.name, odbc_txn_frame.name, extension.name, phone_profile.name, endpoint_identifier_list.name, header.name, sip_options_endpoint_aor_status.name, sip_options_endpoint_state_compositor.name, sip_options_aor.name, ast_sip_sched_task.name, exten_state_publisher.name, notify_option_item.name, notify_option.name, ast_key.name, odbc_class.name, method_logging_info.name, named_acl.name, pbx_builtin.name, moh_files_state.name, mohclass.name, ast_sorcery_object_field.name, ast_sorcery_object_type.name, ast_smdi_interface.name, state.name, sorcery_memory_cache.name, speech_param.name, enum_name_xref_entry.name, ast_xmpp_client_config.name, stasis_app.name, chanvar.name, stasis_app_stored_recording.name, PathSegment.name, Parameter.name, SwaggerType.name, Property.name, cid_set.name, pair.name, test_item.name, test1.name, test_val.name, test.name, namelist.name, ast_chan.name, and asterisk_processor.simple_name().

◆ num_children()

def num_children (   self)
Gets count of children.

Definition at line 121 of file asterisk_processor.py.

121 def num_children(self):
122 """Gets count of children.
123 """
124 return len(self.__children)
125
126

References PathSegment.__children, and len().

Field Documentation

◆ full_name

full_name

Definition at line 84 of file asterisk_processor.py.

◆ is_wildcard

is_wildcard

Definition at line 82 of file asterisk_processor.py.

◆ name

name

◆ operations

operations

Definition at line 88 of file asterisk_processor.py.

Referenced by Api.load().


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