Skip to content

Commit 9f106fa

Browse files
committed
update controllers
1 parent a3e6d75 commit 9f106fa

File tree

5 files changed

+48
-48
lines changed

5 files changed

+48
-48
lines changed

src/Messaging/Controllers/APIController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function listMedia(
6262
);
6363

6464
//set HTTP basic auth parameters
65-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
65+
$this->configureAuth($_headers, 'messaging');
6666

6767
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
6868

@@ -151,7 +151,7 @@ public function getMedia(
151151
);
152152

153153
//set HTTP basic auth parameters
154-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
154+
$this->configureAuth($_headers, 'messaging');
155155

156156
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
157157

@@ -252,7 +252,7 @@ public function uploadMedia(
252252
$_bodyJson = $body;
253253

254254
//set HTTP basic auth parameters
255-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
255+
$this->configureAuth($_headers, 'messaging');
256256

257257
$_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);
258258

@@ -341,7 +341,7 @@ public function deleteMedia(
341341
);
342342

343343
//set HTTP basic auth parameters
344-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
344+
$this->configureAuth($_headers, 'messaging');
345345

346346
$_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);
347347

@@ -461,7 +461,7 @@ public function getMessages(
461461
);
462462

463463
//set HTTP basic auth parameters
464-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
464+
$this->configureAuth($_headers, 'messaging');
465465

466466
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
467467

