Skip to content

Commit 8efe7cc

Browse files
authored
Deprecate meetings & proactive connect (#496)
* Deprecation warning triggers for upcoming major version changes * use trigger_warning, suppress in tests
1 parent eb73c22 commit 8efe7cc

File tree

4 files changed

+46
-32
lines changed

4 files changed

+46
-32
lines changed

src/Meetings/Client.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ class Client implements APIClient
1818
{
1919
public const IMAGE_TYPES = ['white', 'colored', 'favicon'];
2020

21+
/**
22+
* @deprecated The Meetings API is being sunset and this will be removed in the next major version
23+
*/
2124
public function __construct(protected APIResource $api)
2225
{
26+
trigger_error(
27+
'The Meetings API is being sunset and this will be removed in the next major version',
28+
E_USER_DEPRECATED
29+
);
2330
}
2431

2532
public function getAPIResource(): APIResource

src/ProactiveConnect/Client.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111

1212
class Client implements APIClient
1313
{
14+
/**
15+
* @deprecated The ProactiveConnect API is being sunset and this will be removed in the next major version
16+
*/
1417
public function __construct(protected APIResource $api)
1518
{
19+
trigger_error(
20+
'The ProactiveConnect API is being sunset and this will be removed in the next major version',
21+
E_USER_DEPRECATED
22+
);
1623
}
1724

1825
public function getAPIResource(): APIResource

test/Meetings/ClientTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function setUp(): void
5656
->setClient($this->vonageClient->reveal())
5757
->setAuthHandlers(new KeypairHandler())
5858
->setBaseUrl('https://api-eu.vonage.com/v1/meetings');
59-
$this->meetingsClient = new MeetingsClient($this->api);
59+
$this->meetingsClient = @new MeetingsClient($this->api);
6060
}
6161

6262
public function testBaseUrlIsSet(): void
@@ -79,7 +79,7 @@ public function testWillGetAvailableRooms(): void
7979
return true;
8080
}))->willReturn($this->getResponse('get-rooms-success'));
8181

82-
$response = $this->meetingsClient->getAllListedRooms();
82+
$response = @$this->meetingsClient->getAllListedRooms();
8383
$this->assertCount(2, $response);
8484

8585
foreach ($response as $room) {
@@ -99,7 +99,7 @@ public function testWillGetAvailableRoomsWithFilter(): void
9999
return true;
100100
}))->willReturn($this->getResponse('get-rooms-success'));
101101

102-
$response = $this->meetingsClient->getAllListedRooms('999', '234');
102+
$response = @$this->meetingsClient->getAllListedRooms('999', '234');
103103
$this->assertCount(2, $response);
104104

105105
foreach ($response as $room) {
@@ -123,7 +123,7 @@ public function testWillCreateRoom(): void
123123
$room = new Room();
124124
$room->fromArray(['display_name' => 'test-room']);
125125

126-
$response = $this->meetingsClient->createRoom($room);
126+
$response = @$this->meetingsClient->createRoom($room);
127127
$this->assertInstanceOf(Room::class, $response);
128128

129129
$this->assertEquals('test-room', $response->display_name);
@@ -150,7 +150,7 @@ public function testWillCreateLongTermRoom(): void
150150
'expires_at' => '2023-01-30T00:47:04+0000'
151151
]);
152152

153-
$response = $this->meetingsClient->createRoom($room);
153+
$response = @$this->meetingsClient->createRoom($room);
154154
$this->assertInstanceOf(Room::class, $response);
155155

156156
$this->assertEquals('test-room', $response->display_name);
@@ -176,7 +176,7 @@ public function testClientWillHandleUnauthorizedRequests(): void
176176
$room = new Room();
177177
$room->fromArray(['display_name' => 'something']);
178178

179-
$response = $this->meetingsClient->createRoom($room);
179+
$response = @$this->meetingsClient->createRoom($room);
180180
}
181181

