Skip to content

Commit 23cbc8b

Browse files
Disabled media url encoding, mfa schema update (#16)
* New deploy * Update APIController.php * Update APIController.php Co-authored-by: DX-Bandwidth <[email protected]>
1 parent 1f88cd2 commit 23cbc8b

9 files changed

+154
-54
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ License:
33
The MIT License (MIT)
44
http://opensource.org/licenses/MIT
55

6-
Copyright (c) 2014 - 2016 APIMATIC Limited
6+
Copyright (c) 2014 - 2020 APIMATIC Limited
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal

src/Controllers/BaseController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class BaseController
2222
* User-agent to be sent with API calls
2323
* @var string
2424
*/
25-
const USER_AGENT = 'php-sdk-refs/tags/phpold2.13.3';
25+
const USER_AGENT = 'php-sdk';
2626

2727
/**
2828
* HttpCallBack instance associated with this controller

src/Messaging/Controllers/APIController.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ public function uploadMedia(
233233

234234
//process optional query parameters
235235
$_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (
236-
'userId' => $userId,
237-
'mediaId' => $mediaId,
238-
));
236+
'userId' => $userId,
237+
'mediaId' => $mediaId,
238+
), false
239+
);
239240

240241
//validate and preprocess url
241242
$_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder);
@@ -327,7 +328,8 @@ public function deleteMedia(
327328
$_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (
328329
'userId' => $userId,
329330
'mediaId' => $mediaId,
330-
));
331+
), false
332+
);
331333

332334
//validate and preprocess url
333335
$_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder);

src/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.php

+5-23
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
1919
*/
2020
public $to;
2121

22-
/**
23-
* The application phone number, the sender of the 2fa code.
24-
* @required
25-
* @var string $from public property
26-
*/
27-
public $from;
28-
2922
/**
3023
* The application unique ID, obtained from Bandwidth.
3124
* @required
@@ -40,13 +33,6 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
4033
*/
4134
public $scope;
4235

43-
/**
44-
* The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively.
45-
* @required
46-
* @var double $digits public property
47-
*/
48-
public $digits;
49-
5036
/**
5137
* The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean
5238
* any code generated within the last 3 minutes are still valid. The valid range for expiration time
@@ -68,14 +54,12 @@ class TwoFactorVerifyRequestSchema implements \JsonSerializable
6854
*/
6955
public function __construct()
7056
{
71-
if (7 == func_num_args()) {
57+
if (5 == func_num_args()) {
7258
$this->to = func_get_arg(0);
73-
$this->from = func_get_arg(1);
74-
$this->applicationId = func_get_arg(2);
75-
$this->scope = func_get_arg(3);
76-
$this->digits = func_get_arg(4);
77-
$this->expirationTimeInMinutes = func_get_arg(5);
78-
$this->code = func_get_arg(6);
59+
$this->applicationId = func_get_arg(1);
60+
$this->scope = func_get_arg(2);
61+
$this->expirationTimeInMinutes = func_get_arg(3);
62+
$this->code = func_get_arg(4);
7963
}
8064
}
8165

@@ -86,10 +70,8 @@ public function jsonSerialize()
8670
{
8771
$json = array();
8872
$json['to'] = $this->to;
89-
$json['from'] = $this->from;
9073
$json['applicationId'] = $this->applicationId;
9174
$json['scope'] = $this->scope;
92-
$json['digits'] = $this->digits;
9375
$json['expirationTimeInMinutes'] = $this->expirationTimeInMinutes;
9476
$json['code'] = $this->code;
9577

src/Voice/Controllers/APIController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1650,9 +1650,9 @@ public function getConferenceById(
16501650
/**
16511651
* Modify the conference state
16521652
*
1653-
* @param string $accountId TODO: type description here
1654-
* @param string $conferenceId TODO: type description here
1655-
* @param Models\CallEngineModifyConferenceRequest $body (optional) TODO: type description here
1653+
* @param string $accountId TODO: type description here
1654+
* @param string $conferenceId TODO: type description here
1655+
* @param Models\ApiModifyConferenceRequest $body (optional) TODO: type description here
16561656
* @return ApiResponse response from the API call
16571657
* @throws APIException Thrown if API call fails
16581658
*/

src/Voice/Models/ApiCreateCallRequest.php

+28-18
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ class ApiCreateCallRequest implements \JsonSerializable
2020
public $from;
2121

2222
/**
23-
* Format is E164
23+
* Format is E164 or SIP URI
2424
* @required
2525
* @var string $to public property
2626
*/
2727
public $to;
2828

29+
/**
30+
* When calling a SIP URI, this will be sent as the 'User-To-User' header within the initial INVITE. An
31+
* 'encoding' parameter must be specified as described in https://tools.ietf.org/html/rfc7433. This
32+
* header cannot exceed 256 characters, including the encoding parameter.
33+
* @var string|null $uui public property
34+
*/
35+
public $uui;
36+
2937
/**
3038
* @todo Write general description for this property
3139
* @var double|null $callTimeout public property
@@ -129,25 +137,26 @@ class ApiCreateCallRequest implements \JsonSerializable
129137
*/
130138
public function __construct()
131139
{
132-
if (18 == func_num_args()) {
140+
if (19 == func_num_args()) {
133141
$this->from = func_get_arg(0);
134142
$this->to = func_get_arg(1);
135-
$this->callTimeout = func_get_arg(2);
136-
$this->callbackTimeout = func_get_arg(3);
137-
$this->answerUrl = func_get_arg(4);
138-
$this->answerFallbackUrl = func_get_arg(5);
139-
$this->username = func_get_arg(6);
140-
$this->password = func_get_arg(7);
141-
$this->fallbackUsername = func_get_arg(8);
142-
$this->fallbackPassword = func_get_arg(9);
143-
$this->answerMethod = func_get_arg(10);
144-
$this->answerFallbackMethod = func_get_arg(11);
145-
$this->disconnectUrl = func_get_arg(12);
146-
$this->disconnectMethod = func_get_arg(13);
147-
$this->tag = func_get_arg(14);
148-
$this->applicationId = func_get_arg(15);
149-
$this->obfuscatedTo = func_get_arg(16);
150-
$this->obfuscatedFrom = func_get_arg(17);
143+
$this->uui = func_get_arg(2);
144+
$this->callTimeout = func_get_arg(3);
145+
$this->callbackTimeout = func_get_arg(4);
146+
$this->answerUrl = func_get_arg(5);
147+
$this->answerFallbackUrl = func_get_arg(6);
148+
$this->username = func_get_arg(7);
149+
$this->password = func_get_arg(8);
150+
$this->fallbackUsername = func_get_arg(9);
151+
$this->fallbackPassword = func_get_arg(10);
152+
$this->answerMethod = func_get_arg(11);
153+
$this->answerFallbackMethod = func_get_arg(12);
154+
$this->disconnectUrl = func_get_arg(13);
155+
$this->disconnectMethod = func_get_arg(14);
156+
$this->tag = func_get_arg(15);
157+
$this->applicationId = func_get_arg(16);
158+
$this->obfuscatedTo = func_get_arg(17);
159+
$this->obfuscatedFrom = func_get_arg(18);
151160
}
152161
}
153162

@@ -159,6 +168,7 @@ public function jsonSerialize()
159168
$json = array();
160169
$json['from'] = $this->from;
161170
$json['to'] = $this->to;
171+
$json['uui'] = $this->uui;
162172
$json['callTimeout'] = $this->callTimeout;
163173
$json['callbackTimeout'] = $this->callbackTimeout;
164174
$json['answerUrl'] = $this->answerUrl;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?php
2+
/*
3+
* BandwidthLib
4+
*
5+
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
6+
*/
7+
8+
namespace BandwidthLib\Voice\Models;
9+
10+
/**
11+
* @todo Write general description for this model
12+
*/
13+
class ApiModifyConferenceRequest implements \JsonSerializable
14+
{
15+
/**
16+
* @todo Write general description for this property
17+
* @var string|null $status public property
18+
*/
19+
public $status;
20+
21+
/**
22+
* @todo Write general description for this property
23+
* @var string|null $redirectUrl public property
24+
*/
25+
public $redirectUrl;
26+
27+
/**
28+
* @todo Write general description for this property
29+
* @var string|null $redirectFallbackUrl public property
30+
*/
31+
public $redirectFallbackUrl;
32+
33+
/**
34+
* @todo Write general description for this property
35+
* @var string|null $redirectMethod public property
36+
*/
37+
public $redirectMethod;
38+
39+
/**
40+
* @todo Write general description for this property
41+
* @var string|null $redirectFallbackMethod public property
42+
*/
43+
public $redirectFallbackMethod;
44+
45+
/**
46+
* @todo Write general description for this property
47+
* @var string|null $username public property
48+
*/
49+
public $username;
50+
51+
/**
52+
* @todo Write general description for this property
53+
* @var string|null $password public property
54+
*/
55+
public $password;
56+
57+
/**
58+
* @todo Write general description for this property
59+
* @var string|null $fallbackUsername public property
60+
*/
61+
public $fallbackUsername;
62+
63+
/**
64+
* @todo Write general description for this property
65+
* @var string|null $fallbackPassword public property
66+
*/
67+
public $fallbackPassword;
68+
69+
/**
70+
* Constructor to set initial or default values of member properties
71+
*/
72+
public function __construct()
73+
{
74+
if (9 == func_num_args()) {
75+
$this->status = func_get_arg(0);
76+
$this->redirectUrl = func_get_arg(1);
77+
$this->redirectFallbackUrl = func_get_arg(2);
78+
$this->redirectMethod = func_get_arg(3);
79+
$this->redirectFallbackMethod = func_get_arg(4);
80+
$this->username = func_get_arg(5);
81+
$this->password = func_get_arg(6);
82+
$this->fallbackUsername = func_get_arg(7);
83+
$this->fallbackPassword = func_get_arg(8);
84+
}
85+
}
86+
87+
/**
88+
* Encode this object to JSON
89+
*/
90+
public function jsonSerialize()
91+
{
92+
$json = array();
93+
$json['status'] = $this->status;
94+
$json['redirectUrl'] = $this->redirectUrl;
95+
$json['redirectFallbackUrl'] = $this->redirectFallbackUrl;
96+
$json['redirectMethod'] = $this->redirectMethod;
97+
$json['redirectFallbackMethod'] = $this->redirectFallbackMethod;
98+
$json['username'] = $this->username;
99+
$json['password'] = $this->password;
100+
$json['fallbackUsername'] = $this->fallbackUsername;
101+
$json['fallbackPassword'] = $this->fallbackPassword;
102+
103+
return array_filter($json);
104+
}
105+
}

src/Voice/Models/ModifyCallRecordingState.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class ModifyCallRecordingState implements \JsonSerializable
1414
{
1515
/**
1616
* @todo Write general description for this property
17-
* @var string|null $state public property
17+
* @required
18+
* @var string $state public property
1819
*/
1920
public $state;
2021

src/Voice/Models/StateEnum.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class StateEnum
1515
/**
1616
* TODO: Write general description for this element
1717
*/
18-
const DISCONNECTED = "disconnected";
18+
const DISCONNECTED = "DISCONNECTED";
1919

2020
/**
2121
* TODO: Write general description for this element
2222
*/
23-
const ANSWERED = "answered";
23+
const ANSWERED = "ANSWERED";
2424

2525
/**
2626
* TODO: Write general description for this element
2727
*/
28-
const INITIATED = "initiated";
28+
const INITIATED = "INITIATED";
2929
}

0 commit comments

Comments
 (0)