Skip to content

Commit 65ddbd7

Browse files
smoghe-bwclaude
andcommitted
Address PR review feedback: restructure BRTC into own module
- Restore original configureAuth with OAuth2 client_credentials support that was accidentally deleted; remove redundant configureOAuth2Auth - Move all BRTC endpoints out of Voice controller into new src/BRTC/ module with its own BRTCClient and APIController - Add BRTCDEFAULT server URL constant and configuration mapping - Register getBRTC() accessor on BandwidthClient - Fix Connect BXML: add eventCallbackUrl attribute, isset guards, correct @var doc to array(Endpoint) - Fix Endpoint BXML: rename property to endpointId, render as text content (createTextNode) instead of XML attribute - Fix BXML test expected output for Endpoint text content - Create proper response wrapper models matching API spec: CreateEndpointResponse (links/data/errors), CreateEndpointResponseData (with token field), EndpointResponse, ListEndpointsResponse (with page), Endpoints (list summary without devices) - Fix Device model fields: deviceId, deviceName, status, creationTimestamp (matching Python SDK spec) - Fix Endpoint model fields to match spec: endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices - Fix EndpointEvent model to match spec: add eventTime, eventType, device; remove fabricated fields - Fix CreateEndpointRequest: direction is required (no null default), add connectionMetadata field - Replace ErrorResponse with ErrorObject (type, description) - Replace Page with spec-correct fields (pageSize, totalElements, totalPages, pageNumber) - Remove Enums.php (use plain strings per SDK convention) - Add Link model for BRTC responses - Fix listEndpoints to accept explicit query params (type, status, direction, pageToken, pageSize) following getMessages pattern - All BRTC API methods use configureAuth and BRTCDEFAULT server URL - Update smoke tests to use BRTC client and wrapped response models Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 107f54f commit 65ddbd7

31 files changed

Lines changed: 1139 additions & 582 deletions

src/BRTC/BRTCClient.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* BRTCClient.php
4+
*
5+
* Client for BRTC (Bandwidth Real-Time Communications) API
6+
*
7+
* @copyright Bandwidth INC
8+
*/
9+
10+
namespace BandwidthLib\BRTC;
11+
12+
use BandwidthLib\BRTC\Controllers;
13+
14+
class BRTCClient
15+
{
16+
private $config;
17+
public function __construct($config)
18+
{
19+
$this->config = $config;
20+
}
21+
22+
private $client;
23+
24+
/**
25+
* Provides access to the BRTC API controller
26+
* @return Controllers\APIController
27+
*/
28+
public function getClient()
29+
{
30+
if ($this->client == null) {
31+
$this->client = new Controllers\APIController($this->config);
32+
}
33+
return $this->client;
34+
}
35+
}

0 commit comments

Comments
 (0)