182182
public function testClientWillHandleNotFoundResponse(): void
@@ -193,7 +193,7 @@ public function testClientWillHandleNotFoundResponse(): void
193193
}))->willReturn($this->getResponse('empty', 404));
194194
$this->expectException(NotFound::class);
195195
$this->expectExceptionMessage('No resource found');
196-
$response = $this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
196+
$response = @$this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
197197
}
198198

199199
public function testClientWillHandleValidationError(): void
@@ -214,7 +214,7 @@ public function testClientWillHandleValidationError(): void
214214
$room = new Room();
215215
$room->fromArray(['display_name' => 'test-room']);
216216

217-
$response = $this->meetingsClient->createRoom($room);
217+
$response = @$this->meetingsClient->createRoom($room);
218218
}
219219

220220
public function testWillGetRoomDetails(): void
@@ -230,7 +230,7 @@ public function testWillGetRoomDetails(): void
230230
return true;
231231
}))->willReturn($this->getResponse('get-room-success'));
232232

233-
$response = $this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
233+
$response = @$this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
234234
$this->assertInstanceOf(Room::class, $response);
235235
$this->assertEquals('224d6219-dc05-4c09-9d42-96adce7fcb67', $response->id);
236236
}
@@ -263,7 +263,7 @@ public function testWillUpdateExistingRoom(): void
263263
]
264264
];
265265

266-
$response = $this->meetingsClient->updateRoom('e857c5ce-cdee-4971-ab20-208a98263282', $payload);
266+
$response = @$this->meetingsClient->updateRoom('e857c5ce-cdee-4971-ab20-208a98263282', $payload);
267267
$this->assertInstanceOf(Room::class, $response);
268268
$this->assertEquals('custom', $response->initial_join_options['microphone_state']);
269269
$this->assertEquals('https://my-callback-url', $response->callback_urls['rooms_callback_url']);
@@ -284,7 +284,7 @@ public function testWillGetRecording(): void
284284
return true;
285285
}))->willReturn($this->getResponse('get-recording-success'));
286286

287-
$response = $this->meetingsClient->getRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
287+
$response = @$this->meetingsClient->getRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
288288
$this->assertInstanceOf(Recording::class, $response);
289289
$this->assertEquals('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', $response->id);
290290
}
@@ -304,7 +304,7 @@ public function testWillDeleteRecording(): void
304304
return true;
305305
}))->willReturn($this->getResponse('empty', 204));
306306

307-
$response = $this->meetingsClient->deleteRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
307+
$response = @$this->meetingsClient->deleteRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
308308
$this->assertTrue($response);
309309
}
310310

@@ -323,7 +323,7 @@ public function testWillGetRecordingsFromSession(): void
323323
return true;
324324
}))->willReturn($this->getResponse('get-recordings-success'));
325325

326-
$response = $this->meetingsClient->getRecordingsFromSession('2_MX40NjMwODczMn5-MTU3NTgyODEwNzQ2MH5OZDJrVmdBRUNDbG5MUzNqNXgya20yQ1Z-fg');
326+
$response = @$this->meetingsClient->getRecordingsFromSession('2_MX40NjMwODczMn5-MTU3NTgyODEwNzQ2MH5OZDJrVmdBRUNDbG5MUzNqNXgya20yQ1Z-fg');
327327

328328
foreach ($response as $recording) {
329329
$this->assertInstanceOf(Recording::class, $recording);
@@ -345,7 +345,7 @@ public function testWillGetMeetingDialNumbers(): void
345345
return true;
346346
}))->willReturn($this->getResponse('get-dialin-success'));
347347

348-
$response = $this->meetingsClient->getDialInNumbers();
348+
$response = @$this->meetingsClient->getDialInNumbers();
349349

