File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed
bandwidth/models/bxml/verbs Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 11from .bridge import Bridge
22from .conference import Conference
3+ from .connect import Connect
34from .custom_param import CustomParam
5+ from .endpoint import Endpoint
46from .forward import Forward
57from .gather import Gather
68from .hangup import Hangup
Original file line number Diff line number Diff line change 1+ """
2+ connect.py
3+
4+ Bandwidth's Connect BXML verb
5+
6+ @copyright Bandwidth INC
7+ """
8+ from typing import Union
9+
10+ from ..nestable_verb import NestableVerb
11+ from ..verbs .endpoint import Endpoint
12+
13+
14+ class Connect (NestableVerb ):
15+
16+ def __init__ (
17+ self , destination : Union [Endpoint , None ] = None ,
18+ event_callback_url : str = None
19+ ):
20+ """Initialize a <Connect> verb
21+
22+ Args:
23+ destination (Endpoint, optional): The endpoint destination to connect to. Defaults to None.
24+ event_callback_url (str, optional): URL to send events to for this Connect verb. Defaults to None.
25+ """
26+ self .destination = destination
27+ self .event_callback_url = event_callback_url
28+
29+ nested_verbs = []
30+ if destination is not None :
31+ nested_verbs .append (destination )
32+
33+ super ().__init__ (
34+ tag = "Connect" ,
35+ nested_verbs = nested_verbs
36+ )
37+
38+ @property
39+ def _attributes (self ):
40+ return {
41+ "eventCallbackUrl" : self .event_callback_url
42+ }
Original file line number Diff line number Diff line change 1+ """
2+ endpoint.py
3+
4+ Bandwidth's Endpoint BXML verb (used within Connect)
5+
6+ @copyright Bandwidth INC
7+ """
8+ from ..verb import Verb
9+
10+
11+ class Endpoint (Verb ):
12+
13+ def __init__ (self , endpoint_id : str ):
14+ """Initialize an <Endpoint> verb
15+
16+ Args:
17+ endpoint_id (str): The ID of the endpoint to connect to.
18+ """
19+ self .endpoint_id = endpoint_id
20+ super ().__init__ (
21+ tag = "Endpoint" ,
22+ content = endpoint_id
23+ )
24+
25+ @property
26+ def _attributes (self ):
27+ return None
You can’t perform that action at this time.
0 commit comments