From 9dc21102da95c2f05860bb770537709f23ea20c1 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Tue, 20 Jan 2026 15:55:12 -0500 Subject: [PATCH] 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. --- bandwidth.yml | 866 +++++++++- docs/CreateEndpointRequest.md | 15 + docs/CreateEndpointRequestBase.md | 14 + docs/CreateEndpointResponse.md | 12 + docs/CreateEndpointResponseObject.md | 17 + docs/CreateWebRtcConnectionRequest.md | 15 + docs/Device.md | 13 + docs/DeviceStatusEnum.md | 9 + docs/Endpoint.md | 16 + docs/EndpointDirectionEnum.md | 9 + docs/EndpointEvent.md | 19 + docs/EndpointEventTypeEnum.md | 9 + docs/EndpointResponse.md | 12 + docs/EndpointStatusEnum.md | 9 + docs/EndpointTypeEnum.md | 9 + docs/Endpoints.md | 15 + docs/EndpointsApi.md | 547 ++++++ docs/ErrorResponse.md | 12 + docs/ListEndpointsResponse.md | 13 + docs/Page.md | 13 + docs/SipConnectionMetadata.md | 13 + docs/SipCredentials.md | 11 + src/Bandwidth.Standard/Api/EndpointsApi.cs | 1515 +++++++++++++++++ .../Model/CreateEndpointRequest.cs | 216 +++ .../Model/CreateEndpointRequestBase.cs | 130 ++ .../Model/CreateEndpointResponse.cs | 121 ++ .../Model/CreateEndpointResponseObject.cs | 171 ++ .../Model/CreateWebRtcConnectionRequest.cs | 139 ++ src/Bandwidth.Standard/Model/Device.cs | 126 ++ .../Model/DeviceStatusEnum.cs | 48 + src/Bandwidth.Standard/Model/Endpoint.cs | 155 ++ .../Model/EndpointDirectionEnum.cs | 54 + src/Bandwidth.Standard/Model/EndpointEvent.cs | 175 ++ .../Model/EndpointEventTypeEnum.cs | 48 + .../Model/EndpointResponse.cs | 121 ++ .../Model/EndpointStatusEnum.cs | 48 + .../Model/EndpointTypeEnum.cs | 42 + src/Bandwidth.Standard/Model/Endpoints.cs | 146 ++ src/Bandwidth.Standard/Model/ErrorResponse.cs | 121 ++ .../Model/ListEndpointsResponse.cs | 130 ++ src/Bandwidth.Standard/Model/Page.cs | 147 ++ .../Model/SipConnectionMetadata.cs | 116 ++ .../Model/SipCredentials.cs | 96 ++ 43 files changed, 5520 insertions(+), 13 deletions(-) create mode 100644 docs/CreateEndpointRequest.md create mode 100644 docs/CreateEndpointRequestBase.md create mode 100644 docs/CreateEndpointResponse.md create mode 100644 docs/CreateEndpointResponseObject.md create mode 100644 docs/CreateWebRtcConnectionRequest.md create mode 100644 docs/Device.md create mode 100644 docs/DeviceStatusEnum.md create mode 100644 docs/Endpoint.md create mode 100644 docs/EndpointDirectionEnum.md create mode 100644 docs/EndpointEvent.md create mode 100644 docs/EndpointEventTypeEnum.md create mode 100644 docs/EndpointResponse.md create mode 100644 docs/EndpointStatusEnum.md create mode 100644 docs/EndpointTypeEnum.md create mode 100644 docs/Endpoints.md create mode 100644 docs/EndpointsApi.md create mode 100644 docs/ErrorResponse.md create mode 100644 docs/ListEndpointsResponse.md create mode 100644 docs/Page.md create mode 100644 docs/SipConnectionMetadata.md create mode 100644 docs/SipCredentials.md create mode 100644 src/Bandwidth.Standard/Api/EndpointsApi.cs create mode 100644 src/Bandwidth.Standard/Model/CreateEndpointRequest.cs create mode 100644 src/Bandwidth.Standard/Model/CreateEndpointRequestBase.cs create mode 100644 src/Bandwidth.Standard/Model/CreateEndpointResponse.cs create mode 100644 src/Bandwidth.Standard/Model/CreateEndpointResponseObject.cs create mode 100644 src/Bandwidth.Standard/Model/CreateWebRtcConnectionRequest.cs create mode 100644 src/Bandwidth.Standard/Model/Device.cs create mode 100644 src/Bandwidth.Standard/Model/DeviceStatusEnum.cs create mode 100644 src/Bandwidth.Standard/Model/Endpoint.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointDirectionEnum.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointEvent.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointEventTypeEnum.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointResponse.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointStatusEnum.cs create mode 100644 src/Bandwidth.Standard/Model/EndpointTypeEnum.cs create mode 100644 src/Bandwidth.Standard/Model/Endpoints.cs create mode 100644 src/Bandwidth.Standard/Model/ErrorResponse.cs create mode 100644 src/Bandwidth.Standard/Model/ListEndpointsResponse.cs create mode 100644 src/Bandwidth.Standard/Model/Page.cs create mode 100644 src/Bandwidth.Standard/Model/SipConnectionMetadata.cs create mode 100644 src/Bandwidth.Standard/Model/SipCredentials.cs diff --git a/bandwidth.yml b/bandwidth.yml index d7c32953..8b9998df 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -22,6 +22,7 @@ tags: - name: MFA - name: Phone Number Lookup - name: Toll-Free Verification + - name: Endpoints paths: /users/{accountId}/media: get: @@ -1682,6 +1683,165 @@ paths: '503': $ref: '#/components/responses/tfvServiceUnavailableResponse' servers: *ref_4 + /accounts/{accountId}/endpoints: + get: + tags: + - Endpoints + summary: List Endpoints + description: Returns a list of endpoints associated with the specified account. + operationId: listEndpoints + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointType' + - $ref: '#/components/parameters/endpointStatus' + - $ref: '#/components/parameters/afterCursor' + - $ref: '#/components/parameters/limit1' + responses: + '200': + $ref: '#/components/responses/listEndpointsResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + post: + tags: + - Endpoints + summary: Create Endpoint + description: Creates a new Endpoint for the specified account. + operationId: createEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/createEndpointRequest' + responses: + '201': + $ref: '#/components/responses/createEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + callbacks: + endpointEventCallback: + $ref: '#/components/callbacks/endpointEvent' + servers: &ref_5 + - url: https://api.bandwidth.com/v2 + description: Production + /accounts/{accountId}/endpoints/{endpointId}: + get: + tags: + - Endpoints + summary: Get Endpoint + description: Returns information about the specified endpoint. + operationId: getEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '200': + $ref: '#/components/responses/getEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + delete: + tags: + - Endpoints + summary: Delete Endpoint + description: >- + Deletes the specified endpoint. If the endpoint is actively streaming + media, the media stream will be terminated. + operationId: deleteEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 + /accounts/{accountId}/endpoints/{endpointId}/bxml: + put: + tags: + - Endpoints + summary: Update Endpoint BXML + description: Updates the BXML for the specified endpoint. + operationId: updateEndpointBxml + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + requestBody: + $ref: '#/components/requestBodies/updateEndpointBxmlRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 components: schemas: applicationId: @@ -1976,7 +2136,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2063,7 +2223,7 @@ components: description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. + linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, @@ -2385,7 +2545,7 @@ components: - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this - option is used by default. + option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. enum: @@ -2398,7 +2558,7 @@ components: Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2799,7 +2959,7 @@ components: to: type: string description: > - The destination phone number the message was sent to. + The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. @@ -2850,7 +3010,7 @@ components: client to a Bandwidth number. - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. @@ -3089,7 +3249,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -4026,7 +4186,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5729,7 +5889,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -5740,7 +5900,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date bandwidth last received - delivery status information for this phone number. + delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. @@ -6520,6 +6680,303 @@ components: nullable: true pattern: ^[ -~]{16,64}$ type: string + endpointId: + type: string + description: The unique ID of the endpoint. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + endpointStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + deviceStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + endpointTypeEnum: + type: string + enum: + - WEBRTC + endpointDirectionEnum: + type: string + enum: + - INBOUND + - OUTBOUND + - BIDIRECTIONAL + sipCredentials: + type: object + properties: + username: + type: string + description: The username for the SIP connection. + example: username + password: + type: string + description: The password for the SIP connection. + example: password + sipConnectionMetadata: + title: SIP Connection + type: object + properties: + ipAddress: + type: string + format: ipv4 + description: The IP address of the SIP connection. + example: 192.168.0.0 + port: + type: integer + description: The port of the SIP connection. + example: 5060 + credentials: + $ref: '#/components/schemas/sipCredentials' + uuiHeader: + type: string + description: The User-to-User Information header for the SIP connection. + example: my-uui-header + webRtcConnectionMetadata: + title: WebRTC Connection + type: object + endpointToken: + type: string + description: >- + The json web token specific to the endpoint. Used to authenticate the + client with the media gateway. + example: xxxxx.yyyyy.zzzzz + endpointTag: + type: string + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + device: + type: object + properties: + deviceId: + type: string + description: The unique ID of the device. + example: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: + type: string + description: The name of the device. + maximum: 1024 + example: David's iPhone + status: + $ref: '#/components/schemas/deviceStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the device was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + required: + - deviceId + - status + - creationTimestamp + endpoints: + type: object + properties: + endpointId: + $ref: '#/components/schemas/endpointId' + type: + $ref: '#/components/schemas/endpointTypeEnum' + status: + $ref: '#/components/schemas/endpointStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the endpoint was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + expirationTimestamp: + type: string + format: date-time + description: >- + The time the endpoint token will expire. In ISO-8601 format. Tokens + last 24 hours. + example: '2021-01-02T00:00:00Z' + tag: + $ref: '#/components/schemas/endpointTag' + required: + - endpointId + - type + - status + - creationTimestamp + - expirationTimestamp + endpoint: + type: object + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + devices: + type: array + items: + $ref: '#/components/schemas/device' + createWebRtcConnectionRequest: + allOf: + - $ref: '#/components/schemas/createEndpointRequestBase' + - type: object + properties: + connectionMetadata: + $ref: '#/components/schemas/webRtcConnectionMetadata' + createEndpointRequestBase: + type: object + properties: + type: + $ref: '#/components/schemas/endpointTypeEnum' + direction: + $ref: '#/components/schemas/endpointDirectionEnum' + eventCallbackUrl: + type: string + format: uri + description: The URL to send event callbacks to. + example: https://myapp.com/callback + eventFallbackUrl: + type: string + format: uri + description: The URL to send event fallbacks to. + example: https://fallback.myapp.com/callback + tag: + $ref: '#/components/schemas/endpointTag' + required: + - type + - direction + createEndpointRequest: + oneOf: + - $ref: '#/components/schemas/createWebRtcConnectionRequest' + discriminator: + propertyName: type + mapping: + WEBRTC: '#/components/schemas/createWebRtcConnectionRequest' + createEndpointResponseObject: + allOf: + - $ref: '#/components/schemas/endpoint' + - type: object + properties: + token: + $ref: '#/components/schemas/endpointToken' + required: + - token + endpointEventTypeEnum: + type: string + enum: + - DEVICE_CONNECTED + - DEVICE_DISCONNECTED + endpointEvent: + description: An event that occurred on an endpoint. + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + eventTime: + type: string + format: date-time + description: The time the event occurred. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + eventType: + $ref: '#/components/schemas/endpointEventTypeEnum' + device: + $ref: '#/components/schemas/device' + required: + - eventType + - eventTime + page: + type: object + properties: + pageSize: + type: integer + description: The number of items per page. + minimum: 0 + example: 10 + totalElements: + type: integer + description: The total number of items. + minimum: 0 + example: 100 + totalPages: + type: integer + description: The total number of pages. + minimum: 0 + example: 10 + pageNumber: + type: integer + description: The current page number. + minimum: 0 + example: 0 + required: + - pageSize + listEndpointsResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + page: + $ref: '#/components/schemas/page' + data: + type: array + items: + $ref: '#/components/schemas/endpoints' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + endpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/endpoint' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + createEndpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/createEndpointResponseObject' + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors + errorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + type: object + nullable: true + additionalProperties: false + errors: + type: array + items: + $ref: '#/components/schemas/error' + required: + - links + - data + - errors responses: createMessageResponse: description: Accepted @@ -7171,6 +7628,105 @@ components: example: description: Service Unavailable Error. type: Service Unavailable + listEndpointsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/listEndpointsResponse' + examples: + listEndpointsResponseExample: + $ref: '#/components/examples/listEndpointsResponseExample' + createEndpointResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointResponse' + examples: + createEndpointResponseExample: + $ref: '#/components/examples/createEndpointResponseExample' + getEndpointResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/endpointResponse' + examples: + getEndpointResponseExample: + $ref: '#/components/examples/getEndpointResponseExample' + badRequestErrorResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + badRequestErrorExample: + $ref: '#/components/examples/badRequestErrorExample' + unauthorizedErrorResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/unauthorizedErrorExample' + forbiddenErrorResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/forbiddenErrorExample' + notFoundErrorResponse: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + notFoundErrorExample: + $ref: '#/components/examples/notFoundErrorExample' + methodNotAllowedErrorResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + methodNotAllowedErrorExample: + $ref: '#/components/examples/methodNotAllowedErrorExample' + unsupportedMediaTypeErrorResponse: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unsuppotedMediaTypeErrorExample: + $ref: '#/components/examples/unsupportedMediaTypeErrorExample' + tooManyRequestsErrorResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/tooManyRequestsErrorExample' + serviceUnavailableErrorResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + serviceUnavailableErrorExample: + $ref: '#/components/examples/serviceUnavailableErrorExample' parameters: accountId: in: path @@ -7670,6 +8226,53 @@ components: type: string description: Webhook subscription ID example: 7bt57JcsVYJrN9K1OcV1Nu + accountId2: + name: accountId + in: path + required: true + schema: + type: string + example: '5500123' + description: Your Bandwidth Account ID. + endpointId: + name: endpointId + in: path + required: true + schema: + type: string + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: BRTC Endpoint ID. + endpointType: + name: type + in: query + schema: + $ref: '#/components/schemas/endpointTypeEnum' + description: The type of endpoint. + endpointStatus: + name: status + in: query + schema: + $ref: '#/components/schemas/endpointStatusEnum' + description: The status of the endpoint. + afterCursor: + name: afterCursor + in: query + schema: + type: string + example: TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + description: >- + The cursor to use for pagination. This is the value of the `next` link + in the previous response. + limit1: + name: limit + in: query + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + example: 2 + description: The maximum number of endpoints to return in the response. examples: smsMessageReceivedCallbackExample: summary: An example of a sms message-received callback body. @@ -8094,6 +8697,205 @@ components: Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time. + listEndpointsResponseExample: + summary: List Endpoints Paginated Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 + rel: self + method: GET + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + rel: next + method: GET + page: + pageSize: 2 + totalElements: 10 + totalPages: 5 + pageNumber: 0 + data: + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + - endpointId: e-2cb0-4a07-b215-b22865662d85-15ac29a2-1331029c + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + errors: [] + createEndpointResponseExample: + summary: Create Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: endpoint + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + token: xxxxx.yyyyy.zzzzz + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + getEndpointResponseExample: + summary: Get Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: self + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + createSipEndpointRequestExample: + summary: SIP Endpoint Example + value: + type: SIP + connectionMetadata: + ipAddress: 0.0.0.0 + port: 3000 + credentials: + username: username + password: '********' + uuiHeader: 123456;encoding=jwt + direction: INBOUND + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + createWeRtcEndpointExample: + summary: WebRTC Endpoint Example + value: + type: WEBRTC + direction: BIDIRECTIONAL + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + updateEndpointBxmlRequestExample: + summary: Update Endpoint BXML Request Example + value: + endpointDisconnectedEventExample: + summary: Endpoint Disconnected Event + value: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: DISCONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + eventTime: '2021-01-01T00:00:00Z' + eventType: DEVICE_DISCONNECTED + tag: my-tag + badRequestErrorExample: + summary: Bad Request Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: invalid_parameter + description: accountId must not contain any characters other than numbers. + code: '400' + source: + parameter: accountId + unauthorizedErrorExample: + summary: Unauthorized Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unauthorized + description: >- + The provided credentials are not authorized to access this + resource. + code: '401' + source: + header: Authorization + forbiddenErrorExample: + summary: Forbidden Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: forbidden + description: >- + The provided credentials are not authorized to access this + resource. + code: '403' + source: + header: Authorization + notFoundErrorExample: + summary: Not Found Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: resource_not_found + description: The requested resource was not found. + code: '404' + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + methodNotAllowedErrorExample: + summary: Method Not Allowed Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: method_not_allowed + description: The requested method is not allowed on this resource. + code: '405' + source: + parameter: accountId + unsupportedMediaTypeErrorExample: + summary: Unsupported Media Type Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unsupported_media_type + description: The provided media type is not supported. + code: '415' + source: + header: Content-Type + tooManyRequestsErrorExample: + summary: Too Many Requests Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: too_many_requests + description: The client has sent too many requests in a given amount of time. + code: '429' + serviceUnavailableErrorExample: + summary: Service Unavailable Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: service_unavailable + description: The service is currently unavailable. + code: '500' requestBodies: createMessageRequest: content: @@ -8449,6 +9251,30 @@ components: application/json: schema: $ref: '#/components/schemas/webhookSubscriptionRequestSchema' + createEndpointRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointRequest' + examples: + createWebRtcEndpointRequestExample: + $ref: '#/components/examples/createWeRtcEndpointExample' + updateEndpointBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: >- + The BXML document to update the endpoint with. This BXML document + will be executed against the endpoint when it is updated. + + For more information, please refer to our [BXML + documentation](/docs/voice/bxml/). + examples: + updateEndpointBxmlRequestExample: + $ref: '#/components/examples/updateEndpointBxmlRequestExample' securitySchemes: Basic: type: http @@ -8475,12 +9301,12 @@ components: required: true description: >-

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your + received (MO) message to your message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response + client's response to a suggestion response - or location request. + or location request.