350350
foreach ($response as $dialInNumber) {
351351
$this->assertInstanceOf(DialInNumber::class, $dialInNumber);
@@ -367,7 +367,7 @@ public function testWillGetApplicationThemes(): void
367367
return true;
368368
}))->willReturn($this->getResponse('get-application-themes-success'));
369369

370-
$response = $this->meetingsClient->getApplicationThemes();
370+
$response = @$this->meetingsClient->getApplicationThemes();
371371

372372
foreach ($response as $applicationThemes) {
373373
$this->assertInstanceOf(ApplicationTheme::class, $applicationThemes);
@@ -388,7 +388,7 @@ public function testWillCreateTheme(): void
388388
return true;
389389
}))->willReturn($this->getResponse('create-theme-success', 201));
390390

391-
$response = $this->meetingsClient->createApplicationTheme('My-Theme');
391+
$response = @$this->meetingsClient->createApplicationTheme('My-Theme');
392392
$this->assertInstanceOf(ApplicationTheme::class, $response);
393393

394394
$this->assertEquals('My-Theme', $response->theme_name);
@@ -410,7 +410,7 @@ public function testWillHandleConflictErrorOnThemeCreation(): void
410410

411411
$this->expectException(Conflict::class);
412412
$this->expectExceptionMessage('Entity conflict');
413-
$response = $this->meetingsClient->createApplicationTheme('My-Theme');
413+
$response = @$this->meetingsClient->createApplicationTheme('My-Theme');
414414
}
415415

416416
public function testWillGetThemeById(): void
@@ -425,7 +425,7 @@ public function testWillGetThemeById(): void
425425
return true;
426426
}))->willReturn($this->getResponse('get-theme-success'));
427427

428-
$response = $this->meetingsClient->getThemeById('afb5b1f2-fe83-4b14-83ff-f23f5630c160');
428+
$response = @$this->meetingsClient->getThemeById('afb5b1f2-fe83-4b14-83ff-f23f5630c160');
429429
$this->assertInstanceOf(ApplicationTheme::class, $response);
430430
$this->assertEquals('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $response->theme_id);
431431
}
@@ -442,7 +442,7 @@ public function testWillDeleteTheme(): void
442442
return true;
443443
}))->willReturn($this->getResponse('empty', 204));
444444

445-
$response = $this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
445+
$response = @$this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
446446
$this->assertTrue($response);
447447
}
448448

@@ -458,7 +458,7 @@ public function testWillForceDeleteTheme(): void
458458
return true;
459459
}))->willReturn($this->getResponse('empty', 204));
460460

461-
$response = $this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', true);
461+
$response = @$this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', true);
462462
$this->assertTrue($response);
463463
}
464464

@@ -483,7 +483,7 @@ public function testWillUpdateThemeById(): void
483483
]
484484
];
485485

486-
$response = $this->meetingsClient->updateTheme('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $payload);
486+
$response = @$this->meetingsClient->updateTheme('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $payload);
487487
$this->assertInstanceOf(ApplicationTheme::class, $response);
488488
$this->assertEquals('Updated Theme', $response->theme_name);
489489
$this->assertEquals('Updated Branding', $response->brand_text);
@@ -508,9 +508,9 @@ public function testWillExtractCorrectImageKey($logoType, $validCall): void
508508
}
509509
}))->willReturn($this->getResponse('get-upload-urls-success'));
510510

511-
$uploadUrls = $this->meetingsClient->getUploadUrls();
511+
$uploadUrls = @$this->meetingsClient->getUploadUrls();
512512

513-
$entity = $this->meetingsClient->returnCorrectUrlEntityFromType($uploadUrls, $logoType);
513+
$entity = @$this->meetingsClient->returnCorrectUrlEntityFromType($uploadUrls, $logoType);
514514