@@ -556,7 +556,7 @@ public function createMessage(
556556
$_bodyJson = Request\Body::Json($body);
557557

558558
//set HTTP basic auth parameters
559-
Request::auth($this->config->getMessagingBasicAuthUserName(), $this->config->getMessagingBasicAuthPassword());
559+
$this->configureAuth($_headers, 'messaging');
560560

561561
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
562562

src/MultiFactorAuth/Controllers/MFAController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function createVoiceTwoFactor(
6666
$_bodyJson = Request\Body::Json($body);
6767

6868
//set HTTP basic auth parameters
69-
Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword());
69+
$this->configureAuth($_headers, 'multiFactorAuth');
7070

7171
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
7272

@@ -160,7 +160,7 @@ public function createMessagingTwoFactor(
160160
$_bodyJson = Request\Body::Json($body);
161161

162162
//set HTTP basic auth parameters
163-
Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword());
163+
$this->configureAuth($_headers, 'multiFactorAuth');
164164

165165
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
166166

@@ -253,7 +253,7 @@ public function createVerifyTwoFactor(
253253
$_bodyJson = Request\Body::Json($body);
254254

255255
//set HTTP basic auth parameters
256-
Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword());
256+
$this->configureAuth($_headers, 'multiFactorAuth');
257257

258258
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
259259

src/PhoneNumberLookup/Controllers/APIController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function createAsyncBulkLookupRequest(
6464
//json encode body
6565
$_bodyJson = Request\Body::Json($body);
6666

67-
//set HTTP basic auth parameters
68-
Request::auth($this->config->getPhoneNumberLookupBasicAuthUserName(), $this->config->getPhoneNumberLookupBasicAuthPassword());
67+
//set authentication
68+
$this->configureAuth($_headers, 'phoneNumberLookup');
6969

7070
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
7171

@@ -169,8 +169,8 @@ public function getAsyncLookupRequestStatus(
169169
'Accept' => 'application/json'
170170
);
171171

172-
//set HTTP basic auth parameters
173-
Request::auth($this->config->getPhoneNumberLookupBasicAuthUserName(), $this->config->getPhoneNumberLookupBasicAuthPassword());
172+
//set authentication
173+
$this->configureAuth($_headers, 'phoneNumberLookup');
174174

175175
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
176176

@@ -277,8 +277,8 @@ public function createSyncLookupRequest(
277277
//json encode body
278278
$_bodyJson = Request\Body::Json($body);
279279

280-
//set HTTP basic auth parameters
281-
Request::auth($this->config->getPhoneNumberLookupBasicAuthUserName(), $this->config->getPhoneNumberLookupBasicAuthPassword());
280+
//set authentication
281+
$this->configureAuth($_headers, 'phoneNumberLookup');
282282

283283
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
284284

src/Voice/Controllers/APIController.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function createCall(
6565
$_bodyJson = Request\Body::Json($body);
6666

6767
//set HTTP basic auth parameters
68-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
68+
$this->configureAuth($_headers, 'voice');
6969

7070
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
7171

@@ -173,7 +173,7 @@ public function getCall(
173173
);
174174

175175
//set HTTP basic auth parameters
176-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
176+
$this->configureAuth($_headers, 'voice');
177177

178178
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
179179

@@ -283,7 +283,7 @@ public function modifyCallBxml(
283283
);
284284

285285
//set HTTP basic auth parameters
286-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
286+
$this->configureAuth($_headers, 'voice');
287287

288288
$_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);
289289

@@ -394,7 +394,7 @@ public function modifyCall(
394394
$_bodyJson = Request\Body::Json($body);
395395

396396
//set HTTP basic auth parameters
397-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
397+
$this->configureAuth($_headers, 'voice');
398398

399399
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
400400

@@ -505,7 +505,7 @@ public function modifyCallRecordingState(
505505
$_bodyJson = Request\Body::Json($body);
506506

507507
//set HTTP basic auth parameters
508-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
508+
$this->configureAuth($_headers, 'voice');
509509

510510
$_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);
511511

@@ -612,7 +612,7 @@ public function getCallRecordings(
612612
);
613613

614614
//set HTTP basic auth parameters
615-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
615+
$this->configureAuth($_headers, 'voice');
616616

617617
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
618618

@@ -726,7 +726,7 @@ public function getCallRecording(
726726
);
727727

728728
//set HTTP basic auth parameters
729-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
729+
$this->configureAuth($_headers, 'voice');
730730

731731
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
732732

@@ -839,7 +839,7 @@ public function deleteRecording(
839839
);
840840

841841
//set HTTP basic auth parameters
842-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
842+
$this->configureAuth($_headers, 'voice');
843843

844844
$_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);
845845

@@ -949,7 +949,7 @@ public function getDownloadCallRecording(
949949
);
950950

951951
//set HTTP basic auth parameters
952-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
952+
$this->configureAuth($_headers, 'voice');
953953

954954
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
955955

@@ -1059,7 +1059,7 @@ public function deleteRecordingMedia(
10591059
);
10601060

10611061
//set HTTP basic auth parameters
1062-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1062+
$this->configureAuth($_headers, 'voice');
10631063

10641064
$_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);
10651065

@@ -1169,7 +1169,7 @@ public function getCallTranscription(
11691169
);
11701170

11711171
//set HTTP basic auth parameters
1172-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1172+
$this->configureAuth($_headers, 'voice');
11731173

11741174
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
11751175

@@ -1289,7 +1289,7 @@ public function createTranscribeCallRecording(
12891289
$_bodyJson = Request\Body::Json($body);
12901290

12911291
//set HTTP basic auth parameters
1292-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1292+
$this->configureAuth($_headers, 'voice');
12931293

12941294
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
12951295

@@ -1405,7 +1405,7 @@ public function deleteCallTranscription(
14051405
);
14061406

14071407
//set HTTP basic auth parameters
1408-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1408+
$this->configureAuth($_headers, 'voice');
14091409

14101410
$_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);
14111411

@@ -1527,7 +1527,7 @@ public function getConferences(
15271527
);
15281528

15291529
//set HTTP basic auth parameters
1530-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1530+
$this->configureAuth($_headers, 'voice');
15311531

15321532
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
15331533

@@ -1635,7 +1635,7 @@ public function getConference(
16351635
);
16361636

16371637
//set HTTP basic auth parameters
1638-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1638+
$this->configureAuth($_headers, 'voice');
16391639

16401640
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
16411641

@@ -1748,7 +1748,7 @@ public function modifyConference(
17481748
$_bodyJson = Request\Body::Json($body);
17491749

17501750
//set HTTP basic auth parameters
1751-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1751+
$this->configureAuth($_headers, 'voice');
17521752

17531753
$_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);
17541754

@@ -1862,7 +1862,7 @@ public function modifyConferenceMember(
18621862
$_bodyJson = Request\Body::Json($body);
18631863

18641864
//set HTTP basic auth parameters
1865-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1865+
$this->configureAuth($_headers, 'voice');
18661866

18671867
$_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);
18681868

@@ -1972,7 +1972,7 @@ public function getConferenceMember(
19721972
);
19731973

19741974
//set HTTP basic auth parameters
1975-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
1975+
$this->configureAuth($_headers, 'voice');
19761976

19771977
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
19781978

@@ -2084,7 +2084,7 @@ public function getConferenceRecordings(
20842084
);
20852085

20862086
//set HTTP basic auth parameters
2087-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
2087+
$this->configureAuth($_headers, 'voice');
20882088

20892089
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
20902090

@@ -2199,7 +2199,7 @@ public function getConferenceRecording(
21992199
);
22002200

22012201
//set HTTP basic auth parameters
2202-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
2202+
$this->configureAuth($_headers, 'voice');
22032203

22042204
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
22052205

@@ -2314,7 +2314,7 @@ public function getDownloadConferenceRecording(
23142314
);
23152315

23162316
//set HTTP basic auth parameters
2317-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
2317+
$this->configureAuth($_headers, 'voice');
23182318

23192319
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
23202320

@@ -2436,7 +2436,7 @@ public function getQueryCallRecordings(
24362436
);
24372437

24382438
//set HTTP basic auth parameters
2439-
Request::auth($this->config->getVoiceBasicAuthUserName(), $this->config->getVoiceBasicAuthPassword());
2439+
$this->configureAuth($_headers, 'voice');
24402440

24412441
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
24422442

0 commit comments

Comments
 (0)