The payload type will be one of message-received, suggestion-response, or @@ -8582,3 +9408,17 @@ components: $ref: '#/components/responses/tfvServerErrorResponse' '503': $ref: '#/components/responses/tfvServiceUnavailableResponse' + endpointEvent: + '{request.body#/eventCallbackUrl}': + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/endpointEvent' + examples: + endpointDisconnectedEventExample: + $ref: '#/components/examples/endpointDisconnectedEventExample' + responses: + '204': + description: Event was successfully received. diff --git a/docs/CreateEndpointRequest.md b/docs/CreateEndpointRequest.md new file mode 100644 index 00000000..85191aaf --- /dev/null +++ b/docs/CreateEndpointRequest.md @@ -0,0 +1,15 @@ +# Bandwidth.Standard.Model.CreateEndpointRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **EndpointTypeEnum** | | +**Direction** | **EndpointDirectionEnum** | | +**EventCallbackUrl** | **string** | The URL to send event callbacks to. | [optional] +**EventFallbackUrl** | **string** | The URL to send event fallbacks to. | [optional] +**Tag** | **string** | A tag for the endpoint. | [optional] +**ConnectionMetadata** | **Object** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateEndpointRequestBase.md b/docs/CreateEndpointRequestBase.md new file mode 100644 index 00000000..74bd841b --- /dev/null +++ b/docs/CreateEndpointRequestBase.md @@ -0,0 +1,14 @@ +# Bandwidth.Standard.Model.CreateEndpointRequestBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **EndpointTypeEnum** | | +**Direction** | **EndpointDirectionEnum** | | +**EventCallbackUrl** | **string** | The URL to send event callbacks to. | [optional] +**EventFallbackUrl** | **string** | The URL to send event fallbacks to. | [optional] +**Tag** | **string** | A tag for the endpoint. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md new file mode 100644 index 00000000..03fcc3d2 --- /dev/null +++ b/docs/CreateEndpointResponse.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.CreateEndpointResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | [**List<Link>**](Link.md) | | +**Data** | [**CreateEndpointResponseObject**](CreateEndpointResponseObject.md) | | +**Errors** | [**List<Error>**](Error.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateEndpointResponseObject.md b/docs/CreateEndpointResponseObject.md new file mode 100644 index 00000000..0a507c79 --- /dev/null +++ b/docs/CreateEndpointResponseObject.md @@ -0,0 +1,17 @@ +# Bandwidth.Standard.Model.CreateEndpointResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EndpointId** | **string** | The unique ID of the endpoint. | +**Type** | **EndpointTypeEnum** | | +**Status** | **EndpointStatusEnum** | | +**CreationTimestamp** | **DateTime** | The time the endpoint was created. In ISO-8601 format. | +**ExpirationTimestamp** | **DateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**Tag** | **string** | A tag for the endpoint. | [optional] +**Devices** | [**List<Device>**](Device.md) | | [optional] +**Token** | **string** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateWebRtcConnectionRequest.md b/docs/CreateWebRtcConnectionRequest.md new file mode 100644 index 00000000..15218581 --- /dev/null +++ b/docs/CreateWebRtcConnectionRequest.md @@ -0,0 +1,15 @@ +# Bandwidth.Standard.Model.CreateWebRtcConnectionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **EndpointTypeEnum** | | +**Direction** | **EndpointDirectionEnum** | | +**EventCallbackUrl** | **string** | The URL to send event callbacks to. | [optional] +**EventFallbackUrl** | **string** | The URL to send event fallbacks to. | [optional] +**Tag** | **string** | A tag for the endpoint. | [optional] +**ConnectionMetadata** | **Object** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Device.md b/docs/Device.md new file mode 100644 index 00000000..47118d3e --- /dev/null +++ b/docs/Device.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.Device + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceId** | **string** | The unique ID of the device. | +**DeviceName** | **string** | The name of the device. | [optional] +**Status** | **DeviceStatusEnum** | | +**CreationTimestamp** | **DateTime** | The time the device was created. In ISO-8601 format. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DeviceStatusEnum.md b/docs/DeviceStatusEnum.md new file mode 100644 index 00000000..8b771e90 --- /dev/null +++ b/docs/DeviceStatusEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.DeviceStatusEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Endpoint.md b/docs/Endpoint.md new file mode 100644 index 00000000..a95e6f15 --- /dev/null +++ b/docs/Endpoint.md @@ -0,0 +1,16 @@ +# Bandwidth.Standard.Model.Endpoint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EndpointId** | **string** | The unique ID of the endpoint. | +**Type** | **EndpointTypeEnum** | | +**Status** | **EndpointStatusEnum** | | +**CreationTimestamp** | **DateTime** | The time the endpoint was created. In ISO-8601 format. | +**ExpirationTimestamp** | **DateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**Tag** | **string** | A tag for the endpoint. | [optional] +**Devices** | [**List<Device>**](Device.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointDirectionEnum.md b/docs/EndpointDirectionEnum.md new file mode 100644 index 00000000..ea4b6f5c --- /dev/null +++ b/docs/EndpointDirectionEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.EndpointDirectionEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointEvent.md b/docs/EndpointEvent.md new file mode 100644 index 00000000..68f2e9d8 --- /dev/null +++ b/docs/EndpointEvent.md @@ -0,0 +1,19 @@ +# Bandwidth.Standard.Model.EndpointEvent +An event that occurred on an endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EndpointId** | **string** | The unique ID of the endpoint. | +**Type** | **EndpointTypeEnum** | | +**Status** | **EndpointStatusEnum** | | +**CreationTimestamp** | **DateTime** | The time the endpoint was created. In ISO-8601 format. | +**ExpirationTimestamp** | **DateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**Tag** | **string** | A tag for the endpoint. | [optional] +**EventTime** | **DateTime** | The time the event occurred. In ISO-8601 format. | +**EventType** | **EndpointEventTypeEnum** | | +**Device** | [**Device**](Device.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointEventTypeEnum.md b/docs/EndpointEventTypeEnum.md new file mode 100644 index 00000000..7b514ca5 --- /dev/null +++ b/docs/EndpointEventTypeEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.EndpointEventTypeEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md new file mode 100644 index 00000000..e304334d --- /dev/null +++ b/docs/EndpointResponse.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.EndpointResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | [**List<Link>**](Link.md) | | +**Data** | [**Endpoint**](Endpoint.md) | | +**Errors** | [**List<Error>**](Error.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointStatusEnum.md b/docs/EndpointStatusEnum.md new file mode 100644 index 00000000..bd518090 --- /dev/null +++ b/docs/EndpointStatusEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.EndpointStatusEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointTypeEnum.md b/docs/EndpointTypeEnum.md new file mode 100644 index 00000000..9f01d480 --- /dev/null +++ b/docs/EndpointTypeEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.EndpointTypeEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Endpoints.md b/docs/Endpoints.md new file mode 100644 index 00000000..ee7a6f31 --- /dev/null +++ b/docs/Endpoints.md @@ -0,0 +1,15 @@ +# Bandwidth.Standard.Model.Endpoints + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EndpointId** | **string** | The unique ID of the endpoint. | +**Type** | **EndpointTypeEnum** | | +**Status** | **EndpointStatusEnum** | | +**CreationTimestamp** | **DateTime** | The time the endpoint was created. In ISO-8601 format. | +**ExpirationTimestamp** | **DateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | +**Tag** | **string** | A tag for the endpoint. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md new file mode 100644 index 00000000..c8483024 --- /dev/null +++ b/docs/EndpointsApi.md @@ -0,0 +1,547 @@ +# Bandwidth.Standard.Api.EndpointsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**CreateEndpoint**](EndpointsApi.md#createendpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint | +| [**DeleteEndpoint**](EndpointsApi.md#deleteendpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint | +| [**GetEndpoint**](EndpointsApi.md#getendpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint | +| [**ListEndpoints**](EndpointsApi.md#listendpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints | +| [**UpdateEndpointBxml**](EndpointsApi.md#updateendpointbxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML | + + +# **CreateEndpoint** +> CreateEndpointResponse CreateEndpoint (string accountId, CreateEndpointRequest createEndpointRequest) + +Create Endpoint + +Creates a new Endpoint for the specified account. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class CreateEndpointExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + // Configure OAuth2 access token for authorization: OAuth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new EndpointsApi(config); + var accountId = 5500123; // string | Your Bandwidth Account ID. + var createEndpointRequest = new CreateEndpointRequest(); // CreateEndpointRequest | + + try + { + // Create Endpoint + CreateEndpointResponse result = apiInstance.CreateEndpoint(accountId, createEndpointRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EndpointsApi.CreateEndpoint: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateEndpointWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Endpoint + ApiResponse response = apiInstance.CreateEndpointWithHttpInfo(accountId, createEndpointRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling EndpointsApi.CreateEndpointWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **createEndpointRequest** | [**CreateEndpointRequest**](CreateEndpointRequest.md) | | | + +### Return type + +[**CreateEndpointResponse**](CreateEndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteEndpoint** +> void DeleteEndpoint (string accountId, string endpointId) + +Delete Endpoint + +Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class DeleteEndpointExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + // Configure OAuth2 access token for authorization: OAuth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new EndpointsApi(config); + var accountId = 5500123; // string | Your Bandwidth Account ID. + var endpointId = e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | BRTC Endpoint ID. + + try + { + // Delete Endpoint + apiInstance.DeleteEndpoint(accountId, endpointId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EndpointsApi.DeleteEndpoint: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteEndpointWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Endpoint + apiInstance.DeleteEndpointWithHttpInfo(accountId, endpointId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling EndpointsApi.DeleteEndpointWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **endpointId** | **string** | BRTC Endpoint ID. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetEndpoint** +> EndpointResponse GetEndpoint (string accountId, string endpointId) + +Get Endpoint + +Returns information about the specified endpoint. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class GetEndpointExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + // Configure OAuth2 access token for authorization: OAuth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new EndpointsApi(config); + var accountId = 5500123; // string | Your Bandwidth Account ID. + var endpointId = e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | BRTC Endpoint ID. + + try + { + // Get Endpoint + EndpointResponse result = apiInstance.GetEndpoint(accountId, endpointId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EndpointsApi.GetEndpoint: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetEndpointWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Endpoint + ApiResponse response = apiInstance.GetEndpointWithHttpInfo(accountId, endpointId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling EndpointsApi.GetEndpointWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **endpointId** | **string** | BRTC Endpoint ID. | | + +### Return type + +[**EndpointResponse**](EndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ListEndpoints** +> ListEndpointsResponse ListEndpoints (string accountId, EndpointTypeEnum? type = null, EndpointStatusEnum? status = null, string afterCursor = null, int? limit = null) + +List Endpoints + +Returns a list of endpoints associated with the specified account. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class ListEndpointsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + // Configure OAuth2 access token for authorization: OAuth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new EndpointsApi(config); + var accountId = 5500123; // string | Your Bandwidth Account ID. + var type = (EndpointTypeEnum) "WEBRTC"; // EndpointTypeEnum? | The type of endpoint. (optional) + var status = (EndpointStatusEnum) "CONNECTED"; // EndpointStatusEnum? | The status of the endpoint. (optional) + var afterCursor = TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ==; // string | The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + var limit = 2; // int? | The maximum number of endpoints to return in the response. (optional) (default to 100) + + try + { + // List Endpoints + ListEndpointsResponse result = apiInstance.ListEndpoints(accountId, type, status, afterCursor, limit); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EndpointsApi.ListEndpoints: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListEndpointsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Endpoints + ApiResponse response = apiInstance.ListEndpointsWithHttpInfo(accountId, type, status, afterCursor, limit); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling EndpointsApi.ListEndpointsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **type** | **EndpointTypeEnum?** | The type of endpoint. | [optional] | +| **status** | **EndpointStatusEnum?** | The status of the endpoint. | [optional] | +| **afterCursor** | **string** | The cursor to use for pagination. This is the value of the `next` link in the previous response. | [optional] | +| **limit** | **int?** | The maximum number of endpoints to return in the response. | [optional] [default to 100] | + +### Return type + +[**ListEndpointsResponse**](ListEndpointsResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateEndpointBxml** +> void UpdateEndpointBxml (string accountId, string endpointId, string body) + +Update Endpoint BXML + +Updates the BXML for the specified endpoint. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class UpdateEndpointBxmlExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + // Configure OAuth2 access token for authorization: OAuth2 + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new EndpointsApi(config); + var accountId = 5500123; // string | Your Bandwidth Account ID. + var endpointId = e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | BRTC Endpoint ID. + var body = "body_example"; // string | + + try + { + // Update Endpoint BXML + apiInstance.UpdateEndpointBxml(accountId, endpointId, body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EndpointsApi.UpdateEndpointBxml: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateEndpointBxmlWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update Endpoint BXML + apiInstance.UpdateEndpointBxmlWithHttpInfo(accountId, endpointId, body); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling EndpointsApi.UpdateEndpointBxmlWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **endpointId** | **string** | BRTC Endpoint ID. | | +| **body** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/xml + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 00000000..ca74313d --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | [**List<Link>**](Link.md) | | +**Data** | **Object** | | +**Errors** | [**List<Error>**](Error.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md new file mode 100644 index 00000000..bc29ba64 --- /dev/null +++ b/docs/ListEndpointsResponse.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.ListEndpointsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | [**List<Link>**](Link.md) | | +**Page** | [**Page**](Page.md) | | [optional] +**Data** | [**List<Endpoints>**](Endpoints.md) | | +**Errors** | [**List<Error>**](Error.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Page.md b/docs/Page.md new file mode 100644 index 00000000..aa3b20f3 --- /dev/null +++ b/docs/Page.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.Page + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PageSize** | **int** | The number of items per page. | +**TotalElements** | **int** | The total number of items. | [optional] +**TotalPages** | **int** | The total number of pages. | [optional] +**PageNumber** | **int** | The current page number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SipConnectionMetadata.md b/docs/SipConnectionMetadata.md new file mode 100644 index 00000000..54610c42 --- /dev/null +++ b/docs/SipConnectionMetadata.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.SipConnectionMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpAddress** | **string** | The IP address of the SIP connection. | [optional] +**Port** | **int** | The port of the SIP connection. | [optional] +**Credentials** | [**SipCredentials**](SipCredentials.md) | | [optional] +**UuiHeader** | **string** | The User-to-User Information header for the SIP connection. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SipCredentials.md b/docs/SipCredentials.md new file mode 100644 index 00000000..77165841 --- /dev/null +++ b/docs/SipCredentials.md @@ -0,0 +1,11 @@ +# Bandwidth.Standard.Model.SipCredentials + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The username for the SIP connection. | [optional] +**Password** | **string** | The password for the SIP connection. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/src/Bandwidth.Standard/Api/EndpointsApi.cs b/src/Bandwidth.Standard/Api/EndpointsApi.cs new file mode 100644 index 00000000..cb412ea9 --- /dev/null +++ b/src/Bandwidth.Standard/Api/EndpointsApi.cs @@ -0,0 +1,1515 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Client.Auth; +using Bandwidth.Standard.Model; + +namespace Bandwidth.Standard.Api +{ + + ///