515515
if ($validCall) {
516516
$this->assertEquals($logoType, $entity->fields['logoType']);
@@ -559,7 +559,7 @@ public function testWillUploadImageToAws(): void
559559
$this->vonageClient->getHttpClient()->willReturn($httpClient);
560560

561561
$file = __DIR__ . '/Fixtures/vonage.png';
562-
$this->meetingsClient->uploadImage('afb5b1f2-fe83-4b14-83ff-f23f5630c160', 'white', $file);
562+
@$this->meetingsClient->uploadImage('afb5b1f2-fe83-4b14-83ff-f23f5630c160', 'white', $file);
563563
}
564564

565565
public function testCanGetUploadUrlsForThemeLogo(): void
@@ -574,7 +574,7 @@ public function testCanGetUploadUrlsForThemeLogo(): void
574574
return true;
575575
}))->willReturn($this->getResponse('get-upload-urls-success'));
576576

577-
$response = $this->meetingsClient->getUploadUrls();
577+
$response = @$this->meetingsClient->getUploadUrls();
578578
$this->assertEquals('auto-expiring-temp/logos/white/ca63a155-d5f0-4131-9903-c59907e53df0', $response[0]->fields['key']);
579579
}
580580

@@ -590,7 +590,7 @@ public function testWillGetRoomsAssociatedWithTheme(): void
590590
return true;
591591
}))->willReturn($this->getResponse('get-rooms-by-theme-id-success'));
592592

593-
$response = $this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888');
593+
$response = @$this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888');
594594

595595
foreach ($response as $room) {
596596
$this->assertInstanceOf(Room::class, $room);
@@ -609,7 +609,7 @@ public function testWillGetRoomsAssociatedWithThemeUsingFilter(): void
609609
return true;
610610
}))->willReturn($this->getResponse('get-rooms-by-theme-id-success'));
611611

612-
$response = $this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888', startId: '245', endId: '765');
612+
$response = @$this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888', startId: '245', endId: '765');
613613

614614
foreach ($response as $room) {
615615
$this->assertInstanceOf(Room::class, $room);
@@ -633,7 +633,7 @@ public function testWillUpdateExistingApplication(): void
633633
'default_theme_id' => '323867d7-8c4b-4dce-8c11-48f14425d888',
634634
];
635635

636-
$response = $this->meetingsClient->updateApplication($payload);
636+
$response = @$this->meetingsClient->updateApplication($payload);
637637
$this->assertInstanceOf(Application::class, $response);
638638
$this->assertEquals('f4d5a07b-260c-4458-b16c-e5a68553bc85', $response->application_id);
639639
$this->assertEquals('323867d7-8c4b-4dce-8c11-48f14425d888', $response->default_theme_id);

test/ProactiveConnect/ClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function setUp(): void
5252
->setAuthHandlers(new Client\Credentials\Handler\KeypairHandler())
5353
->setBaseUrl('https://api-eu.vonage.com/v0.1/bulk');
5454

55-
$this->proactiveConnectClient = new ProactiveConnectClient($this->api);
55+
$this->proactiveConnectClient = @new ProactiveConnectClient($this->api);
5656
}
5757

5858
public function testHasSetupClientCorrectly(): void
@@ -77,7 +77,7 @@ public function testSetsRequestAuthCorrectly(): void
7777
return true;
7878
}))->willReturn($this->getResponse('list-success'));
7979

80-
$list = $this->proactiveConnectClient->getLists();
80+
$list = @$this->proactiveConnectClient->getLists();
8181
$this->assertInstanceOf(IterableAPICollection::class, $list);
8282
$list->getPageData();
8383
}
@@ -94,9 +94,9 @@ public function testListUrlEndpoint(): void
9494
return true;
9595
}))->willReturn($this->getResponse('list-success'));
9696

97-
$list = $this->proactiveConnectClient->getLists();
97+
$list = @$this->proactiveConnectClient->getLists();
9898
$this->assertInstanceOf(IterableAPICollection::class, $list);
99-
$list->getPageData();
99+
@$list->getPageData();
100100
}
101101

102102
public function testCanGetList(): void

0 commit comments

Comments
 (0)