1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
<?php
class Services_Twilio_Auth_VoiceGrant implements Services_Twilio_Auth_Grant {
private $outgoingApplicationSid; private $outgoingApplicationParams; private $pushCredentialSid; private $endpointId;
/** * Returns the outgoing application sid * * @return string the outgoing application sid */ public function getOutgoingApplicationSid() { return $this->outgoingApplicationSid; }
/** * Set the outgoing application sid of the grant * * @param string $outgoingApplicationSid outgoing application sid of grant * * @return $this updated grant */ public function setOutgoingApplicationSid($outgoingApplicationSid) { $this->outgoingApplicationSid = $outgoingApplicationSid; return $this; }
/** * Returns the outgoing application params * * @return array the outgoing application params */ public function getOutgoingApplicationParams() { return $this->outgoingApplicationParams; }
/** * Set the outgoing application of the the grant * * @param string $sid outgoing application sid of the grant * @param string $params params to pass the the application * * @return $this updated grant */ public function setOutgoingApplication($sid, $params) { $this->outgoingApplicationSid = $sid; $this->outgoingApplicationParams = $params; return $this; }
/** * Returns the push credential sid * * @return string the push credential sid */ public function getPushCredentialSid() { return $this->pushCredentialSid; }
/** * Set the push credential sid * * @param string $pushCredentialSid * * @return $this updated grant */ public function setPushCredentialSid($pushCredentialSid) { $this->pushCredentialSid = $pushCredentialSid; return $this; }
/** * Returns the endpoint id * * @return string the endpoint id */ public function getEndpointId() { return $this->endpointId; }
/** * Set the endpoint id * * @param string $endpointId endpoint id * * @return $this updated grant */ public function setEndpointId($endpointId) { $this->endpointId = $endpointId; return $this; }
/** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "voice"; }
/** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->outgoingApplicationSid) { $outgoing = array(); $outgoing['application_sid'] = $this->outgoingApplicationSid;
if ($this->outgoingApplicationParams) { $outgoing['params'] = $this->outgoingApplicationParams; }
$payload['outgoing'] = $outgoing; }
if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; }
if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; }
return $payload; }
}
|