+ /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEndpointsApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create Endpoint + /// + /// + /// Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// CreateEndpointResponse + CreateEndpointResponse CreateEndpoint(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0); + + /// + /// Create Endpoint + /// + /// + /// Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// ApiResponse of CreateEndpointResponse + ApiResponse CreateEndpointWithHttpInfo(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0); + /// + /// Delete Endpoint + /// + /// + /// Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// + void DeleteEndpoint(string accountId, string endpointId, int operationIndex = 0); + + /// + /// Delete Endpoint + /// + /// + /// Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteEndpointWithHttpInfo(string accountId, string endpointId, int operationIndex = 0); + /// + /// Get Endpoint + /// + /// + /// Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// EndpointResponse + EndpointResponse GetEndpoint(string accountId, string endpointId, int operationIndex = 0); + + /// + /// Get Endpoint + /// + /// + /// Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// ApiResponse of EndpointResponse + ApiResponse GetEndpointWithHttpInfo(string accountId, string endpointId, int operationIndex = 0); + /// + /// List Endpoints + /// + /// + /// Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// ListEndpointsResponse + ListEndpointsResponse ListEndpoints(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0); + + /// + /// List Endpoints + /// + /// + /// Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// ApiResponse of ListEndpointsResponse + ApiResponse ListEndpointsWithHttpInfo(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0); + /// + /// Update Endpoint BXML + /// + /// + /// Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// + void UpdateEndpointBxml(string accountId, string endpointId, string body, int operationIndex = 0); + + /// + /// Update Endpoint BXML + /// + /// + /// Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateEndpointBxmlWithHttpInfo(string accountId, string endpointId, string body, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEndpointsApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create Endpoint + /// + /// + /// Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CreateEndpointResponse + System.Threading.Tasks.Task CreateEndpointAsync(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create Endpoint + /// + /// + /// Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CreateEndpointResponse) + System.Threading.Tasks.Task> CreateEndpointWithHttpInfoAsync(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete Endpoint + /// + /// + /// Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteEndpointAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete Endpoint + /// + /// + /// Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteEndpointWithHttpInfoAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Endpoint + /// + /// + /// Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of EndpointResponse + System.Threading.Tasks.Task GetEndpointAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Endpoint + /// + /// + /// Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (EndpointResponse) + System.Threading.Tasks.Task> GetEndpointWithHttpInfoAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List Endpoints + /// + /// + /// Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ListEndpointsResponse + System.Threading.Tasks.Task ListEndpointsAsync(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List Endpoints + /// + /// + /// Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ListEndpointsResponse) + System.Threading.Tasks.Task> ListEndpointsWithHttpInfoAsync(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update Endpoint BXML + /// + /// + /// Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateEndpointBxmlAsync(string accountId, string endpointId, string body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update Endpoint BXML + /// + /// + /// Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateEndpointBxmlWithHttpInfoAsync(string accountId, string endpointId, string body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IEndpointsApi : IEndpointsApiSync, IEndpointsApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class EndpointsApi : IEndpointsApi + { + private Bandwidth.Standard.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public EndpointsApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public EndpointsApi(string basePath) + { + this.Configuration = Bandwidth.Standard.Client.Configuration.MergeConfigurations( + Bandwidth.Standard.Client.GlobalConfiguration.Instance, + new Bandwidth.Standard.Client.Configuration { BasePath = basePath } + ); + this.Client = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public EndpointsApi(Bandwidth.Standard.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Bandwidth.Standard.Client.Configuration.MergeConfigurations( + Bandwidth.Standard.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public EndpointsApi(Bandwidth.Standard.Client.ISynchronousClient client, Bandwidth.Standard.Client.IAsynchronousClient asyncClient, Bandwidth.Standard.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Bandwidth.Standard.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Bandwidth.Standard.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Bandwidth.Standard.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Bandwidth.Standard.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Create Endpoint Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// CreateEndpointResponse + public CreateEndpointResponse CreateEndpoint(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = CreateEndpointWithHttpInfo(accountId, createEndpointRequest); + return localVarResponse.Data; + } + + /// + /// Create Endpoint Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// ApiResponse of CreateEndpointResponse + public Bandwidth.Standard.Client.ApiResponse CreateEndpointWithHttpInfo(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->CreateEndpoint"); + } + + // verify the required parameter 'createEndpointRequest' is set + if (createEndpointRequest == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'createEndpointRequest' when calling EndpointsApi->CreateEndpoint"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = createEndpointRequest; + + localVarRequestOptions.Operation = "EndpointsApi.CreateEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/accounts/{accountId}/endpoints", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create Endpoint Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CreateEndpointResponse + public async System.Threading.Tasks.Task CreateEndpointAsync(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await CreateEndpointWithHttpInfoAsync(accountId, createEndpointRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create Endpoint Creates a new Endpoint for the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CreateEndpointResponse) + public async System.Threading.Tasks.Task> CreateEndpointWithHttpInfoAsync(string accountId, CreateEndpointRequest createEndpointRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->CreateEndpoint"); + } + + // verify the required parameter 'createEndpointRequest' is set + if (createEndpointRequest == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'createEndpointRequest' when calling EndpointsApi->CreateEndpoint"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = createEndpointRequest; + + localVarRequestOptions.Operation = "EndpointsApi.CreateEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/accounts/{accountId}/endpoints", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Endpoint Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// + public void DeleteEndpoint(string accountId, string endpointId, int operationIndex = 0) + { + DeleteEndpointWithHttpInfo(accountId, endpointId); + } + + /// + /// Delete Endpoint Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Bandwidth.Standard.Client.ApiResponse DeleteEndpointWithHttpInfo(string accountId, string endpointId, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->DeleteEndpoint"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->DeleteEndpoint"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + + localVarRequestOptions.Operation = "EndpointsApi.DeleteEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/accounts/{accountId}/endpoints/{endpointId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Endpoint Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteEndpointAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await DeleteEndpointWithHttpInfoAsync(accountId, endpointId, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Endpoint Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteEndpointWithHttpInfoAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->DeleteEndpoint"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->DeleteEndpoint"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + + localVarRequestOptions.Operation = "EndpointsApi.DeleteEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/accounts/{accountId}/endpoints/{endpointId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Endpoint Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// EndpointResponse + public EndpointResponse GetEndpoint(string accountId, string endpointId, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = GetEndpointWithHttpInfo(accountId, endpointId); + return localVarResponse.Data; + } + + /// + /// Get Endpoint Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// ApiResponse of EndpointResponse + public Bandwidth.Standard.Client.ApiResponse GetEndpointWithHttpInfo(string accountId, string endpointId, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->GetEndpoint"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->GetEndpoint"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + + localVarRequestOptions.Operation = "EndpointsApi.GetEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/accounts/{accountId}/endpoints/{endpointId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Endpoint Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of EndpointResponse + public async System.Threading.Tasks.Task GetEndpointAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await GetEndpointWithHttpInfoAsync(accountId, endpointId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Endpoint Returns information about the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (EndpointResponse) + public async System.Threading.Tasks.Task> GetEndpointWithHttpInfoAsync(string accountId, string endpointId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->GetEndpoint"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->GetEndpoint"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + + localVarRequestOptions.Operation = "EndpointsApi.GetEndpoint"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/accounts/{accountId}/endpoints/{endpointId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetEndpoint", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Endpoints Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// ListEndpointsResponse + public ListEndpointsResponse ListEndpoints(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = ListEndpointsWithHttpInfo(accountId, type, status, afterCursor, limit); + return localVarResponse.Data; + } + + /// + /// List Endpoints Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// ApiResponse of ListEndpointsResponse + public Bandwidth.Standard.Client.ApiResponse ListEndpointsWithHttpInfo(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->ListEndpoints"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + if (type != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "type", type)); + } + if (status != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "status", status)); + } + if (afterCursor != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "afterCursor", afterCursor)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "EndpointsApi.ListEndpoints"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/accounts/{accountId}/endpoints", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListEndpoints", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Endpoints Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ListEndpointsResponse + public async System.Threading.Tasks.Task ListEndpointsAsync(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await ListEndpointsWithHttpInfoAsync(accountId, type, status, afterCursor, limit, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Endpoints Returns a list of endpoints associated with the specified account. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// The type of endpoint. (optional) + /// The status of the endpoint. (optional) + /// The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + /// The maximum number of endpoints to return in the response. (optional, default to 100) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ListEndpointsResponse) + public async System.Threading.Tasks.Task> ListEndpointsWithHttpInfoAsync(string accountId, EndpointTypeEnum? type = default(EndpointTypeEnum?), EndpointStatusEnum? status = default(EndpointStatusEnum?), string afterCursor = default(string), int? limit = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->ListEndpoints"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + if (type != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "type", type)); + } + if (status != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "status", status)); + } + if (afterCursor != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "afterCursor", afterCursor)); + } + if (limit != null) + { + localVarRequestOptions.QueryParameters.Add(Bandwidth.Standard.Client.ClientUtils.ParameterToMultiMap("", "limit", limit)); + } + + localVarRequestOptions.Operation = "EndpointsApi.ListEndpoints"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/accounts/{accountId}/endpoints", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListEndpoints", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Endpoint BXML Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// + public void UpdateEndpointBxml(string accountId, string endpointId, string body, int operationIndex = 0) + { + UpdateEndpointBxmlWithHttpInfo(accountId, endpointId, body); + } + + /// + /// Update Endpoint BXML Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Bandwidth.Standard.Client.ApiResponse UpdateEndpointBxmlWithHttpInfo(string accountId, string endpointId, string body, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->UpdateEndpointBxml"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->UpdateEndpointBxml"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'body' when calling EndpointsApi->UpdateEndpointBxml"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "EndpointsApi.UpdateEndpointBxml"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/accounts/{accountId}/endpoints/{endpointId}/bxml", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateEndpointBxml", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Endpoint BXML Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateEndpointBxmlAsync(string accountId, string endpointId, string body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await UpdateEndpointBxmlWithHttpInfoAsync(accountId, endpointId, body, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update Endpoint BXML Updates the BXML for the specified endpoint. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// BRTC Endpoint ID. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateEndpointBxmlWithHttpInfoAsync(string accountId, string endpointId, string body, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling EndpointsApi->UpdateEndpointBxml"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'endpointId' when calling EndpointsApi->UpdateEndpointBxml"); + } + + // verify the required parameter 'body' is set + if (body == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'body' when calling EndpointsApi->UpdateEndpointBxml"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("endpointId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(endpointId)); // path parameter + localVarRequestOptions.Data = body; + + localVarRequestOptions.Operation = "EndpointsApi.UpdateEndpointBxml"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (OAuth2) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/accounts/{accountId}/endpoints/{endpointId}/bxml", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateEndpointBxml", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/Bandwidth.Standard/Model/CreateEndpointRequest.cs b/src/Bandwidth.Standard/Model/CreateEndpointRequest.cs new file mode 100644 index 00000000..8128521f --- /dev/null +++ b/src/Bandwidth.Standard/Model/CreateEndpointRequest.cs @@ -0,0 +1,216 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Bandwidth.Standard.Model +{ + /// + /// CreateEndpointRequest + /// + [JsonConverter(typeof(CreateEndpointRequestJsonConverter))] + [DataContract(Name = "createEndpointRequest")] + public partial class CreateEndpointRequest : AbstractOpenAPISchema, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of CreateWebRtcConnectionRequest. + public CreateEndpointRequest(CreateWebRtcConnectionRequest actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(CreateWebRtcConnectionRequest) || value is CreateWebRtcConnectionRequest) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: CreateWebRtcConnectionRequest"); + } + } + } + + /// + /// Get the actual instance of `CreateWebRtcConnectionRequest`. If the actual instance is not `CreateWebRtcConnectionRequest`, + /// the InvalidClassException will be thrown + /// + /// An instance of CreateWebRtcConnectionRequest + public CreateWebRtcConnectionRequest GetCreateWebRtcConnectionRequest() + { + return (CreateWebRtcConnectionRequest)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CreateEndpointRequest {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, CreateEndpointRequest.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of CreateEndpointRequest + /// + /// JSON string + /// An instance of CreateEndpointRequest + public static CreateEndpointRequest FromJson(string jsonString) + { + CreateEndpointRequest newCreateEndpointRequest = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newCreateEndpointRequest; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(CreateWebRtcConnectionRequest).GetProperty("AdditionalProperties") == null) + { + newCreateEndpointRequest = new CreateEndpointRequest(JsonConvert.DeserializeObject(jsonString, CreateEndpointRequest.SerializerSettings)); + } + else + { + newCreateEndpointRequest = new CreateEndpointRequest(JsonConvert.DeserializeObject(jsonString, CreateEndpointRequest.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("CreateWebRtcConnectionRequest"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into CreateWebRtcConnectionRequest: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newCreateEndpointRequest; + } + + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for CreateEndpointRequest + /// + public class CreateEndpointRequestJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(CreateEndpointRequest).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return CreateEndpointRequest.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return CreateEndpointRequest.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/CreateEndpointRequestBase.cs b/src/Bandwidth.Standard/Model/CreateEndpointRequestBase.cs new file mode 100644 index 00000000..4bc7b9d1 --- /dev/null +++ b/src/Bandwidth.Standard/Model/CreateEndpointRequestBase.cs @@ -0,0 +1,130 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// CreateEndpointRequestBase + /// + [DataContract(Name = "createEndpointRequestBase")] + public partial class CreateEndpointRequestBase : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Direction + /// + [DataMember(Name = "direction", IsRequired = true, EmitDefaultValue = true)] + public EndpointDirectionEnum Direction { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CreateEndpointRequestBase() { } + /// + /// Initializes a new instance of the class. + /// + /// type (required). + /// direction (required). + /// The URL to send event callbacks to.. + /// The URL to send event fallbacks to.. + /// A tag for the endpoint.. + public CreateEndpointRequestBase(EndpointTypeEnum type = default(EndpointTypeEnum), EndpointDirectionEnum direction = default(EndpointDirectionEnum), string eventCallbackUrl = default(string), string eventFallbackUrl = default(string), string tag = default(string)) + { + this.Type = type; + this.Direction = direction; + this.EventCallbackUrl = eventCallbackUrl; + this.EventFallbackUrl = eventFallbackUrl; + this.Tag = tag; + } + + /// + /// The URL to send event callbacks to. + /// + /// The URL to send event callbacks to. + /// https://myapp.com/callback + [DataMember(Name = "eventCallbackUrl", EmitDefaultValue = false)] + public string EventCallbackUrl { get; set; } + + /// + /// The URL to send event fallbacks to. + /// + /// The URL to send event fallbacks to. + /// https://fallback.myapp.com/callback + [DataMember(Name = "eventFallbackUrl", EmitDefaultValue = false)] + public string EventFallbackUrl { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateEndpointRequestBase {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Direction: ").Append(Direction).Append("\n"); + sb.Append(" EventCallbackUrl: ").Append(EventCallbackUrl).Append("\n"); + sb.Append(" EventFallbackUrl: ").Append(EventFallbackUrl).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/CreateEndpointResponse.cs b/src/Bandwidth.Standard/Model/CreateEndpointResponse.cs new file mode 100644 index 00000000..ab791dfc --- /dev/null +++ b/src/Bandwidth.Standard/Model/CreateEndpointResponse.cs @@ -0,0 +1,121 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// CreateEndpointResponse + /// + [DataContract(Name = "createEndpointResponse")] + public partial class CreateEndpointResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CreateEndpointResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// links (required). + /// data (required). + /// errors (required). + public CreateEndpointResponse(List links = default(List), CreateEndpointResponseObject data = default(CreateEndpointResponseObject), List errors = default(List)) + { + // to ensure "links" is required (not null) + if (links == null) + { + throw new ArgumentNullException("links is a required property for CreateEndpointResponse and cannot be null"); + } + this.Links = links; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for CreateEndpointResponse and cannot be null"); + } + this.Data = data; + // to ensure "errors" is required (not null) + if (errors == null) + { + throw new ArgumentNullException("errors is a required property for CreateEndpointResponse and cannot be null"); + } + this.Errors = errors; + } + + /// + /// Gets or Sets Links + /// + [DataMember(Name = "links", IsRequired = true, EmitDefaultValue = true)] + public List Links { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public CreateEndpointResponseObject Data { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", IsRequired = true, EmitDefaultValue = true)] + public List Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateEndpointResponse {\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/CreateEndpointResponseObject.cs b/src/Bandwidth.Standard/Model/CreateEndpointResponseObject.cs new file mode 100644 index 00000000..a6dd6d11 --- /dev/null +++ b/src/Bandwidth.Standard/Model/CreateEndpointResponseObject.cs @@ -0,0 +1,171 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// CreateEndpointResponseObject + /// + [DataContract(Name = "createEndpointResponseObject")] + public partial class CreateEndpointResponseObject : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public EndpointStatusEnum Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CreateEndpointResponseObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique ID of the endpoint. (required). + /// type (required). + /// status (required). + /// The time the endpoint was created. In ISO-8601 format. (required). + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. (required). + /// A tag for the endpoint.. + /// devices. + /// The json web token specific to the endpoint. Used to authenticate the client with the media gateway. (required). + public CreateEndpointResponseObject(string endpointId = default(string), EndpointTypeEnum type = default(EndpointTypeEnum), EndpointStatusEnum status = default(EndpointStatusEnum), DateTime creationTimestamp = default(DateTime), DateTime expirationTimestamp = default(DateTime), string tag = default(string), List devices = default(List), string token = default(string)) + { + // to ensure "endpointId" is required (not null) + if (endpointId == null) + { + throw new ArgumentNullException("endpointId is a required property for CreateEndpointResponseObject and cannot be null"); + } + this.EndpointId = endpointId; + this.Type = type; + this.Status = status; + this.CreationTimestamp = creationTimestamp; + this.ExpirationTimestamp = expirationTimestamp; + // to ensure "token" is required (not null) + if (token == null) + { + throw new ArgumentNullException("token is a required property for CreateEndpointResponseObject and cannot be null"); + } + this.Token = token; + this.Tag = tag; + this.Devices = devices; + } + + /// + /// The unique ID of the endpoint. + /// + /// The unique ID of the endpoint. + /// e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + [DataMember(Name = "endpointId", IsRequired = true, EmitDefaultValue = true)] + public string EndpointId { get; set; } + + /// + /// The time the endpoint was created. In ISO-8601 format. + /// + /// The time the endpoint was created. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "creationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime CreationTimestamp { get; set; } + + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// 2021-01-02T00:00Z + [DataMember(Name = "expirationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime ExpirationTimestamp { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// Gets or Sets Devices + /// + [DataMember(Name = "devices", EmitDefaultValue = false)] + public List Devices { get; set; } + + /// + /// The json web token specific to the endpoint. Used to authenticate the client with the media gateway. + /// + /// The json web token specific to the endpoint. Used to authenticate the client with the media gateway. + /// xxxxx.yyyyy.zzzzz + [DataMember(Name = "token", IsRequired = true, EmitDefaultValue = true)] + public string Token { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateEndpointResponseObject {\n"); + sb.Append(" EndpointId: ").Append(EndpointId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CreationTimestamp: ").Append(CreationTimestamp).Append("\n"); + sb.Append(" ExpirationTimestamp: ").Append(ExpirationTimestamp).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append(" Devices: ").Append(Devices).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/CreateWebRtcConnectionRequest.cs b/src/Bandwidth.Standard/Model/CreateWebRtcConnectionRequest.cs new file mode 100644 index 00000000..d4d78349 --- /dev/null +++ b/src/Bandwidth.Standard/Model/CreateWebRtcConnectionRequest.cs @@ -0,0 +1,139 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// CreateWebRtcConnectionRequest + /// + [DataContract(Name = "createWebRtcConnectionRequest")] + public partial class CreateWebRtcConnectionRequest : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Direction + /// + [DataMember(Name = "direction", IsRequired = true, EmitDefaultValue = true)] + public EndpointDirectionEnum Direction { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CreateWebRtcConnectionRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// type (required). + /// direction (required). + /// The URL to send event callbacks to.. + /// The URL to send event fallbacks to.. + /// A tag for the endpoint.. + /// connectionMetadata. + public CreateWebRtcConnectionRequest(EndpointTypeEnum type = default(EndpointTypeEnum), EndpointDirectionEnum direction = default(EndpointDirectionEnum), string eventCallbackUrl = default(string), string eventFallbackUrl = default(string), string tag = default(string), Object connectionMetadata = default(Object)) + { + this.Type = type; + this.Direction = direction; + this.EventCallbackUrl = eventCallbackUrl; + this.EventFallbackUrl = eventFallbackUrl; + this.Tag = tag; + this.ConnectionMetadata = connectionMetadata; + } + + /// + /// The URL to send event callbacks to. + /// + /// The URL to send event callbacks to. + /// https://myapp.com/callback + [DataMember(Name = "eventCallbackUrl", EmitDefaultValue = false)] + public string EventCallbackUrl { get; set; } + + /// + /// The URL to send event fallbacks to. + /// + /// The URL to send event fallbacks to. + /// https://fallback.myapp.com/callback + [DataMember(Name = "eventFallbackUrl", EmitDefaultValue = false)] + public string EventFallbackUrl { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// Gets or Sets ConnectionMetadata + /// + [DataMember(Name = "connectionMetadata", EmitDefaultValue = false)] + public Object ConnectionMetadata { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateWebRtcConnectionRequest {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Direction: ").Append(Direction).Append("\n"); + sb.Append(" EventCallbackUrl: ").Append(EventCallbackUrl).Append("\n"); + sb.Append(" EventFallbackUrl: ").Append(EventFallbackUrl).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append(" ConnectionMetadata: ").Append(ConnectionMetadata).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/Device.cs b/src/Bandwidth.Standard/Model/Device.cs new file mode 100644 index 00000000..df902929 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Device.cs @@ -0,0 +1,126 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Device + /// + [DataContract(Name = "device")] + public partial class Device : IValidatableObject + { + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public DeviceStatusEnum Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Device() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique ID of the device. (required). + /// The name of the device.. + /// status (required). + /// The time the device was created. In ISO-8601 format. (required). + public Device(string deviceId = default(string), string deviceName = default(string), DeviceStatusEnum status = default(DeviceStatusEnum), DateTime creationTimestamp = default(DateTime)) + { + // to ensure "deviceId" is required (not null) + if (deviceId == null) + { + throw new ArgumentNullException("deviceId is a required property for Device and cannot be null"); + } + this.DeviceId = deviceId; + this.Status = status; + this.CreationTimestamp = creationTimestamp; + this.DeviceName = deviceName; + } + + /// + /// The unique ID of the device. + /// + /// The unique ID of the device. + /// d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + [DataMember(Name = "deviceId", IsRequired = true, EmitDefaultValue = true)] + public string DeviceId { get; set; } + + /// + /// The name of the device. + /// + /// The name of the device. + /// David's iPhone + [DataMember(Name = "deviceName", EmitDefaultValue = false)] + public string DeviceName { get; set; } + + /// + /// The time the device was created. In ISO-8601 format. + /// + /// The time the device was created. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "creationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime CreationTimestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Device {\n"); + sb.Append(" DeviceId: ").Append(DeviceId).Append("\n"); + sb.Append(" DeviceName: ").Append(DeviceName).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CreationTimestamp: ").Append(CreationTimestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/DeviceStatusEnum.cs b/src/Bandwidth.Standard/Model/DeviceStatusEnum.cs new file mode 100644 index 00000000..3c9eb5b8 --- /dev/null +++ b/src/Bandwidth.Standard/Model/DeviceStatusEnum.cs @@ -0,0 +1,48 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines deviceStatusEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DeviceStatusEnum + { + /// + /// Enum CONNECTED for value: CONNECTED + /// + [EnumMember(Value = "CONNECTED")] + CONNECTED = 1, + + /// + /// Enum DISCONNECTED for value: DISCONNECTED + /// + [EnumMember(Value = "DISCONNECTED")] + DISCONNECTED = 2 + } + +} diff --git a/src/Bandwidth.Standard/Model/Endpoint.cs b/src/Bandwidth.Standard/Model/Endpoint.cs new file mode 100644 index 00000000..4f30c048 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Endpoint.cs @@ -0,0 +1,155 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Endpoint + /// + [DataContract(Name = "endpoint")] + public partial class Endpoint : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public EndpointStatusEnum Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Endpoint() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique ID of the endpoint. (required). + /// type (required). + /// status (required). + /// The time the endpoint was created. In ISO-8601 format. (required). + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. (required). + /// A tag for the endpoint.. + /// devices. + public Endpoint(string endpointId = default(string), EndpointTypeEnum type = default(EndpointTypeEnum), EndpointStatusEnum status = default(EndpointStatusEnum), DateTime creationTimestamp = default(DateTime), DateTime expirationTimestamp = default(DateTime), string tag = default(string), List devices = default(List)) + { + // to ensure "endpointId" is required (not null) + if (endpointId == null) + { + throw new ArgumentNullException("endpointId is a required property for Endpoint and cannot be null"); + } + this.EndpointId = endpointId; + this.Type = type; + this.Status = status; + this.CreationTimestamp = creationTimestamp; + this.ExpirationTimestamp = expirationTimestamp; + this.Tag = tag; + this.Devices = devices; + } + + /// + /// The unique ID of the endpoint. + /// + /// The unique ID of the endpoint. + /// e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + [DataMember(Name = "endpointId", IsRequired = true, EmitDefaultValue = true)] + public string EndpointId { get; set; } + + /// + /// The time the endpoint was created. In ISO-8601 format. + /// + /// The time the endpoint was created. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "creationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime CreationTimestamp { get; set; } + + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// 2021-01-02T00:00Z + [DataMember(Name = "expirationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime ExpirationTimestamp { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// Gets or Sets Devices + /// + [DataMember(Name = "devices", EmitDefaultValue = false)] + public List Devices { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Endpoint {\n"); + sb.Append(" EndpointId: ").Append(EndpointId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CreationTimestamp: ").Append(CreationTimestamp).Append("\n"); + sb.Append(" ExpirationTimestamp: ").Append(ExpirationTimestamp).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append(" Devices: ").Append(Devices).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointDirectionEnum.cs b/src/Bandwidth.Standard/Model/EndpointDirectionEnum.cs new file mode 100644 index 00000000..e5337cd2 --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointDirectionEnum.cs @@ -0,0 +1,54 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines endpointDirectionEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EndpointDirectionEnum + { + /// + /// Enum INBOUND for value: INBOUND + /// + [EnumMember(Value = "INBOUND")] + INBOUND = 1, + + /// + /// Enum OUTBOUND for value: OUTBOUND + /// + [EnumMember(Value = "OUTBOUND")] + OUTBOUND = 2, + + /// + /// Enum BIDIRECTIONAL for value: BIDIRECTIONAL + /// + [EnumMember(Value = "BIDIRECTIONAL")] + BIDIRECTIONAL = 3 + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointEvent.cs b/src/Bandwidth.Standard/Model/EndpointEvent.cs new file mode 100644 index 00000000..9b1d98a1 --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointEvent.cs @@ -0,0 +1,175 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// An event that occurred on an endpoint. + /// + [DataContract(Name = "endpointEvent")] + public partial class EndpointEvent : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public EndpointStatusEnum Status { get; set; } + + /// + /// Gets or Sets EventType + /// + [DataMember(Name = "eventType", IsRequired = true, EmitDefaultValue = true)] + public EndpointEventTypeEnum EventType { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EndpointEvent() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique ID of the endpoint. (required). + /// type (required). + /// status (required). + /// The time the endpoint was created. In ISO-8601 format. (required). + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. (required). + /// A tag for the endpoint.. + /// The time the event occurred. In ISO-8601 format. (required). + /// eventType (required). + /// device. + public EndpointEvent(string endpointId = default(string), EndpointTypeEnum type = default(EndpointTypeEnum), EndpointStatusEnum status = default(EndpointStatusEnum), DateTime creationTimestamp = default(DateTime), DateTime expirationTimestamp = default(DateTime), string tag = default(string), DateTime eventTime = default(DateTime), EndpointEventTypeEnum eventType = default(EndpointEventTypeEnum), Device device = default(Device)) + { + // to ensure "endpointId" is required (not null) + if (endpointId == null) + { + throw new ArgumentNullException("endpointId is a required property for EndpointEvent and cannot be null"); + } + this.EndpointId = endpointId; + this.Type = type; + this.Status = status; + this.CreationTimestamp = creationTimestamp; + this.ExpirationTimestamp = expirationTimestamp; + this.EventTime = eventTime; + this.EventType = eventType; + this.Tag = tag; + this.Device = device; + } + + /// + /// The unique ID of the endpoint. + /// + /// The unique ID of the endpoint. + /// e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + [DataMember(Name = "endpointId", IsRequired = true, EmitDefaultValue = true)] + public string EndpointId { get; set; } + + /// + /// The time the endpoint was created. In ISO-8601 format. + /// + /// The time the endpoint was created. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "creationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime CreationTimestamp { get; set; } + + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// 2021-01-02T00:00Z + [DataMember(Name = "expirationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime ExpirationTimestamp { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// The time the event occurred. In ISO-8601 format. + /// + /// The time the event occurred. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "eventTime", IsRequired = true, EmitDefaultValue = true)] + public DateTime EventTime { get; set; } + + /// + /// Gets or Sets Device + /// + [DataMember(Name = "device", EmitDefaultValue = false)] + public Device Device { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EndpointEvent {\n"); + sb.Append(" EndpointId: ").Append(EndpointId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CreationTimestamp: ").Append(CreationTimestamp).Append("\n"); + sb.Append(" ExpirationTimestamp: ").Append(ExpirationTimestamp).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append(" EventTime: ").Append(EventTime).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" Device: ").Append(Device).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointEventTypeEnum.cs b/src/Bandwidth.Standard/Model/EndpointEventTypeEnum.cs new file mode 100644 index 00000000..5fcaf5cc --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointEventTypeEnum.cs @@ -0,0 +1,48 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines endpointEventTypeEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EndpointEventTypeEnum + { + /// + /// Enum CONNECTED for value: DEVICE_CONNECTED + /// + [EnumMember(Value = "DEVICE_CONNECTED")] + CONNECTED = 1, + + /// + /// Enum DISCONNECTED for value: DEVICE_DISCONNECTED + /// + [EnumMember(Value = "DEVICE_DISCONNECTED")] + DISCONNECTED = 2 + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointResponse.cs b/src/Bandwidth.Standard/Model/EndpointResponse.cs new file mode 100644 index 00000000..967013f9 --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointResponse.cs @@ -0,0 +1,121 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// EndpointResponse + /// + [DataContract(Name = "endpointResponse")] + public partial class EndpointResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EndpointResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// links (required). + /// data (required). + /// errors (required). + public EndpointResponse(List links = default(List), Endpoint data = default(Endpoint), List errors = default(List)) + { + // to ensure "links" is required (not null) + if (links == null) + { + throw new ArgumentNullException("links is a required property for EndpointResponse and cannot be null"); + } + this.Links = links; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for EndpointResponse and cannot be null"); + } + this.Data = data; + // to ensure "errors" is required (not null) + if (errors == null) + { + throw new ArgumentNullException("errors is a required property for EndpointResponse and cannot be null"); + } + this.Errors = errors; + } + + /// + /// Gets or Sets Links + /// + [DataMember(Name = "links", IsRequired = true, EmitDefaultValue = true)] + public List Links { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public Endpoint Data { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", IsRequired = true, EmitDefaultValue = true)] + public List Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EndpointResponse {\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointStatusEnum.cs b/src/Bandwidth.Standard/Model/EndpointStatusEnum.cs new file mode 100644 index 00000000..6342ca44 --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointStatusEnum.cs @@ -0,0 +1,48 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines endpointStatusEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EndpointStatusEnum + { + /// + /// Enum CONNECTED for value: CONNECTED + /// + [EnumMember(Value = "CONNECTED")] + CONNECTED = 1, + + /// + /// Enum DISCONNECTED for value: DISCONNECTED + /// + [EnumMember(Value = "DISCONNECTED")] + DISCONNECTED = 2 + } + +} diff --git a/src/Bandwidth.Standard/Model/EndpointTypeEnum.cs b/src/Bandwidth.Standard/Model/EndpointTypeEnum.cs new file mode 100644 index 00000000..02acca0c --- /dev/null +++ b/src/Bandwidth.Standard/Model/EndpointTypeEnum.cs @@ -0,0 +1,42 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines endpointTypeEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EndpointTypeEnum + { + /// + /// Enum WEBRTC for value: WEBRTC + /// + [EnumMember(Value = "WEBRTC")] + WEBRTC = 1 + } + +} diff --git a/src/Bandwidth.Standard/Model/Endpoints.cs b/src/Bandwidth.Standard/Model/Endpoints.cs new file mode 100644 index 00000000..5118b383 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Endpoints.cs @@ -0,0 +1,146 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Endpoints + /// + [DataContract(Name = "endpoints")] + public partial class Endpoints : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public EndpointTypeEnum Type { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public EndpointStatusEnum Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Endpoints() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique ID of the endpoint. (required). + /// type (required). + /// status (required). + /// The time the endpoint was created. In ISO-8601 format. (required). + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. (required). + /// A tag for the endpoint.. + public Endpoints(string endpointId = default(string), EndpointTypeEnum type = default(EndpointTypeEnum), EndpointStatusEnum status = default(EndpointStatusEnum), DateTime creationTimestamp = default(DateTime), DateTime expirationTimestamp = default(DateTime), string tag = default(string)) + { + // to ensure "endpointId" is required (not null) + if (endpointId == null) + { + throw new ArgumentNullException("endpointId is a required property for Endpoints and cannot be null"); + } + this.EndpointId = endpointId; + this.Type = type; + this.Status = status; + this.CreationTimestamp = creationTimestamp; + this.ExpirationTimestamp = expirationTimestamp; + this.Tag = tag; + } + + /// + /// The unique ID of the endpoint. + /// + /// The unique ID of the endpoint. + /// e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + [DataMember(Name = "endpointId", IsRequired = true, EmitDefaultValue = true)] + public string EndpointId { get; set; } + + /// + /// The time the endpoint was created. In ISO-8601 format. + /// + /// The time the endpoint was created. In ISO-8601 format. + /// 2021-01-01T00:00Z + [DataMember(Name = "creationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime CreationTimestamp { get; set; } + + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// + /// The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + /// 2021-01-02T00:00Z + [DataMember(Name = "expirationTimestamp", IsRequired = true, EmitDefaultValue = true)] + public DateTime ExpirationTimestamp { get; set; } + + /// + /// A tag for the endpoint. + /// + /// A tag for the endpoint. + /// my-tag + [DataMember(Name = "tag", EmitDefaultValue = false)] + public string Tag { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Endpoints {\n"); + sb.Append(" EndpointId: ").Append(EndpointId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CreationTimestamp: ").Append(CreationTimestamp).Append("\n"); + sb.Append(" ExpirationTimestamp: ").Append(ExpirationTimestamp).Append("\n"); + sb.Append(" Tag: ").Append(Tag).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/ErrorResponse.cs b/src/Bandwidth.Standard/Model/ErrorResponse.cs new file mode 100644 index 00000000..bbd18219 --- /dev/null +++ b/src/Bandwidth.Standard/Model/ErrorResponse.cs @@ -0,0 +1,121 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// ErrorResponse + /// + [DataContract(Name = "errorResponse")] + public partial class ErrorResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ErrorResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// links (required). + /// data (required). + /// errors (required). + public ErrorResponse(List links = default(List), Object data = default(Object), List errors = default(List)) + { + // to ensure "links" is required (not null) + if (links == null) + { + throw new ArgumentNullException("links is a required property for ErrorResponse and cannot be null"); + } + this.Links = links; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for ErrorResponse and cannot be null"); + } + this.Data = data; + // to ensure "errors" is required (not null) + if (errors == null) + { + throw new ArgumentNullException("errors is a required property for ErrorResponse and cannot be null"); + } + this.Errors = errors; + } + + /// + /// Gets or Sets Links + /// + [DataMember(Name = "links", IsRequired = true, EmitDefaultValue = true)] + public List Links { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public Object Data { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", IsRequired = true, EmitDefaultValue = true)] + public List Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ErrorResponse {\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/ListEndpointsResponse.cs b/src/Bandwidth.Standard/Model/ListEndpointsResponse.cs new file mode 100644 index 00000000..c1f321f1 --- /dev/null +++ b/src/Bandwidth.Standard/Model/ListEndpointsResponse.cs @@ -0,0 +1,130 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// ListEndpointsResponse + /// + [DataContract(Name = "listEndpointsResponse")] + public partial class ListEndpointsResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ListEndpointsResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// links (required). + /// page. + /// data (required). + /// errors (required). + public ListEndpointsResponse(List links = default(List), Page page = default(Page), List data = default(List), List errors = default(List)) + { + // to ensure "links" is required (not null) + if (links == null) + { + throw new ArgumentNullException("links is a required property for ListEndpointsResponse and cannot be null"); + } + this.Links = links; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for ListEndpointsResponse and cannot be null"); + } + this.Data = data; + // to ensure "errors" is required (not null) + if (errors == null) + { + throw new ArgumentNullException("errors is a required property for ListEndpointsResponse and cannot be null"); + } + this.Errors = errors; + this.Page = page; + } + + /// + /// Gets or Sets Links + /// + [DataMember(Name = "links", IsRequired = true, EmitDefaultValue = true)] + public List Links { get; set; } + + /// + /// Gets or Sets Page + /// + [DataMember(Name = "page", EmitDefaultValue = false)] + public Page Page { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public List Data { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", IsRequired = true, EmitDefaultValue = true)] + public List Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ListEndpointsResponse {\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); + sb.Append(" Page: ").Append(Page).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/Page.cs b/src/Bandwidth.Standard/Model/Page.cs new file mode 100644 index 00000000..7f8baa35 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Page.cs @@ -0,0 +1,147 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Page + /// + [DataContract(Name = "page")] + public partial class Page : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Page() { } + /// + /// Initializes a new instance of the class. + /// + /// The number of items per page. (required). + /// The total number of items.. + /// The total number of pages.. + /// The current page number.. + public Page(int pageSize = default(int), int totalElements = default(int), int totalPages = default(int), int pageNumber = default(int)) + { + this.PageSize = pageSize; + this.TotalElements = totalElements; + this.TotalPages = totalPages; + this.PageNumber = pageNumber; + } + + /// + /// The number of items per page. + /// + /// The number of items per page. + /// 10 + [DataMember(Name = "pageSize", IsRequired = true, EmitDefaultValue = true)] + public int PageSize { get; set; } + + /// + /// The total number of items. + /// + /// The total number of items. + /// 100 + [DataMember(Name = "totalElements", EmitDefaultValue = false)] + public int TotalElements { get; set; } + + /// + /// The total number of pages. + /// + /// The total number of pages. + /// 10 + [DataMember(Name = "totalPages", EmitDefaultValue = false)] + public int TotalPages { get; set; } + + /// + /// The current page number. + /// + /// The current page number. + /// 0 + [DataMember(Name = "pageNumber", EmitDefaultValue = false)] + public int PageNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Page {\n"); + sb.Append(" PageSize: ").Append(PageSize).Append("\n"); + sb.Append(" TotalElements: ").Append(TotalElements).Append("\n"); + sb.Append(" TotalPages: ").Append(TotalPages).Append("\n"); + sb.Append(" PageNumber: ").Append(PageNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PageSize (int) minimum + if (this.PageSize < (int)0) + { + yield return new ValidationResult("Invalid value for PageSize, must be a value greater than or equal to 0.", new [] { "PageSize" }); + } + + // TotalElements (int) minimum + if (this.TotalElements < (int)0) + { + yield return new ValidationResult("Invalid value for TotalElements, must be a value greater than or equal to 0.", new [] { "TotalElements" }); + } + + // TotalPages (int) minimum + if (this.TotalPages < (int)0) + { + yield return new ValidationResult("Invalid value for TotalPages, must be a value greater than or equal to 0.", new [] { "TotalPages" }); + } + + // PageNumber (int) minimum + if (this.PageNumber < (int)0) + { + yield return new ValidationResult("Invalid value for PageNumber, must be a value greater than or equal to 0.", new [] { "PageNumber" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/SipConnectionMetadata.cs b/src/Bandwidth.Standard/Model/SipConnectionMetadata.cs new file mode 100644 index 00000000..961fd998 --- /dev/null +++ b/src/Bandwidth.Standard/Model/SipConnectionMetadata.cs @@ -0,0 +1,116 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// SipConnectionMetadata + /// + [DataContract(Name = "sipConnectionMetadata")] + public partial class SipConnectionMetadata : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The IP address of the SIP connection.. + /// The port of the SIP connection.. + /// credentials. + /// The User-to-User Information header for the SIP connection.. + public SipConnectionMetadata(string ipAddress = default(string), int port = default(int), SipCredentials credentials = default(SipCredentials), string uuiHeader = default(string)) + { + this.IpAddress = ipAddress; + this.Port = port; + this.Credentials = credentials; + this.UuiHeader = uuiHeader; + } + + /// + /// The IP address of the SIP connection. + /// + /// The IP address of the SIP connection. + /// 192.168.0.0 + [DataMember(Name = "ipAddress", EmitDefaultValue = false)] + public string IpAddress { get; set; } + + /// + /// The port of the SIP connection. + /// + /// The port of the SIP connection. + /// 5060 + [DataMember(Name = "port", EmitDefaultValue = false)] + public int Port { get; set; } + + /// + /// Gets or Sets Credentials + /// + [DataMember(Name = "credentials", EmitDefaultValue = false)] + public SipCredentials Credentials { get; set; } + + /// + /// The User-to-User Information header for the SIP connection. + /// + /// The User-to-User Information header for the SIP connection. + /// my-uui-header + [DataMember(Name = "uuiHeader", EmitDefaultValue = false)] + public string UuiHeader { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SipConnectionMetadata {\n"); + sb.Append(" IpAddress: ").Append(IpAddress).Append("\n"); + sb.Append(" Port: ").Append(Port).Append("\n"); + sb.Append(" Credentials: ").Append(Credentials).Append("\n"); + sb.Append(" UuiHeader: ").Append(UuiHeader).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/SipCredentials.cs b/src/Bandwidth.Standard/Model/SipCredentials.cs new file mode 100644 index 00000000..b7ee6811 --- /dev/null +++ b/src/Bandwidth.Standard/Model/SipCredentials.cs @@ -0,0 +1,96 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// SipCredentials + /// + [DataContract(Name = "sipCredentials")] + public partial class SipCredentials : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The username for the SIP connection.. + /// The password for the SIP connection.. + public SipCredentials(string username = default(string), string password = default(string)) + { + this.Username = username; + this.Password = password; + } + + /// + /// The username for the SIP connection. + /// + /// The username for the SIP connection. + /// username + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// The password for the SIP connection. + /// + /// The password for the SIP connection. + /// password + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SipCredentials {\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +}