Skip to content

Commit 83bf524

Browse files
smoghe-bwclaude
andauthored
VAPI-2700 Add Endpoint Event Model and Related Enums (#173)
* Add Endpoint Event Model and Related Enums - Created EndpointEvent class to represent events occurring on endpoints. - Introduced EndpointEventTypeEnum to define event types (DEVICE_CONNECTED, DEVICE_DISCONNECTED). - Added EndpointResponse class for handling responses related to endpoints. - Implemented EndpointStatusEnum to represent endpoint statuses (CONNECTED, DISCONNECTED). - Added EndpointTypeEnum for defining endpoint types (WEBRTC). - Created Endpoints class to encapsulate endpoint details. - Introduced ErrorResponse class for managing error responses. - Added ListEndpointsResponse class for handling lists of endpoints. - Implemented Page class for pagination support in endpoint listings. - Created SipConnectionMetadata class to manage SIP connection details. - Added SipCredentials class for handling SIP authentication credentials. * Add unit tests for EndpointsApi, EndpointEvent, and EndpointEventTypeEnum * Add integration tests for EndpointsApi with various endpoint operations * Refactor Endpoints integration tests to use synchronous methods and improve API client configuration * Refactor endpoint creation requests to use CreateEndpointRequest and update status code assertions * Skip GenerateMessagingCodeBadRequest test due to API returning 500 instead of expected 400 * Add Connect and Endpoint classes to BXML verbs for call connection * Fix parameter references and add beta badges for endpoints in OpenAPI spec * Rename CreateEndpointResponseObject to CreateEndpointResponseData in CreateEndpointTest * Remove CreateEndpointResponseObject class and documentation * Add unit tests for endpoint models and enums - Created tests for CreateEndpointRequestBase, CreateEndpointResponseData, CreateEndpointResponse, CreateWebRtcConnectionRequest, Device, Endpoint, and Endpoints classes. - Implemented serialization and deserialization tests for various models. - Added tests for enum values and their serialization/deserialization for DeviceStatusEnum, EndpointDirectionEnum, EndpointStatusEnum, and EndpointTypeEnum. - Included validation tests to ensure required fields throw exceptions when null. - Enhanced coverage for ListEndpointsResponse and its associated properties. * Refactor EndpointsSmokeTests: Simplify initialization and remove unused variables * Address PR review feedback for BRTC SDK tests - Remove JSON serialization/deserialization tests from model test files (tests the JSON library, not the model) - Remove integer value tests and JsonConvert tests from enum test files - Remove duplicate enum creation tests from EndpointEventTypeEnumTests - Standardize enum tests to use concise assertion style - Simplify smoke test list assertion to check first element - Remove filter test from smoke tests - Make smoke test client initialization consistent with other smoke tests - Add missing BXML verb tests for Connect and Endpoint - Add missing model unit tests for CreateEndpointRequest, ErrorResponse, Page, SipConnectionMetadata, and SipCredentials Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix ErrorResponseTests to use correct Error constructor parameter The Error model has (code, description, telephoneNumbers) parameters, not a 'type' parameter. Changed to use code: 400 instead of the non-existent type parameter that caused a CS1739 build error. Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Improve BRTC endpoint test quality and coverage - Enum tests now robustly verify all values via serialization/deserialization - Consolidate per-field [Fact] methods into single test methods across 15 model tests - Remove 3 redundant variant tests from EndpointEventTests (DisconnectedEventType, WithoutTag, WithoutDevice) - Add Page and item-level field assertions to smoke test List section - Add Page field assertion to unit API ListEndpointsTest - Remove empty IDisposable implementation from EndpointEventTests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Address PR review feedback: simplify enum tests and fix smoke test init - Rewrite all 5 enum test files (DeviceStatusEnum, EndpointDirectionEnum, EndpointEventTypeEnum, EndpointStatusEnum, EndpointTypeEnum) to match the existing auto-generated pattern (CallDirectionEnumTests, etc.) removing unnecessary integer value checks, JSON serialization tests, and inequality assertions - Add BasePath to EndpointsIntegrationTests constructor for consistency with other smoke tests (Calls, Messages, MFA, etc.) Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Address remaining PR review feedback - Restore JSON serialization tests for EndpointEventTypeEnum: the non-obvious CONNECTED -> "DEVICE_CONNECTED" mapping is worth testing explicitly - Assert that the created endpoint ID appears in the list response to verify the just-created endpoint is findable Generated from Claude9 with Claude Code Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Address remaining PR review feedback - Delete useless enum InstanceTest files (DeviceStatusEnum, EndpointStatusEnum, EndpointTypeEnum, EndpointDirectionEnum) per reviewer request - Fix list assertion in smoke test to find the specific created endpoint using .First(e => e.EndpointId == endpointId) instead of generic Data[0] - Add System.Linq using directive to smoke test Generated from Claude9 with Claude Code Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix smoke test BasePath to match API spec The Endpoints API server URL is https://api.bandwidth.com/v2 per the OpenAPI spec, not https://api.bandwidth.com/api/v2. Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add serialization tests for BRTC enum types Replace deleted boilerplate Assert.IsType tests with meaningful serialization/deserialization tests for DeviceStatusEnum, EndpointStatusEnum, EndpointDirectionEnum, and EndpointTypeEnum, matching the concise style used in EndpointEventTypeEnumTests. Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Match enum tests to existing repo convention Update BRTC enum test files to follow the same structure as CallbackMethodEnumTests and CompletedLookupStatusEnumTests: IDisposable pattern, constructor, InstanceTest, plus serialization tests for actual value coverage. Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Match BRTC model tests to existing repo convention Update all 13 BRTC model test files to follow the auto-generated test pattern: license header, full usings, IDisposable with Dispose(), InstanceTest, individual per-property [Fact] methods with XML doc comments, and Assert.IsType + Assert.Equal assertions. Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update test file headers with author attribution Replace auto-generated header line with "Author: Sudhanshu Moghe" across all 18 BRTC test files (13 model + 5 enum). Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Align BRTC tests with existing repo conventions - Replace author attribution headers with standard OpenAPI generator header - Add IDisposable, XML doc comments, and standard structure to ErrorResponseTests and SipCredentialsTests - Remove enum serialization tests to match existing enum test pattern - Remove required field validation tests not present in existing model tests - Add BadRequest, Unauthorized, Forbidden, NotFound error cases to EndpointsApiTests - Add XML doc comments to all EndpointsApiTests methods - Rewrite EndpointsIntegrationTests: split lifecycle test into separate operations, add forbidden client, use standard method naming convention Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use combined lifecycle test for endpoint happy path Keep Create -> List -> Get -> Delete as one test instead of separate tests, reducing endpoint churn while still covering the full flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove forbidden smoke tests for endpoints The forbidden credentials return 401 instead of 403 for the endpoints API, so remove those tests and keep only unauthorized + not found. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove hardcoded BasePath from EndpointsSmokeTests Remove unnecessary BasePath override from the authorized client configuration, consistent with other smoke test initializations. Generated from Claude9 with Claude Code Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: smoghe-bw <smoghe-bw> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a5dc5c6 commit 83bf524

92 files changed

Lines changed: 9889 additions & 126 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openapi-generator/FILES

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,33 @@ docs/CreateAsyncBulkLookupResponse.md
4343
docs/CreateAsyncBulkLookupResponseData.md
4444
docs/CreateCall.md
4545
docs/CreateCallResponse.md
46+
docs/CreateEndpointRequest.md
47+
docs/CreateEndpointRequestBase.md
48+
docs/CreateEndpointResponse.md
49+
docs/CreateEndpointResponseData.md
4650
docs/CreateMessageRequestError.md
4751
docs/CreateMultiChannelMessageResponse.md
4852
docs/CreateSyncLookupResponse.md
4953
docs/CreateSyncLookupResponseData.md
54+
docs/CreateWebRtcConnectionRequest.md
5055
docs/DeactivationEventEnum.md
56+
docs/Device.md
57+
docs/DeviceStatusEnum.md
5158
docs/DisconnectCallback.md
5259
docs/Diversion.md
5360
docs/DtmfCallback.md
61+
docs/Endpoint.md
62+
docs/EndpointDirectionEnum.md
63+
docs/EndpointEvent.md
64+
docs/EndpointEventTypeEnum.md
65+
docs/EndpointResponse.md
66+
docs/EndpointStatusEnum.md
67+
docs/EndpointTypeEnum.md
68+
docs/Endpoints.md
69+
docs/EndpointsApi.md
5470
docs/Error.md
5571
docs/ErrorObject.md
72+
docs/ErrorResponse.md
5673
docs/ErrorSource.md
5774
docs/FailureWebhook.md
5875
docs/FieldError.md
@@ -70,6 +87,7 @@ docs/LineTypeEnum.md
7087
docs/Link.md
7188
docs/LinkSchema.md
7289
docs/LinksObject.md
90+
docs/ListEndpointsResponse.md
7391
docs/ListMessageDirectionEnum.md
7492
docs/ListMessageItem.md
7593
docs/LookupErrorResponse.md
@@ -117,6 +135,7 @@ docs/MultiChannelMessageContent.md
117135
docs/MultiChannelMessageRequest.md
118136
docs/MultiChannelMessageResponseData.md
119137
docs/OptInWorkflow.md
138+
docs/Page.md
120139
docs/PageInfo.md
121140
docs/PhoneNumberLookupApi.md
122141
docs/PriorityEnum.md
@@ -147,6 +166,8 @@ docs/RecordingTranscriptions.md
147166
docs/RecordingsApi.md
148167
docs/RedirectCallback.md
149168
docs/RedirectMethodEnum.md
169+
docs/SipConnectionMetadata.md
170+
docs/SipCredentials.md
150171
docs/SmsMessageContent.md
151172
docs/StandaloneCardOrientationEnum.md
152173
docs/StatisticsApi.md
@@ -192,6 +213,7 @@ docs/WebhookSubscriptionsListBody.md
192213
git_push.sh
193214
src/Bandwidth.Standard/Api/CallsApi.cs
194215
src/Bandwidth.Standard/Api/ConferencesApi.cs
216+
src/Bandwidth.Standard/Api/EndpointsApi.cs
195217
src/Bandwidth.Standard/Api/MFAApi.cs
196218
src/Bandwidth.Standard/Api/MediaApi.cs
197219
src/Bandwidth.Standard/Api/MessagesApi.cs
@@ -260,16 +282,32 @@ src/Bandwidth.Standard/Model/CreateAsyncBulkLookupResponse.cs
260282
src/Bandwidth.Standard/Model/CreateAsyncBulkLookupResponseData.cs
261283
src/Bandwidth.Standard/Model/CreateCall.cs
262284
src/Bandwidth.Standard/Model/CreateCallResponse.cs
285+
src/Bandwidth.Standard/Model/CreateEndpointRequest.cs
286+
src/Bandwidth.Standard/Model/CreateEndpointRequestBase.cs
287+
src/Bandwidth.Standard/Model/CreateEndpointResponse.cs
288+
src/Bandwidth.Standard/Model/CreateEndpointResponseData.cs
263289
src/Bandwidth.Standard/Model/CreateMessageRequestError.cs
264290
src/Bandwidth.Standard/Model/CreateMultiChannelMessageResponse.cs
265291
src/Bandwidth.Standard/Model/CreateSyncLookupResponse.cs
266292
src/Bandwidth.Standard/Model/CreateSyncLookupResponseData.cs
293+
src/Bandwidth.Standard/Model/CreateWebRtcConnectionRequest.cs
267294
src/Bandwidth.Standard/Model/DeactivationEventEnum.cs
295+
src/Bandwidth.Standard/Model/Device.cs
296+
src/Bandwidth.Standard/Model/DeviceStatusEnum.cs
268297
src/Bandwidth.Standard/Model/DisconnectCallback.cs
269298
src/Bandwidth.Standard/Model/Diversion.cs
270299
src/Bandwidth.Standard/Model/DtmfCallback.cs
300+
src/Bandwidth.Standard/Model/Endpoint.cs
301+
src/Bandwidth.Standard/Model/EndpointDirectionEnum.cs
302+
src/Bandwidth.Standard/Model/EndpointEvent.cs
303+
src/Bandwidth.Standard/Model/EndpointEventTypeEnum.cs
304+
src/Bandwidth.Standard/Model/EndpointResponse.cs
305+
src/Bandwidth.Standard/Model/EndpointStatusEnum.cs
306+
src/Bandwidth.Standard/Model/EndpointTypeEnum.cs
307+
src/Bandwidth.Standard/Model/Endpoints.cs
271308
src/Bandwidth.Standard/Model/Error.cs
272309
src/Bandwidth.Standard/Model/ErrorObject.cs
310+
src/Bandwidth.Standard/Model/ErrorResponse.cs
273311
src/Bandwidth.Standard/Model/ErrorSource.cs
274312
src/Bandwidth.Standard/Model/FailureWebhook.cs
275313
src/Bandwidth.Standard/Model/FieldError.cs
@@ -287,6 +325,7 @@ src/Bandwidth.Standard/Model/LineTypeEnum.cs
287325
src/Bandwidth.Standard/Model/Link.cs
288326
src/Bandwidth.Standard/Model/LinkSchema.cs
289327
src/Bandwidth.Standard/Model/LinksObject.cs
328+
src/Bandwidth.Standard/Model/ListEndpointsResponse.cs
290329
src/Bandwidth.Standard/Model/ListMessageDirectionEnum.cs
291330
src/Bandwidth.Standard/Model/ListMessageItem.cs
292331
src/Bandwidth.Standard/Model/LookupErrorResponse.cs
@@ -330,6 +369,7 @@ src/Bandwidth.Standard/Model/MultiChannelMessageContent.cs
330369
src/Bandwidth.Standard/Model/MultiChannelMessageRequest.cs
331370
src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs
332371
src/Bandwidth.Standard/Model/OptInWorkflow.cs
372+
src/Bandwidth.Standard/Model/Page.cs
333373
src/Bandwidth.Standard/Model/PageInfo.cs
334374
src/Bandwidth.Standard/Model/PriorityEnum.cs
335375
src/Bandwidth.Standard/Model/ProductTypeEnum.cs
@@ -358,6 +398,8 @@ src/Bandwidth.Standard/Model/RecordingTranscriptionMetadata.cs
358398
src/Bandwidth.Standard/Model/RecordingTranscriptions.cs
359399
src/Bandwidth.Standard/Model/RedirectCallback.cs
360400
src/Bandwidth.Standard/Model/RedirectMethodEnum.cs
401+
src/Bandwidth.Standard/Model/SipConnectionMetadata.cs
402+
src/Bandwidth.Standard/Model/SipCredentials.cs
361403
src/Bandwidth.Standard/Model/SmsMessageContent.cs
362404
src/Bandwidth.Standard/Model/StandaloneCardOrientationEnum.cs
363405
src/Bandwidth.Standard/Model/StatusCallback.cs

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ Class | Method | HTTP request | Description
127127
*ConferencesApi* | [**UpdateConference**](docs/ConferencesApi.md#updateconference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference
128128
*ConferencesApi* | [**UpdateConferenceBxml**](docs/ConferencesApi.md#updateconferencebxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML
129129
*ConferencesApi* | [**UpdateConferenceMember**](docs/ConferencesApi.md#updateconferencemember) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member
130+
*EndpointsApi* | [**CreateEndpoint**](docs/EndpointsApi.md#createendpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint
131+
*EndpointsApi* | [**DeleteEndpoint**](docs/EndpointsApi.md#deleteendpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint
132+
*EndpointsApi* | [**GetEndpoint**](docs/EndpointsApi.md#getendpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint
133+
*EndpointsApi* | [**ListEndpoints**](docs/EndpointsApi.md#listendpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints
134+
*EndpointsApi* | [**UpdateEndpointBxml**](docs/EndpointsApi.md#updateendpointbxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML
130135
*MFAApi* | [**GenerateMessagingCode**](docs/MFAApi.md#generatemessagingcode) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code
131136
*MFAApi* | [**GenerateVoiceCode**](docs/MFAApi.md#generatevoicecode) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code
132137
*MFAApi* | [**VerifyCode**](docs/MFAApi.md#verifycode) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code
@@ -207,16 +212,32 @@ Class | Method | HTTP request | Description
207212
- [Model.CreateAsyncBulkLookupResponseData](docs/CreateAsyncBulkLookupResponseData.md)
208213
- [Model.CreateCall](docs/CreateCall.md)
209214
- [Model.CreateCallResponse](docs/CreateCallResponse.md)
215+
- [Model.CreateEndpointRequest](docs/CreateEndpointRequest.md)
216+
- [Model.CreateEndpointRequestBase](docs/CreateEndpointRequestBase.md)
217+
- [Model.CreateEndpointResponse](docs/CreateEndpointResponse.md)
218+
- [Model.CreateEndpointResponseData](docs/CreateEndpointResponseData.md)
210219
- [Model.CreateMessageRequestError](docs/CreateMessageRequestError.md)
211220
- [Model.CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md)
212221
- [Model.CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md)
213222
- [Model.CreateSyncLookupResponseData](docs/CreateSyncLookupResponseData.md)
223+
- [Model.CreateWebRtcConnectionRequest](docs/CreateWebRtcConnectionRequest.md)
214224
- [Model.DeactivationEventEnum](docs/DeactivationEventEnum.md)
225+
- [Model.Device](docs/Device.md)
226+
- [Model.DeviceStatusEnum](docs/DeviceStatusEnum.md)
215227
- [Model.DisconnectCallback](docs/DisconnectCallback.md)
216228
- [Model.Diversion](docs/Diversion.md)
217229
- [Model.DtmfCallback](docs/DtmfCallback.md)
230+
- [Model.Endpoint](docs/Endpoint.md)
231+
- [Model.EndpointDirectionEnum](docs/EndpointDirectionEnum.md)
232+
- [Model.EndpointEvent](docs/EndpointEvent.md)
233+
- [Model.EndpointEventTypeEnum](docs/EndpointEventTypeEnum.md)
234+
- [Model.EndpointResponse](docs/EndpointResponse.md)
235+
- [Model.EndpointStatusEnum](docs/EndpointStatusEnum.md)
236+
- [Model.EndpointTypeEnum](docs/EndpointTypeEnum.md)
237+
- [Model.Endpoints](docs/Endpoints.md)
218238
- [Model.Error](docs/Error.md)
219239
- [Model.ErrorObject](docs/ErrorObject.md)
240+
- [Model.ErrorResponse](docs/ErrorResponse.md)
220241
- [Model.ErrorSource](docs/ErrorSource.md)
221242
- [Model.FailureWebhook](docs/FailureWebhook.md)
222243
- [Model.FieldError](docs/FieldError.md)
@@ -234,6 +255,7 @@ Class | Method | HTTP request | Description
234255
- [Model.Link](docs/Link.md)
235256
- [Model.LinkSchema](docs/LinkSchema.md)
236257
- [Model.LinksObject](docs/LinksObject.md)
258+
- [Model.ListEndpointsResponse](docs/ListEndpointsResponse.md)
237259
- [Model.ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md)
238260
- [Model.ListMessageItem](docs/ListMessageItem.md)
239261
- [Model.LookupErrorResponse](docs/LookupErrorResponse.md)
@@ -277,6 +299,7 @@ Class | Method | HTTP request | Description
277299
- [Model.MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md)
278300
- [Model.MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md)
279301
- [Model.OptInWorkflow](docs/OptInWorkflow.md)
302+
- [Model.Page](docs/Page.md)
280303
- [Model.PageInfo](docs/PageInfo.md)
281304
- [Model.PriorityEnum](docs/PriorityEnum.md)
282305
- [Model.ProductTypeEnum](docs/ProductTypeEnum.md)
@@ -305,6 +328,8 @@ Class | Method | HTTP request | Description
305328
- [Model.RecordingTranscriptions](docs/RecordingTranscriptions.md)
306329
- [Model.RedirectCallback](docs/RedirectCallback.md)
307330
- [Model.RedirectMethodEnum](docs/RedirectMethodEnum.md)
331+
- [Model.SipConnectionMetadata](docs/SipConnectionMetadata.md)
332+
- [Model.SipCredentials](docs/SipCredentials.md)
308333
- [Model.SmsMessageContent](docs/SmsMessageContent.md)
309334
- [Model.StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md)
310335
- [Model.StatusCallback](docs/StatusCallback.md)

0 commit comments

Comments
 (0)