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.Test/Unit/Api/EndpointsApiTests.cs b/src/Bandwidth.Standard.Test/Unit/Api/EndpointsApiTests.cs
new file mode 100644
index 00000000..175d0b32
--- /dev/null
+++ b/src/Bandwidth.Standard.Test/Unit/Api/EndpointsApiTests.cs
@@ -0,0 +1,589 @@
+/*
+ * 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.IO;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reflection;
+using RestSharp;
+using Xunit;
+
+using Bandwidth.Standard.Client;
+using Bandwidth.Standard.Api;
+using Bandwidth.Standard.Model;
+using Moq;
+using System.Net;
+
+namespace Bandwidth.Standard.Test.Unit.Api
+{
+ ///
+ /// Class for testing EndpointsApi
+ ///
+ public class EndpointsApiTests : IDisposable
+ {
+ private EndpointsApi instance;
+ private Mock mockClient;
+ private Mock mockAsynchronousClient;
+ private Configuration fakeConfiguration;
+
+ public EndpointsApiTests()
+ {
+ mockClient = new Mock();
+ mockAsynchronousClient = new Mock();
+ fakeConfiguration = new Configuration();
+ fakeConfiguration.BasePath = "https://voice.bandwidth.com/api/v2";
+ fakeConfiguration.Username = "username";
+ fakeConfiguration.Password = "password";
+ instance = new EndpointsApi(mockClient.Object, mockAsynchronousClient.Object, fakeConfiguration);
+ }
+
+ public void Dispose()
+ {
+ // Cleanup when everything is done.
+ }
+
+ ///
+ /// Test an instance of EndpointsApi
+ ///
+ [Fact]
+ public void InstanceTest()
+ {
+ Assert.IsType(instance);
+ }
+
+ ///
+ /// Test CreateEndpoint
+ ///
+ [Fact]
+ public void CreateEndpointTest()
+ {
+ string accountId = "9900000";
+ DateTime creationTime = new DateTime(2021, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ DateTime expirationTime = new DateTime(2021, 1, 2, 0, 0, 0, DateTimeKind.Utc);
+
+ CreateWebRtcConnectionRequest webRtcRequest = new CreateWebRtcConnectionRequest(
+ type: EndpointTypeEnum.WEBRTC,
+ direction: EndpointDirectionEnum.OUTBOUND,
+ tag: "test-endpoint"
+ );
+ CreateEndpointRequest createEndpointRequest = new CreateEndpointRequest(webRtcRequest);
+
+ CreateEndpointResponseObject responseData = new CreateEndpointResponseObject(
+ endpointId: "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85",
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.CONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime,
+ token: "test-token-abc123"
+ );
+
+ CreateEndpointResponse endpointResponse = new CreateEndpointResponse(
+ links: new List(),
+ data: responseData,
+ errors: new List()
+ );
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Created, endpointResponse);
+ mockClient.Setup(x => x.Post("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ var response = instance.CreateEndpointWithHttpInfo(accountId, createEndpointRequest);
+
+ Assert.IsType>(response);
+ Assert.Equal(HttpStatusCode.Created, response.StatusCode);
+ Assert.NotNull(response.Data);
+ Assert.NotNull(response.Data.Data);
+ Assert.Equal("e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85", response.Data.Data.EndpointId);
+ Assert.Equal("test-token-abc123", response.Data.Data.Token);
+ }
+
+ ///
+ /// Test failed CreateEndpoint Request
+ ///
+ [Fact]
+ public void CreateEndpointBadRequest()
+ {
+ string accountId = "9900000";
+ CreateWebRtcConnectionRequest webRtcRequest = new CreateWebRtcConnectionRequest(
+ type: EndpointTypeEnum.WEBRTC,
+ direction: EndpointDirectionEnum.OUTBOUND,
+ tag: "invalid-tag-with-too-many-characters-that-exceeds-maximum-length-allowed"
+ );
+ CreateEndpointRequest createEndpointRequest = new CreateEndpointRequest(webRtcRequest);
+
+ var apiResponse = new ApiResponse(HttpStatusCode.BadRequest, null);
+ mockClient.Setup(x => x.Post("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.CreateEndpoint(accountId, createEndpointRequest));
+
+ Assert.Equal("Error calling CreateEndpoint: ", Exception.Message);
+ Assert.Equal(400, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test unauthorized CreateEndpoint Request
+ ///
+ [Fact]
+ public void CreateEndpointUnauthorizedRequest()
+ {
+ string accountId = "9900000";
+ CreateWebRtcConnectionRequest webRtcRequest = new CreateWebRtcConnectionRequest(
+ type: EndpointTypeEnum.WEBRTC,
+ direction: EndpointDirectionEnum.OUTBOUND,
+ tag: "test-endpoint"
+ );
+ CreateEndpointRequest createEndpointRequest = new CreateEndpointRequest(webRtcRequest);
+ fakeConfiguration.Username = "badUsername";
+ fakeConfiguration.Password = "badPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Unauthorized, null);
+ mockClient.Setup(x => x.Post("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.CreateEndpoint(accountId, createEndpointRequest));
+
+ Assert.Equal("Error calling CreateEndpoint: ", Exception.Message);
+ Assert.Equal(401, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test forbidden CreateEndpoint Request
+ ///
+ [Fact]
+ public void CreateEndpointForbiddenRequest()
+ {
+ string accountId = "9900000";
+ CreateWebRtcConnectionRequest webRtcRequest = new CreateWebRtcConnectionRequest(
+ type: EndpointTypeEnum.WEBRTC,
+ direction: EndpointDirectionEnum.OUTBOUND,
+ tag: "test-endpoint"
+ );
+ CreateEndpointRequest createEndpointRequest = new CreateEndpointRequest(webRtcRequest);
+ fakeConfiguration.Username = "forbiddenUsername";
+ fakeConfiguration.Password = "forbiddenPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Forbidden, null);
+ mockClient.Setup(x => x.Post("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.CreateEndpoint(accountId, createEndpointRequest));
+
+ Assert.Equal("Error calling CreateEndpoint: ", Exception.Message);
+ Assert.Equal(403, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test GetEndpoint
+ ///
+ [Fact]
+ public void GetEndpointTest()
+ {
+ string accountId = "9900000";
+ string endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
+ DateTime creationTime = new DateTime(2021, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ DateTime expirationTime = new DateTime(2021, 1, 2, 0, 0, 0, DateTimeKind.Utc);
+
+ Endpoint endpointData = new Endpoint(
+ endpointId: endpointId,
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.CONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime,
+ tag: "test-endpoint"
+ );
+
+ EndpointResponse endpointResponse = new EndpointResponse(
+ links: new List(),
+ data: endpointData,
+ errors: new List()
+ );
+
+ var apiResponse = new ApiResponse(HttpStatusCode.OK, endpointResponse);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints/{endpointId}", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ var response = instance.GetEndpointWithHttpInfo(accountId, endpointId);
+
+ Assert.IsType>(response);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.NotNull(response.Data);
+ Assert.NotNull(response.Data.Data);
+ Assert.Equal(endpointId, response.Data.Data.EndpointId);
+ Assert.Equal("test-endpoint", response.Data.Data.Tag);
+ }
+
+ ///
+ /// Test unauthorized GetEndpoint Request
+ ///
+ [Fact]
+ public void GetEndpointUnauthorizedRequest()
+ {
+ string accountId = "9900000";
+ string endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
+ fakeConfiguration.Username = "badUsername";
+ fakeConfiguration.Password = "badPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Unauthorized, null);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints/{endpointId}", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.GetEndpoint(accountId, endpointId));
+
+ Assert.Equal("Error calling GetEndpoint: ", Exception.Message);
+ Assert.Equal(401, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test forbidden GetEndpoint Request
+ ///
+ [Fact]
+ public void GetEndpointForbiddenRequest()
+ {
+ string accountId = "9900000";
+ string endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
+ fakeConfiguration.Username = "forbiddenUsername";
+ fakeConfiguration.Password = "forbiddenPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Forbidden, null);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints/{endpointId}", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.GetEndpoint(accountId, endpointId));
+
+ Assert.Equal("Error calling GetEndpoint: ", Exception.Message);
+ Assert.Equal(403, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test not found GetEndpoint Request
+ ///
+ [Fact]
+ public void GetEndpointNotFoundRequest()
+ {
+ string accountId = "9900000";
+ string endpointId = "not-a-valid-endpoint-id";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.NotFound, null);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints/{endpointId}", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.GetEndpoint(accountId, endpointId));
+
+ Assert.Equal("Error calling GetEndpoint: ", Exception.Message);
+ Assert.Equal(404, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test ListEndpoints
+ ///
+ [Fact]
+ public void ListEndpointsTest()
+ {
+ string accountId = "9900000";
+ DateTime creationTime = new DateTime(2021, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ DateTime expirationTime = new DateTime(2021, 1, 2, 0, 0, 0, DateTimeKind.Utc);
+
+ Endpoints endpoint1 = new Endpoints(
+ endpointId: "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85",
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.CONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime,
+ tag: "endpoint-1"
+ );
+
+ Endpoints endpoint2 = new Endpoints(
+ endpointId: "e-25ac29a2-2331029c-3cb0-5a07-c225-c32875772d95",
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.DISCONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime,
+ tag: "endpoint-2"
+ );
+
+ ListEndpointsResponse listResponse = new ListEndpointsResponse(
+ links: new List(),
+ data: new List { endpoint1, endpoint2 },
+ errors: new List()
+ );
+
+ var apiResponse = new ApiResponse(HttpStatusCode.OK, listResponse);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ var response = instance.ListEndpointsWithHttpInfo(accountId);
+
+ Assert.IsType>(response);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.NotNull(response.Data);
+ Assert.NotNull(response.Data.Data);
+ Assert.Equal(2, response.Data.Data.Count);
+ Assert.Equal("endpoint-1", response.Data.Data[0].Tag);
+ Assert.Equal("endpoint-2", response.Data.Data[1].Tag);
+ }
+
+ ///
+ /// Test ListEndpoints with type filter
+ ///
+ [Fact]
+ public void ListEndpointsWithTypeFilterTest()
+ {
+ string accountId = "9900000";
+ DateTime creationTime = new DateTime(2021, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ DateTime expirationTime = new DateTime(2021, 1, 2, 0, 0, 0, DateTimeKind.Utc);
+
+ Endpoints endpoint1 = new Endpoints(
+ endpointId: "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85",
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.CONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime
+ );
+
+ ListEndpointsResponse listResponse = new ListEndpointsResponse(
+ links: new List(),
+ data: new List { endpoint1 },
+ errors: new List()
+ );
+
+ var apiResponse = new ApiResponse(HttpStatusCode.OK, listResponse);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ var response = instance.ListEndpointsWithHttpInfo(accountId, type: EndpointTypeEnum.WEBRTC);
+
+ Assert.IsType>(response);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.NotNull(response.Data.Data);
+ Assert.Single(response.Data.Data);
+ Assert.Equal(EndpointTypeEnum.WEBRTC, response.Data.Data[0].Type);
+ }
+
+ ///
+ /// Test ListEndpoints with status filter
+ ///
+ [Fact]
+ public void ListEndpointsWithStatusFilterTest()
+ {
+ string accountId = "9900000";
+ DateTime creationTime = new DateTime(2021, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+ DateTime expirationTime = new DateTime(2021, 1, 2, 0, 0, 0, DateTimeKind.Utc);
+
+ Endpoints endpoint1 = new Endpoints(
+ endpointId: "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85",
+ type: EndpointTypeEnum.WEBRTC,
+ status: EndpointStatusEnum.CONNECTED,
+ creationTimestamp: creationTime,
+ expirationTimestamp: expirationTime
+ );
+
+ ListEndpointsResponse listResponse = new ListEndpointsResponse(
+ links: new List(),
+ data: new List { endpoint1 },
+ errors: new List()
+ );
+
+ var apiResponse = new ApiResponse(HttpStatusCode.OK, listResponse);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ var response = instance.ListEndpointsWithHttpInfo(accountId, status: EndpointStatusEnum.CONNECTED);
+
+ Assert.IsType>(response);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ Assert.NotNull(response.Data.Data);
+ Assert.Single(response.Data.Data);
+ Assert.Equal(EndpointStatusEnum.CONNECTED, response.Data.Data[0].Status);
+ }
+
+ ///
+ /// Test unauthorized ListEndpoints Request
+ ///
+ [Fact]
+ public void ListEndpointsUnauthorizedRequest()
+ {
+ string accountId = "9900000";
+ fakeConfiguration.Username = "badUsername";
+ fakeConfiguration.Password = "badPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Unauthorized, null);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.ListEndpoints(accountId));
+
+ Assert.Equal("Error calling ListEndpoints: ", Exception.Message);
+ Assert.Equal(401, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test forbidden ListEndpoints Request
+ ///
+ [Fact]
+ public void ListEndpointsForbiddenRequest()
+ {
+ string accountId = "9900000";
+ fakeConfiguration.Username = "forbiddenUsername";
+ fakeConfiguration.Password = "forbiddenPassword";
+
+ var apiResponse = new ApiResponse(HttpStatusCode.Forbidden, null);
+ mockClient.Setup(x => x.Get("/accounts/{accountId}/endpoints", It.IsAny(), fakeConfiguration)).Returns(apiResponse);
+ ApiException Exception = Assert.Throws(() => instance.ListEndpoints(accountId));
+
+ Assert.Equal("Error calling ListEndpoints: ", Exception.Message);
+ Assert.Equal(403, Exception.ErrorCode);
+ }
+
+ ///
+ /// Test DeleteEndpoint
+ ///
+ [Fact]
+ public void DeleteEndpointTest()
+ {
+ string accountId = "9900000";
+ string endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
+
+ var apiResponse = new ApiResponse