From 540a64caf282a91786f9d3835c3ea06d0038a090 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:24:52 -0400 Subject: [PATCH 01/29] Update bandwidth.yml --- bandwidth.yml | 1364 +++++++++++++++++++++---------------------------- 1 file changed, 596 insertions(+), 768 deletions(-) diff --git a/bandwidth.yml b/bandwidth.yml index 218a51c9..1cbcd06f 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -18,8 +18,6 @@ tags: - name: Statistics - name: MFA - name: Phone Number Lookup - - name: Participants - - name: Sessions paths: /users/{accountId}/media: get: @@ -42,6 +40,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -72,6 +72,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -85,6 +87,10 @@ paths: some control to your media file. + If a file is uploaded with the same name as a file that already exists + under this account, the previous file will be overwritten. + + A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). operationId: uploadMedia @@ -108,6 +114,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -139,6 +147,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': @@ -165,9 +175,11 @@ paths: - $ref: '#/components/parameters/errorCode' - $ref: '#/components/parameters/fromDateTime' - $ref: '#/components/parameters/toDateTime' + - $ref: '#/components/parameters/campaignId' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/pageToken' - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/limitTotalCount' responses: '200': $ref: '#/components/responses/listMessagesResponse' @@ -208,12 +220,19 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': $ref: '#/components/responses/messagingTooManyRequestsError' '500': $ref: '#/components/responses/messagingInternalServerError' + callbacks: + inboundCallback: + $ref: '#/components/callbacks/inboundCallback' + statusCallback: + $ref: '#/components/callbacks/statusCallback' servers: *ref_0 /accounts/{accountId}/calls: post: @@ -234,7 +253,7 @@ paths: approximately in order, but exact ordering is not guaranteed. operationId: createCall parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/createCallRequest' responses: @@ -275,7 +294,7 @@ paths: 7 days, you will get an HTTP 404 response. operationId: getCallState parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' responses: '200': @@ -305,13 +324,13 @@ paths: BXML document. operationId: updateCall parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallRequest' responses: '200': - description: Call Successfully Modified + description: Call was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -339,13 +358,13 @@ paths: description: Interrupts and replaces an active call's BXML document. operationId: updateCallBxml parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallBxmlRequest' responses: '204': - description: Call BXML Successfully Replaced + description: Call BXML was successfully replaced. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -381,7 +400,7 @@ paths: of conference records. operationId: listConferences parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/name' - $ref: '#/components/parameters/minCreatedTime' - $ref: '#/components/parameters/maxCreatedTime' @@ -415,7 +434,7 @@ paths: description: Returns information about the specified conference. operationId: getConference parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' responses: '200': @@ -443,13 +462,13 @@ paths: description: Update the conference state. operationId: updateConference parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' requestBody: $ref: '#/components/requestBodies/updateConferenceRequest' responses: '204': - description: Conference successfully modified + description: Conference was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -475,13 +494,13 @@ paths: description: Update the conference BXML document. operationId: updateConferenceBxml parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' requestBody: $ref: '#/components/requestBodies/updateConferenceBxmlRequest' responses: '204': - description: Conference successfully modified + description: Conference successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -507,7 +526,7 @@ paths: description: Returns information about the specified conference member. operationId: getConferenceMember parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/memberId' responses: @@ -536,14 +555,14 @@ paths: description: Updates settings for a particular conference member. operationId: updateConferenceMember parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/memberId' requestBody: $ref: '#/components/requestBodies/updateConferenceMemberRequest' responses: '204': - description: Conference member successfully modified + description: Conference member was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -571,7 +590,7 @@ paths: took place during the specified conference. operationId: listConferenceRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' responses: '200': @@ -601,7 +620,7 @@ paths: description: Returns metadata for the specified recording. operationId: getConferenceRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/recordingId' responses: @@ -632,7 +651,7 @@ paths: description: Downloads the specified recording file. operationId: downloadConferenceRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/conferenceId' - $ref: '#/components/parameters/recordingId' responses: @@ -672,7 +691,7 @@ paths: empty if no recordings match the specified criteria. operationId: listAccountCallRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/to' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/minStartTime' @@ -705,13 +724,13 @@ paths: description: Pause or resume a recording on an active phone call. operationId: updateCallRecordingState parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' requestBody: $ref: '#/components/requestBodies/updateCallRecordingRequest' responses: '200': - description: Recording state successfully modified + description: Recording state was successfully modified. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -739,7 +758,7 @@ paths: that took place during the specified call. operationId: listCallRecordings parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' responses: '200': @@ -769,7 +788,7 @@ paths: description: Returns metadata for the specified recording. operationId: getCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -806,12 +825,12 @@ paths: irreversible, can take an additional 24 to 48 hours. operationId: deleteRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: Recording Deleted + description: Recording was deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -837,7 +856,7 @@ paths: description: Downloads the specified recording. operationId: downloadCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -866,12 +885,12 @@ paths: description: Deletes the specified recording's media. operationId: deleteRecordingMedia parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: The recording media was successfully deleted + description: The recording media was successfully deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -911,7 +930,7 @@ paths: item. operationId: getCallTranscription parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: @@ -946,14 +965,14 @@ paths: less than 4 hours. operationId: transcribeCallRecording parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' requestBody: $ref: '#/components/requestBodies/transcribeRecordingRequest' responses: '204': - description: Transcription successfully requested + description: Transcription was successfully requested. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -984,12 +1003,12 @@ paths: can take an additional 24 to 48 hours. operationId: deleteCallTranscription parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '204': - description: The transcription was successfully deleted + description: The transcription was successfully deleted. '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -1015,7 +1034,7 @@ paths: description: Returns details about the current state of the account. operationId: getStatistics parameters: - - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/accountId' responses: '200': $ref: '#/components/responses/getStatisticsResponse' @@ -1044,7 +1063,7 @@ paths: description: Send an MFA Code via a phone call. operationId: generateVoiceCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeRequest' responses: @@ -1069,7 +1088,7 @@ paths: description: Send an MFA code via text message (SMS). operationId: generateMessagingCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeRequest' responses: @@ -1092,7 +1111,7 @@ paths: description: Verify a previously sent MFA code. operationId: verifyCode parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/codeVerify' responses: @@ -1117,7 +1136,7 @@ paths: tags: - Phone Number Lookup parameters: - - $ref: '#/components/parameters/accountId3' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/createLookupRequest' responses: @@ -1146,7 +1165,7 @@ paths: tags: - Phone Number Lookup parameters: - - $ref: '#/components/parameters/accountId3' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/requestId' responses: '200': @@ -1164,301 +1183,14 @@ paths: '500': $ref: '#/components/responses/tnLookupInternalServerError' servers: *ref_3 - /accounts/{accountId}/participants: - post: - tags: - - Participants - summary: Create Participant - description: >- - Create a new participant under this account. Participants are - idempotent, so relevant parameters must be set in this function if - desired. - operationId: createParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - requestBody: - $ref: '#/components/requestBodies/createParticipantRequest' - responses: - '200': - $ref: '#/components/responses/createParticipantResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: &ref_4 - - url: https://api.webrtc.bandwidth.com/v1 - description: Production - /accounts/{accountId}/participants/{participantId}: - get: - tags: - - Participants - summary: Get Participant - description: Get participant by ID. - operationId: getParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/participantId' - responses: - '200': - $ref: '#/components/responses/getParticipantResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Participants - summary: Delete Participant - description: Delete participant by ID. - operationId: deleteParticipant - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/participantId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions: - post: - tags: - - Sessions - summary: Create Session - description: >- - Create a new session. Sessions are idempotent, so relevant parameters - must be set in this function if desired. - operationId: createSession - parameters: - - $ref: '#/components/parameters/accountId4' - requestBody: - $ref: '#/components/requestBodies/createSessionRequest' - responses: - '200': - $ref: '#/components/responses/sessionResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}: - get: - tags: - - Sessions - summary: Get Session - description: Get session by ID. - operationId: getSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '200': - $ref: '#/components/responses/sessionResponse' - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Sessions - summary: Delete Session - description: Delete session by ID. - operationId: deleteSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants: - get: - tags: - - Sessions - summary: List Participants in Session - description: List participants in a session. - operationId: listSessionParticipants - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - responses: - '200': - $ref: '#/components/responses/listSessionParticipantsResponse' - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}: - put: - tags: - - Sessions - summary: Add Participant to Session - description: | - Add a participant to a session. - - Subscriptions can optionally be provided as part of this call. - operationId: addParticipantToSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - requestBody: - $ref: '#/components/requestBodies/addParticipantToSessionRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '409': - $ref: '#/components/responses/webrtcConflictError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - delete: - tags: - - Sessions - summary: Remove Participant from Session - description: >- - Remove a participant from a session. This will automatically remove any - subscriptions the participant has associated with this session. - operationId: removeParticipantFromSession - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 - /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions: - get: - tags: - - Sessions - summary: Get Participant Subscriptions - description: Get a participant's subscriptions. - operationId: getParticipantSubscriptions - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - responses: - '200': - $ref: '#/components/responses/getParticipantSubscriptionsResponse' - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - put: - tags: - - Sessions - summary: Update Participant Subscriptions - description: >- - Update a participant's subscriptions. This is a full update that will - replace the participant's subscriptions. It allows subscription to the - entire Session, a subset list of Participants in that Session, or - specific media streams on any of the listed Participants. - - First call `getParticipantSubscriptions` if you need the current - subscriptions. - - Calling this API with no `Subscriptions` object to remove all - subscriptions. - operationId: updateParticipantSubscriptions - parameters: - - $ref: '#/components/parameters/accountId4' - - $ref: '#/components/parameters/sessionId' - - $ref: '#/components/parameters/participantId' - requestBody: - $ref: '#/components/requestBodies/updateParticipantSubscriptionsRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/webrtcBadRequestError' - '401': - $ref: '#/components/responses/webrtcUnauthorizedError' - '403': - $ref: '#/components/responses/webrtcForbiddenError' - '404': - $ref: '#/components/responses/webrtcNotFoundError' - '500': - $ref: '#/components/responses/webrtcInternalServerError' - servers: *ref_4 components: schemas: priorityEnum: type: string - description: The priority specified by the user. + description: |- + The priority specified by the user. + + Not supported on MMS. enum: - default - high @@ -1516,7 +1248,9 @@ components: properties: totalCount: type: integer - description: Total number of messages matched by the search. + description: >- + The total number of messages matched by the search. When the request + has limitTotalCount set to true this value is limited to 10,000. example: 100 pageInfo: $ref: '#/components/schemas/pageInfo' @@ -1560,6 +1294,7 @@ components: example: 9902 receiveTime: type: string + format: date-time description: The ISO 8601 datetime of the message. example: 2020-04-07T14:03:07.000Z carrierName: @@ -1593,6 +1328,11 @@ components: description: The campaign class of the message if it has one. nullable: true example: T + campaignId: + type: string + description: The campaign ID of the message if it has one. + nullable: true + example: CJEUMDK pageInfo: title: PageInfo type: object @@ -1685,6 +1425,7 @@ components: example: 93de2206-9669-4e07-948d-329f4b722ee2 time: type: string + format: date-time description: The datetime stamp of the message in ISO 8601 example: 2022-09-14T18:20:16.000Z segmentCount: @@ -1729,6 +1470,11 @@ components: example: custom tag priority: $ref: '#/components/schemas/priorityEnum' + expiration: + type: string + format: date-time + description: The expiration date-time set by the user. + example: '2021-02-01T11:29:18-05:00' messageRequest: title: MessageRequest type: object @@ -1760,35 +1506,383 @@ components: example: '+15551113333' text: type: string - description: The contents of the text message. Must be 2048 characters or less. - maxLength: 2048 + description: The contents of the text message. Must be 2048 characters or less. + maxLength: 2048 + example: Hello world + media: + type: array + items: + type: string + format: uri + maxLength: 4096 + description: >- + A list of URLs to include as media attachments as part of the + message. + + Each URL can be at most 4096 characters. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + tag: + type: string + description: >- + A custom string that will be included in callback events of the + message. Max 1024 characters. + example: custom string + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + type: string + format: date-time + description: >- + A string with the date/time value that the message will + automatically expire by. This must be a valid RFC-3339 value, e.g., + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a + date-time in the future. + + Not supported on MMS. + example: '2021-02-01T11:29:18-05:00' + inboundMessageCallback: + description: Inbound Message Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-received + to: + type: string + example: '+15552223333' + description: + type: string + example: Incoming message received + message: + $ref: '#/components/schemas/inboundMessageCallbackMessage' + required: + - time + - type + - to + - description + - message + inboundMessageCallbackMessage: + description: Inbound Message Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + messageSendingCallback: + type: object + description: Message Sending Callback + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-sending + to: + type: string + example: '+15552223333' + description: + type: string + example: Message is sending to carrier + message: + $ref: '#/components/schemas/messageSendingCallbackMessage' + required: + - time + - type + - to + - description + - message + messageSendingCallbackMessage: + description: Message Sending Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - media + - priority + messageDeliveredCallback: + description: Message Delivered Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-delivered + to: + type: string + example: '+15552223333' + description: + type: string + example: Message delivered to carrier. + message: + $ref: '#/components/schemas/messageDeliveredCallbackMessage' + required: + - time + - type + - to + - description + - message + messageDeliveredCallbackMessage: + description: Message Delivered Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string + example: Hello world + tag: + type: string + example: custom string + media: + type: array + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag + messageFailedCallback: + description: Message Failed Callback + type: object + properties: + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + type: + type: string + example: message-failed + to: + type: string + example: '+15552223333' + description: + type: string + example: rejected-unallocated-from-number + message: + $ref: '#/components/schemas/messageFailedCallbackMessage' + errorCode: + type: integer + example: 9902 + required: + - time + - type + - to + - description + - message + - errorCode + messageFailedCallbackMessage: + description: Message Failed Callback Message Schema + type: object + properties: + id: + type: string + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + example: '+15553332222' + applicationId: + type: string + example: 93de2206-9669-4e07-948d-329f4b722ee2 + time: + type: string + format: date-time + example: 2016-09-14T18:20:16.000Z + segmentCount: + type: integer + example: 1 + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + example: '+15553332222' + text: + type: string example: Hello world + tag: + type: string + example: custom string media: type: array items: type: string format: uri - description: >- - A list of URLs to include as media attachments as part of the - message. example: - https://dev.bandwidth.com/images/bandwidth-logo.png - https://dev.bandwidth.com/images/github_logo.png - tag: - type: string - description: >- - A custom string that will be included in callback events of the - message. Max 1024 characters. - example: custom string priority: $ref: '#/components/schemas/priorityEnum' - expiration: - type: string - description: >- - A string with the date/time value that the message will - automatically expire by. This must be a valid RFC-3339 value, e.g., - 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. - example: '2021-02-01T11:29:18-05:00' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + - text + - tag + - priority callbackMethodEnum: type: string nullable: true @@ -1811,7 +1905,7 @@ components: The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is - `completed` + `completed`. example: POST recordingStateEnum: type: string @@ -1824,18 +1918,21 @@ components: `paused` to pause an active recording `recording` to resume a paused recording + example: paused callDirectionEnum: type: string enum: - inbound - outbound description: The direction of the call. + example: inbound fileFormatEnum: type: string enum: - mp3 - wav - description: The format that the recording is stored in + description: The format that the recording is stored in. + example: wav callStateEnum: nullable: true type: string @@ -1853,6 +1950,7 @@ components: unanswered inbound call + example: completed conferenceStateEnum: nullable: true type: string @@ -1862,7 +1960,8 @@ components: - completed description: >- Setting the conference state to `completed` ends the conference and - ejects all members + ejects all members. + example: completed machineDetectionModeEnum: type: string default: async @@ -1878,6 +1977,7 @@ components: complete and will include its result. + example: async createCall: type: object required: @@ -1888,9 +1988,11 @@ components: properties: to: type: string - description: |- + description: >- The destination to call (must be an E.164 formatted number - (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). + + (e.g. `+15555551212`) or a SIP URI (e.g. + `sip:user@server.example`)). example: '+19195551234' from: type: string @@ -1902,11 +2004,21 @@ components: strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). example: '+19195554321' + displayName: + nullable: true + type: string + description: >- + The caller display name to use when the call is created. + + May not exceed 256 characters nor contain control characters such as + new lines. + maxLength: 256 + example: John Doe uui: nullable: true type: string example: >- - eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64 + eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 description: >- A comma-separated list of 'User-To-User' headers to be sent @@ -1940,9 +2052,9 @@ components: call. - Must use `https` if specifying `username` and `password` + Must use `https` if specifying `username` and `password`. maxLength: 2048 - example: https://www.myCallbackServer.com/webhooks/answer + example: https://www.myCallbackServer.example/webhooks/answer answerMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -1968,9 +2080,9 @@ components: Must use `https` if specifying `fallbackUsername` and - `fallbackPassword` + `fallbackPassword`. maxLength: 2048 - example: https://www.myFallbackServer.com/webhooks/answer + example: https://www.myFallbackServer.example/webhooks/answer answerFallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' fallbackUsername: @@ -1994,6 +2106,7 @@ components: href='/docs/voice/webhooks/disconnect'>Disconnect event to when the call ends. This event does not expect a BXML response. maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/disconnect disconnectMethod: $ref: '#/components/schemas/callbackMethodEnum' callTimeout: @@ -2013,6 +2126,7 @@ components: minimum: 1 maximum: 300 default: 30 + example: 30 callbackTimeout: nullable: true type: number @@ -2027,6 +2141,7 @@ components: minimum: 1 maximum: 25 default: 15 + example: 15 machineDetection: $ref: '#/components/schemas/machineDetectionConfiguration' priority: @@ -2052,6 +2167,7 @@ components: takes precedence over a priority 2 call. + example: 5 tag: nullable: true type: string @@ -2068,7 +2184,8 @@ components: Max length 256 characters. - maximum: 256 + maxLength: 256 + example: arbitrary text here createCallResponse: type: object required: @@ -2089,31 +2206,31 @@ components: accountId: type: string example: '9900000' - description: The bandwidth account ID associated with the call + description: The bandwidth account ID associated with the call. callId: type: string example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: Programmable Voice API Call ID + description: Programmable Voice API Call ID. to: type: string example: '+19195551234' - description: Recipient of the outgoing call + description: Recipient of the outgoing call. from: type: string example: '+19195554321' - description: Phone number that created the outbound call + description: Phone number that created the outbound call. enqueuedTime: nullable: true type: string format: date-time - description: Time the call was accepted into the queue + description: The time at which the call was accepted into the queue. example: '2022-06-16T13:15:07.160Z' callUrl: type: string format: uri example: >- https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: The URL to update call state + description: The URL to update this call's state. callTimeout: type: number format: double @@ -2132,13 +2249,13 @@ components: nullable: true type: string example: My custom tag value - description: Custom tag value + description: Custom tag value. answerMethod: $ref: '#/components/schemas/callbackMethodEnum' answerUrl: type: string format: uri - example: https://myServer.com/bandwidth/webhooks/answer + example: https://myServer.example/bandwidth/webhooks/answer description: URL to deliver the `answer` event webhook. answerFallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' @@ -2146,7 +2263,7 @@ components: nullable: true type: string format: uri - example: https://myFallbackServer.com/bandwidth/webhooks/answer + example: https://myFallbackServer.example/bandwidth/webhooks/answer description: Fallback URL to deliver the `answer` event webhook. disconnectMethod: $ref: '#/components/schemas/callbackMethodEnum' @@ -2154,7 +2271,7 @@ components: nullable: true type: string format: uri - example: https://myServer.com/bandwidth/webhooks/disconnect + example: https://myServer.example/bandwidth/webhooks/disconnect description: URL to deliver the `disconnect` event webhook. username: type: string @@ -2182,8 +2299,7 @@ components: example: mySecretPassword1! priority: nullable: true - type: number - format: integer + type: integer example: 5 description: The priority of this call over other calls from your account. callState: @@ -2212,7 +2328,7 @@ components: type: string description: >- The phone number that received the call, in E.164 format (e.g. - +15555555555), or if the call was to a SIP URI, the SIP URI + +15555555555), or if the call was to a SIP URI, the SIP URI. example: '+19195551234' from: type: string @@ -2267,7 +2383,7 @@ components: More information: [Understanding - STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) + STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). additionalProperties: type: string example: @@ -2393,7 +2509,7 @@ components: nullable: true type: string format: uri - example: https://myServer.com/bandwidth/webhooks/redirect + example: https://myServer.example/bandwidth/webhooks/redirect redirectMethod: $ref: '#/components/schemas/redirectMethodEnum' username: @@ -2414,8 +2530,8 @@ components: format: uri description: |- A fallback url which, if provided, will be used to retry the - redirect callback delivery in case `redirectUrl` fails to respond - example: https://myFallbackServer.com/bandwidth/webhooks/redirect + redirect callback delivery in case `redirectUrl` fails to respond. + example: https://myFallbackServer.example/bandwidth/webhooks/redirect redirectFallbackMethod: $ref: '#/components/schemas/redirectMethodEnum' fallbackUsername: @@ -2449,7 +2565,7 @@ components: Not allowed if `state` is `completed`. - maximum: 256 + maxLength: 256 example: My Custom Tag updateCallRecording: type: object @@ -2515,11 +2631,11 @@ components: properties: id: type: string - description: The Bandwidth-generated conference ID + description: The Bandwidth-generated conference ID. example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 name: type: string - description: The name of the conference, as specified by your application + description: The name of the conference, as specified by your application. example: my-conference-name createdTime: type: string @@ -2537,7 +2653,7 @@ components: type: string format: uri description: The URL to send the conference-related events. - example: https://myServer.com/bandwidth/webhooks/conferenceEvent + example: https://myServer.example/bandwidth/webhooks/conferenceEvent conferenceEventMethod: $ref: '#/components/schemas/callbackMethodEnum' tag: @@ -2556,7 +2672,7 @@ components: A list of active members of the conference. Omitted if this is a response to the [Get Conferences - endpoint](/apis/voice#tag/Conferences/operation/listConferences) + endpoint](/apis/voice#tag/Conferences/operation/listConferences). updateConference: type: object properties: @@ -2573,8 +2689,8 @@ components: event which will provide new BXML. Not allowed if `state` is `completed`, - but required if `state` is `active` - example: https://myServer.com/bandwidth/webhooks/conferenceRedirect + but required if `state` is `active`. + example: https://myServer.example/bandwidth/webhooks/conferenceRedirect redirectMethod: $ref: '#/components/schemas/redirectMethodEnum' username: @@ -2600,7 +2716,8 @@ components: respond. Not allowed if `state` is `completed`. - example: https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect + example: >- + https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect redirectFallbackMethod: $ref: '#/components/schemas/redirectMethodEnum' fallbackUsername: @@ -2843,7 +2960,7 @@ components: type: string format: uri maxLength: 2048 - example: https://myServer.com/bandwidth/webhooks/machineDetectionComplete + example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete callbackMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -2871,7 +2988,7 @@ components: to respond maxLength: 2048 example: >- - https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete + https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete fallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' fallbackUsername: @@ -2903,7 +3020,7 @@ components: and password fields for authorization. - example: https://myServer.com/bandwidth/webhooks/transcriptionAvailable + example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable callbackMethod: $ref: '#/components/schemas/callbackMethodEnum' username: @@ -2935,6 +3052,16 @@ components: between 1 and 25. example: 5.5 + detectLanguage: + type: boolean + nullable: true + description: >- + A boolean value to indicate that the recording may not be in + English, and the transcription service will need to detect the + dominant language the recording is in and transcribe accordingly. + Current supported languages are English, French, and Spanish. + default: false + example: true transcriptionList: type: object properties: @@ -3233,7 +3360,7 @@ components: $ref: '#/components/schemas/tag1' status: $ref: '#/components/schemas/status' - disconenctCallback: + disconnectCallback: type: object description: The Disconnect event is fired when a call ends, for any reason. properties: @@ -3758,10 +3885,12 @@ components: example: bridgeComplete eventTime: type: string + format: date-time description: >- The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. + example: '2022-06-17T22:19:40.375Z' accountId: type: string description: The user account associated with the call. @@ -3923,7 +4052,7 @@ components: example: 4642074b-7b58-478b-96e4-3a60955c6765 nullable: true machineDetectionResult: - type: string + type: object description: >- (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async @@ -4254,193 +4383,6 @@ components: type: string description: A description of what validation error occurred. example: example error message - publishPermissionsEnum: - type: string - enum: - - AUDIO - - VIDEO - deviceApiVersionEnum: - type: string - description: Optional field to define the device api version of this participant. - example: V3 - default: V3 - enum: - - V3 - session: - type: object - description: Session object. - properties: - id: - type: string - description: Unique id of the session. - example: 75c21163-e110-41bc-bd76-1bb428ec85d5 - tag: - type: string - description: User defined tag to associate with the session. - example: session1 - participant: - type: object - description: Participant object. - properties: - id: - type: string - description: Unique id of the participant. - readOnly: true - example: 320e2af6-13ec-498d-8b51-daba52c37853 - callbackUrl: - type: string - nullable: true - description: Full callback url to use for notifications about this participant. - example: https://example.com/callback - publishPermissions: - type: array - description: Defines if this participant can publish audio or video. - example: - - VIDEO - - AUDIO - uniqueItems: true - items: - $ref: '#/components/schemas/publishPermissionsEnum' - sessions: - type: array - description: |- - List of session ids this participant is associated with - - Capped to one - - Upon creation of a Participant, returns as an empty array. - example: - - 75c21163-e110-41bc-bd76-1bb428ec85d5 - readOnly: true - items: - type: string - subscriptions: - $ref: '#/components/schemas/subscriptions' - tag: - type: string - description: User defined tag to associate with the participant. - example: participant1 - deviceApiVersion: - $ref: '#/components/schemas/deviceApiVersionEnum' - createParticipantResponse: - type: object - description: Response generated when a Participant is created. - properties: - participant: - $ref: '#/components/schemas/participant' - token: - type: string - example: >- - eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc - description: >- - Auth token for the returned participant. This should be passed to - the participant so that they can connect to the platform. - createParticipantRequest: - type: object - description: Create a participant request. - properties: - callbackUrl: - type: string - nullable: true - description: Full callback url to use for notifications about this participant. - example: https://example.com/callback - publishPermissions: - type: array - description: Defines if this participant can publish audio or video. - example: - - VIDEO - - AUDIO - uniqueItems: true - items: - $ref: '#/components/schemas/publishPermissionsEnum' - tag: - type: string - description: User defined tag to associate with the participant. - example: participant1 - deviceApiVersion: - $ref: '#/components/schemas/deviceApiVersionEnum' - subscriptions: - type: object - readOnly: true - properties: - sessionId: - type: string - description: >- - If present, and not overridden by the array of participants, it - represents the session the subscriptions are associated with. If - this is the only field, the subscriber will be subscribed to all - participants in the session (including any participants that are - later added to the session). Upon creation of a Participant, returns - as an empty object. - example: d8886aad-b956-4e1b-b2f4-d7c9f8162772 - participants: - type: array - description: >- - (optional) A list of participants in the session that will be - subscribed to. If present and not empty or null, this will - override any sessionId specified in the body. Returns empty if used - during the creation of a Participant. - example: - - participantId: 568749d5-04d5-483d-adf5-deac7dd3d521 - - participantId: 0275e47f-dd21-4cf0-a1e1-dfdc719e73a7 - streamAliases: - - alias_1 - - alias_2 - items: - $ref: '#/components/schemas/participantSubscription' - participantSubscription: - type: object - required: - - participantId - properties: - participantId: - type: string - description: The Participant the subscriber will be subscribed to - example: 568749d5-04d5-483d-adf5-deac7dd3d521 - streamAliases: - type: array - description: >- - (optional) An array of specific streamAliases owned by the - Participant that the subscriber will be subscribed to. Background: A - streamAlias is created by a WebRTC client when it connects and - declares a name for the related stream. The client is responsible - for informing the application of any created streamAliases to enable - the application to subscribe to specific streamAliases. Subscribing - to a `streamAlias` that does not exist is undefined. If the array is - empty all aliases are assumed. - example: - - alias_1 - - alias_2 - uniqueItems: true - items: - type: string - requestError: - type: object - properties: - error: - type: string - description: A message describing the error with your request. - example: Internal error - requestId: - type: string - description: The associated requestId from AWS. - example: 12af78d1-5f88-4917-925d-17c1ac8fda7a - unauthorizedRequest: - type: object - properties: - message: - type: string - description: Unauthorized - example: Unauthorized - forbiddenRequest: - type: object - properties: - message: - type: string - description: >- - The message containing the reason behind the request being - forbidden. - example: Missing Authentication Token responses: createMessageResponse: description: Accepted @@ -4481,6 +4423,12 @@ components: application/json: schema: $ref: '#/components/schemas/messagingRequestError' + messagingNotAcceptableError: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' createMessageBadRequestError: description: Bad Request content: @@ -4684,7 +4632,7 @@ components: description: Too Many Requests headers: Retry-After: - description: When you should try your request again + description: When you should try your request again. schema: type: string content: @@ -4857,80 +4805,6 @@ components: summary: Example Internal Server Error Error value: message: Request has not been passed further. - createParticipantResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/createParticipantResponse' - getParticipantResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/participant' - sessionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/session' - listSessionParticipantsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/participant' - getParticipantSubscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' - webrtcBadRequestError: - description: Bad Request - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcUnauthorizedError: - description: Unauthorized - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/unauthorizedRequest' - webrtcForbiddenError: - description: Forbidden - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/forbiddenRequest' - webrtcNotFoundError: - description: Not Found - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcConflictError: - description: Conflict - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' - webrtcInternalServerError: - description: Internal Server Error - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/requestError' parameters: accountId: in: path @@ -5075,6 +4949,14 @@ components: example: 2022-09-14T18:20:16.000Z schema: type: string + campaignId: + in: query + name: campaignId + required: false + description: The campaign ID of the message. + example: CJEUMDK + schema: + type: string sort: in: query name: sort @@ -5103,21 +4985,26 @@ components: schema: type: integer example: 50 - accountId1: - name: accountId - in: path - required: true + limitTotalCount: + in: query + name: limitTotalCount + required: false + description: >- + When set to true, the response's totalCount field will have a maximum + value of 10,000. When set to false, or excluded, this will give an + accurate totalCount of all messages that match the provided filters. If + you are experiencing latency, try using this parameter to limit your + results. + example: true schema: - type: string - description: Your Bandwidth Account ID - example: '9900000' + type: boolean callId: name: callId in: path required: true schema: type: string - description: Programmable Voice API Call ID + description: Programmable Voice API Call ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 recordingId: name: recordingId @@ -5125,7 +5012,7 @@ components: required: true schema: type: string - description: Programmable Voice API Recording ID + description: Programmable Voice API Recording ID. example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 conferenceId: name: conferenceId @@ -5133,7 +5020,7 @@ components: required: true schema: type: string - description: Programmable Voice API Conference ID + description: Programmable Voice API Conference ID. example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 memberId: name: memberId @@ -5141,7 +5028,7 @@ components: required: true schema: type: string - description: Programmable Voice API Conference Member ID + description: Programmable Voice API Conference Member ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 to: name: to @@ -5229,23 +5116,6 @@ components: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. - accountId2: - name: accountId - description: Bandwidth Account ID with Voice service enabled. - in: path - required: true - style: simple - explode: false - schema: - type: string - accountId3: - name: accountId - in: path - required: true - schema: - type: string - description: The ID of the Bandwidth account that the user belongs to. - example: '9900000' requestId: name: requestId in: path @@ -5254,30 +5124,6 @@ components: type: string description: The phone number lookup request ID from Bandwidth. example: 004223a0-8b17-41b1-bf81-20732adf5590 - accountId4: - name: accountId - in: path - description: Account ID - required: true - schema: - type: string - example: '9900000' - sessionId: - name: sessionId - in: path - description: Session ID - required: true - schema: - type: string - example: cb5054ee-a69b-41ac-9ab2-04d6370826b4 - participantId: - name: participantId - in: path - description: Participant ID - required: true - schema: - type: string - example: 62e0ecb9-0b1b-5115-aae4-4f36123d6bb1 requestBodies: createMessageRequest: content: @@ -5500,7 +5346,7 @@ components: value: |- - + updateCallRecordingRequest: required: true @@ -5567,55 +5413,6 @@ components: $ref: '#/components/examples/singleNumberRequestExample' multipleNumberRequestExample: $ref: '#/components/examples/multipleNumberRequestExample' - createParticipantRequest: - description: Create participant request body. - content: - application/json: - schema: - $ref: '#/components/schemas/createParticipantRequest' - createSessionRequest: - description: Create session request body. - content: - application/json: - schema: - $ref: '#/components/schemas/session' - addParticipantToSessionRequest: - description: >- - The Body describes an optional set of subscriptions to apply to the - participant. - - - Calling this endpoint with no/empty body will only add the participant - to the session, and will not subscribe the Participant to any media. - - - The request body for this endpoint is OPTIONAL and provided as a - convenience to avoid additional calls to the Update Participant - Subscriptions endpoint. --- If a body is provided it will result in - direct control over what Participants are subscribed to. - - - if the participants Array is provided and not empty, that list of Participants will be subscribed To - - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' - updateParticipantSubscriptionsRequest: - description: >- - The body describes the desired subscriptions for the Participant. --- If - a body is provided it will result in direct control over what - Participants are subscribed to. - - - if the participants Array is provided and not empty, that list of Participants will be subscribed To - - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/subscriptions' securitySchemes: Basic: type: http @@ -5626,6 +5423,37 @@ components: header that contains the word Basic followed by a space and a base64-encoded string `username:password`Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` + callbacks: + inboundCallback: + '{inboundCallbackUrl}': + post: + requestBody: + required: true + description: Inbound Message Callback Payload + content: + application/json: + schema: + $ref: '#/components/schemas/inboundMessageCallback' + responses: + '200': + description: OK + statusCallback: + '{statusCallbackUrl}': + post: + requestBody: + required: true + description: Status Callback Payload + content: + application/json: + schema: + type: object + oneOf: + - $ref: '#/components/schemas/messageSendingCallback' + - $ref: '#/components/schemas/messageDeliveredCallback' + - $ref: '#/components/schemas/messageFailedCallback' + responses: + '200': + description: OK examples: createCallResponseExample: summary: Example of a createCall Response @@ -5642,10 +5470,10 @@ components: callbackTimeout: 15 tag: My custom tag value answerMethod: POST - answerUrl: https://myServer.com/bandwidth/webhooks/answer + answerUrl: https://myServer.example/bandwidth/webhooks/answer answerFallbackMethod: POST disconnectMethod: POST - disconnectUrl: https://myServer.com/bandwidth/webhooks/disconnect + disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect username: mySecretUsername password: '*****' fallbackUsername: mySecretUsername @@ -5658,54 +5486,54 @@ components: name: my-conference-name createdTime: '2022-06-17T22:19:40.375Z' completedTime: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: https://myServer.com/bandwidth/webhooks/conferenceEvent + conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent conferenceEventMethod: POST tag: my custom tag voiceBadRequestErrorExample: summary: Example of a Bad Request (400) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceUnauthorizedErrorExample: summary: Example of an Unauthorized (401) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceForbiddenErrorExample: summary: Example of a Forbidden (403) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceNotFoundErrorExample: summary: Example of a Not Found (404) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceNotAllowedErrorExample: summary: Example of a Not Allowed (405) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceConflictErrorExample: summary: Example of a Conflict (409) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceUnsupportedMediaTypeErrorExample: summary: Example of an Unsupported Media Type (415) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceTooManyRequestsErrorExample: summary: Example of a Too Many Requests (429) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' voiceInternalServerErrorExample: summary: Example of an Internal Server (500) Error value: type: validation - description: 'Invalid answerUrl: only http and https are allowed' + description: 'Invalid answerUrl: only http and https are allowed.' singleNumberRequestExample: summary: Example Number Lookup Request for One Number value: From 042f0ee0636cd51741b77ec1a001f1823472f24b Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:56:47 -0400 Subject: [PATCH 02/29] Regenerate with OpenAPI Generator 7.0.0 Fixed TN lookup Tests in this commit --- .github/workflows/python.yml | 37 + .gitlab-ci.yml | 23 +- .openapi-generator-ignore | 2 +- .openapi-generator/FILES | 187 +- .openapi-generator/VERSION | 2 +- .travis.yml | 6 +- README.md | 101 +- bandwidth/__init__.py | 119 +- bandwidth/api/__init__.py | 15 +- bandwidth/api/calls_api.py | 1271 +++---- bandwidth/api/conferences_api.py | 2902 ++++++++------- bandwidth/api/media_api.py | 1312 +++---- bandwidth/api/messages_api.py | 829 +++-- bandwidth/api/mfa_api.py | 945 ++--- bandwidth/api/phone_number_lookup_api.py | 635 ++-- bandwidth/api/recordings_api.py | 3185 +++++++++-------- bandwidth/api/statistics_api.py | 319 +- bandwidth/api_client.py | 895 ++--- bandwidth/api_response.py | 25 + bandwidth/apis/__init__.py | 24 - bandwidth/configuration.py | 120 +- bandwidth/exceptions.py | 16 +- bandwidth/model/__init__.py | 5 - bandwidth/model/account_statistics.py | 268 -- bandwidth/model/answer_callback.py | 322 -- bandwidth/model/bridge_complete_callback.py | 330 -- .../model/bridge_target_complete_callback.py | 318 -- bandwidth/model/bxml/__init__.py | 3 - bandwidth/model/call_callback.py | 388 -- bandwidth/model/call_direction_enum.py | 291 -- bandwidth/model/call_recording_metadata.py | 342 -- bandwidth/model/call_state.py | 338 -- bandwidth/model/call_state_enum.py | 284 -- bandwidth/model/callback_method_enum.py | 284 -- bandwidth/model/code_request.py | 322 -- bandwidth/model/conference.py | 300 -- bandwidth/model/conference_callback.py | 328 -- .../model/conference_completed_callback.py | 280 -- .../model/conference_created_callback.py | 280 -- bandwidth/model/conference_member.py | 284 -- .../model/conference_member_exit_callback.py | 292 -- .../model/conference_member_join_callback.py | 292 -- ...conference_recording_available_callback.py | 322 -- .../model/conference_recording_metadata.py | 310 -- .../model/conference_redirect_callback.py | 280 -- bandwidth/model/conference_state_enum.py | 284 -- bandwidth/model/create_call.py | 391 -- bandwidth/model/create_call_response.py | 384 -- bandwidth/model/create_lookup_response.py | 274 -- .../model/create_message_request_error.py | 286 -- bandwidth/model/deferred_result.py | 268 -- bandwidth/model/disconenct_callback.py | 334 -- bandwidth/model/diversion.py | 288 -- bandwidth/model/dtmf_callback.py | 334 -- bandwidth/model/field_error.py | 268 -- bandwidth/model/file_format_enum.py | 291 -- bandwidth/model/gather_callback.py | 338 -- bandwidth/model/initiate_callback.py | 318 -- .../model/list_message_direction_enum.py | 291 -- bandwidth/model/list_message_item.py | 334 -- bandwidth/model/lookup_request.py | 270 -- bandwidth/model/lookup_result.py | 296 -- bandwidth/model/lookup_status.py | 284 -- bandwidth/model/lookup_status_enum.py | 293 -- bandwidth/model/lookup_status_result_inner.py | 296 -- .../machine_detection_complete_callback.py | 322 -- .../model/machine_detection_configuration.py | 346 -- .../model/machine_detection_mode_enum.py | 283 -- bandwidth/model/media.py | 272 -- bandwidth/model/message.py | 320 -- bandwidth/model/message_direction_enum.py | 291 -- bandwidth/model/message_request.py | 313 -- bandwidth/model/message_status_enum.py | 297 -- bandwidth/model/message_type_enum.py | 291 -- bandwidth/model/messages_list.py | 280 -- bandwidth/model/messaging_code_response.py | 264 -- bandwidth/model/messaging_request_error.py | 276 -- .../model/mfa_forbidden_request_error.py | 264 -- bandwidth/model/mfa_request_error.py | 268 -- .../model/mfa_unauthorized_request_error.py | 264 -- bandwidth/model/page_info.py | 276 -- bandwidth/model/priority_enum.py | 291 -- .../model/recording_available_callback.py | 356 -- .../model/recording_complete_callback.py | 356 -- bandwidth/model/recording_state_enum.py | 291 -- bandwidth/model/redirect_callback.py | 330 -- bandwidth/model/redirect_method_enum.py | 284 -- bandwidth/model/stir_shaken.py | 272 -- bandwidth/model/tag.py | 268 -- bandwidth/model/tn_lookup_request_error.py | 264 -- bandwidth/model/transcribe_recording.py | 300 -- bandwidth/model/transcription.py | 268 -- .../model/transcription_available_callback.py | 354 -- bandwidth/model/transcription_list.py | 270 -- bandwidth/model/transcription_metadata.py | 276 -- bandwidth/model/transfer_answer_callback.py | 326 -- bandwidth/model/transfer_complete_callback.py | 338 -- .../model/transfer_disconnect_callback.py | 346 -- bandwidth/model/update_call.py | 322 -- bandwidth/model/update_call_recording.py | 276 -- bandwidth/model/update_conference.py | 316 -- bandwidth/model/update_conference_member.py | 272 -- bandwidth/model/verify_code_request.py | 299 -- bandwidth/model/verify_code_response.py | 264 -- bandwidth/model/voice_api_error.py | 272 -- bandwidth/model/voice_code_response.py | 264 -- bandwidth/model_utils.py | 2059 ----------- bandwidth/models/__init__.py | 189 +- bandwidth/models/account_statistics.py | 86 + bandwidth/models/answer_callback.py | 135 + bandwidth/models/bridge_complete_callback.py | 140 + .../models/bridge_target_complete_callback.py | 124 + bandwidth/models/bxml/__init__.py | 6 + bandwidth/{model => models}/bxml/bxml.py | 0 bandwidth/{model => models}/bxml/response.py | 0 bandwidth/{model => models}/bxml/root.py | 2 +- .../{model => models}/bxml/terminal_verb.py | 0 bandwidth/{model => models}/bxml/verb.py | 0 .../{model => models}/bxml/verbs/__init__.py | 1 + .../{model => models}/bxml/verbs/bridge.py | 0 .../bxml/verbs/conference.py | 0 .../{model => models}/bxml/verbs/forward.py | 0 .../{model => models}/bxml/verbs/gather.py | 0 .../{model => models}/bxml/verbs/hangup.py | 0 .../{model => models}/bxml/verbs/pause.py | 0 .../bxml/verbs/pause_recording.py | 0 .../bxml/verbs/phone_number.py | 0 .../bxml/verbs/play_audio.py | 0 .../{model => models}/bxml/verbs/record.py | 0 .../{model => models}/bxml/verbs/redirect.py | 0 .../bxml/verbs/resume_recording.py | 0 .../{model => models}/bxml/verbs/ring.py | 0 .../{model => models}/bxml/verbs/send_dtmf.py | 0 .../{model => models}/bxml/verbs/sip_uri.py | 0 .../bxml/verbs/speak_sentence.py | 0 .../bxml/verbs/start_gather.py | 0 .../bxml/verbs/start_recording.py | 0 .../bxml/verbs/start_stream.py | 0 .../bxml/verbs/stop_gather.py | 0 .../bxml/verbs/stop_recording.py | 0 .../bxml/verbs/stop_stream.py | 0 .../bxml/verbs/stream_param.py | 0 bandwidth/{model => models}/bxml/verbs/tag.py | 0 .../{model => models}/bxml/verbs/transfer.py | 0 bandwidth/models/call_direction_enum.py | 41 + bandwidth/models/call_recording_metadata.py | 134 + bandwidth/models/call_state.py | 169 + bandwidth/models/call_state_enum.py | 41 + bandwidth/models/callback_method_enum.py | 41 + bandwidth/models/code_request.py | 108 + bandwidth/models/conference.py | 132 + .../models/conference_completed_callback.py | 97 + .../models/conference_created_callback.py | 97 + bandwidth/models/conference_member.py | 99 + .../models/conference_member_exit_callback.py | 103 + .../models/conference_member_join_callback.py | 103 + ...conference_recording_available_callback.py | 121 + .../models/conference_recording_metadata.py | 110 + .../models/conference_redirect_callback.py | 97 + bandwidth/models/conference_state_enum.py | 41 + bandwidth/models/create_call.py | 202 ++ bandwidth/models/create_call_response.py | 185 + bandwidth/models/create_lookup_response.py | 87 + .../models/create_message_request_error.py | 96 + bandwidth/models/deferred_result.py | 86 + bandwidth/models/disconnect_callback.py | 142 + bandwidth/models/diversion.py | 96 + bandwidth/models/dtmf_callback.py | 132 + bandwidth/models/field_error.py | 86 + bandwidth/models/file_format_enum.py | 41 + bandwidth/models/gather_callback.py | 134 + bandwidth/models/inbound_message_callback.py | 96 + .../inbound_message_callback_message.py | 108 + bandwidth/models/initiate_callback.py | 115 + .../models/list_message_direction_enum.py | 41 + bandwidth/models/list_message_item.py | 149 + bandwidth/models/lookup_request.py | 84 + bandwidth/models/lookup_result.py | 100 + bandwidth/models/lookup_status.py | 99 + bandwidth/models/lookup_status_enum.py | 43 + .../machine_detection_complete_callback.py | 135 + .../models/machine_detection_configuration.py | 184 + .../models/machine_detection_mode_enum.py | 41 + bandwidth/models/machine_detection_result.py | 86 + bandwidth/models/media.py | 88 + bandwidth/models/message.py | 110 + .../models/message_delivered_callback.py | 96 + .../message_delivered_callback_message.py | 108 + bandwidth/models/message_direction_enum.py | 41 + bandwidth/models/message_failed_callback.py | 98 + .../models/message_failed_callback_message.py | 108 + bandwidth/models/message_request.py | 99 + bandwidth/models/message_sending_callback.py | 96 + .../message_sending_callback_message.py | 108 + bandwidth/models/message_status_enum.py | 47 + bandwidth/models/message_type_enum.py | 41 + bandwidth/models/messages_list.py | 100 + bandwidth/models/messaging_code_response.py | 84 + bandwidth/models/messaging_request_error.py | 86 + .../models/mfa_forbidden_request_error.py | 84 + bandwidth/models/mfa_request_error.py | 86 + .../models/mfa_unauthorized_request_error.py | 84 + bandwidth/models/page_info.py | 90 + bandwidth/models/priority_enum.py | 41 + .../models/recording_available_callback.py | 143 + .../models/recording_complete_callback.py | 148 + bandwidth/models/recording_state_enum.py | 41 + bandwidth/models/redirect_callback.py | 130 + bandwidth/models/redirect_method_enum.py | 41 + bandwidth/models/stir_shaken.py | 88 + bandwidth/models/tag.py | 86 + bandwidth/models/tn_lookup_request_error.py | 84 + bandwidth/models/transcribe_recording.py | 127 + bandwidth/models/transcription.py | 86 + .../transcription_available_callback.py | 145 + bandwidth/models/transcription_list.py | 92 + bandwidth/models/transcription_metadata.py | 90 + bandwidth/models/transfer_answer_callback.py | 128 + .../models/transfer_complete_callback.py | 144 + .../models/transfer_disconnect_callback.py | 148 + bandwidth/models/update_call.py | 154 + bandwidth/models/update_call_recording.py | 85 + bandwidth/models/update_conference.py | 147 + bandwidth/models/update_conference_member.py | 93 + bandwidth/models/verify_code_request.py | 97 + bandwidth/models/verify_code_response.py | 84 + bandwidth/models/voice_api_error.py | 93 + bandwidth/models/voice_code_response.py | 84 + bandwidth/py.typed | 0 bandwidth/rest.py | 119 +- docs/AccountStatistics.md | 18 +- docs/AnswerCallback.md | 30 +- docs/BridgeCompleteCallback.md | 32 +- docs/BridgeTargetCompleteCallback.md | 28 +- docs/CallCallback.md | 42 - docs/CallDirectionEnum.md | 1 - docs/CallRecordingMetadata.md | 22 +- docs/CallState.md | 42 +- docs/CallStateEnum.md | 1 - docs/CallbackMethodEnum.md | 1 - docs/CallsApi.md | 187 +- docs/CodeRequest.md | 22 +- docs/Conference.md | 30 +- docs/ConferenceCallback.md | 29 - docs/ConferenceCompletedCallback.md | 22 +- docs/ConferenceCreatedCallback.md | 22 +- docs/ConferenceMember.md | 20 +- docs/ConferenceMemberExitCallback.md | 24 +- docs/ConferenceMemberJoinCallback.md | 24 +- docs/ConferenceRecordingAvailableCallback.md | 24 +- docs/ConferenceRecordingMetadata.md | 20 +- docs/ConferenceRedirectCallback.md | 22 +- docs/ConferenceStateEnum.md | 3 +- docs/ConferencesApi.md | 363 +- docs/CreateCall.md | 47 +- docs/CreateCallResponse.md | 52 +- docs/CreateLookupResponse.md | 18 +- docs/CreateMessageRequestError.md | 20 +- docs/DeferredResult.md | 20 +- ...nenctCallback.md => DisconnectCallback.md} | 34 +- docs/Diversion.md | 18 +- docs/DtmfCallback.md | 28 +- docs/FieldError.md | 18 +- docs/FileFormatEnum.md | 3 +- docs/GatherCallback.md | 28 +- docs/InboundMessageCallback.md | 33 + docs/InboundMessageCallbackMessage.md | 40 + docs/InitiateCallback.md | 22 +- docs/ListMessageDirectionEnum.md | 1 - docs/ListMessageItem.md | 31 +- docs/LookupRequest.md | 20 +- docs/LookupResult.md | 18 +- docs/LookupStatus.md | 22 +- docs/LookupStatusEnum.md | 1 - docs/LookupStatusResultInner.md | 20 - docs/MFAApi.md | 124 +- docs/MachineDetectionCompleteCallback.md | 30 +- docs/MachineDetectionConfiguration.md | 42 +- docs/MachineDetectionModeEnum.md | 1 - docs/MachineDetectionResult.md | 30 + docs/Media.md | 18 +- docs/MediaApi.md | 153 +- docs/Message.md | 27 +- docs/MessageDeliveredCallback.md | 33 + docs/MessageDeliveredCallbackMessage.md | 40 + docs/MessageDirectionEnum.md | 1 - docs/MessageFailedCallback.md | 34 + docs/MessageFailedCallbackMessage.md | 40 + docs/MessageRequest.md | 26 +- docs/MessageSendingCallback.md | 33 + docs/MessageSendingCallbackMessage.md | 40 + docs/MessageStatusEnum.md | 1 - docs/MessageTypeEnum.md | 1 - docs/MessagesApi.md | 140 +- docs/MessagesList.md | 22 +- docs/MessagingCodeResponse.md | 18 +- docs/MessagingRequestError.md | 18 +- docs/MfaForbiddenRequestError.md | 18 +- docs/MfaRequestError.md | 18 +- docs/MfaUnauthorizedRequestError.md | 18 +- docs/PageInfo.md | 18 +- docs/PhoneNumberLookupApi.md | 66 +- docs/PriorityEnum.md | 3 +- docs/PublishPermissionsEnum.md | 11 - docs/RecordingAvailableCallback.md | 28 +- docs/RecordingCompleteCallback.md | 30 +- docs/RecordingStateEnum.md | 1 - docs/RecordingsApi.md | 391 +- docs/RedirectCallback.md | 28 +- docs/RedirectMethodEnum.md | 3 +- docs/RequestError.md | 13 - docs/StatisticsApi.md | 27 +- docs/StirShaken.md | 18 +- docs/Tag.md | 18 +- docs/TnLookupRequestError.md | 18 +- docs/TranscribeRecording.md | 27 +- docs/Transcription.md | 18 +- docs/TranscriptionAvailableCallback.md | 28 +- docs/TranscriptionList.md | 20 +- docs/TranscriptionMetadata.md | 18 +- docs/TransferAnswerCallback.md | 28 +- docs/TransferCompleteCallback.md | 32 +- docs/TransferDisconnectCallback.md | 32 +- docs/UpdateCall.md | 32 +- docs/UpdateCallRecording.md | 18 +- docs/UpdateConference.md | 30 +- docs/UpdateConferenceMember.md | 20 +- docs/VerifyCodeRequest.md | 20 +- docs/VerifyCodeResponse.md | 18 +- docs/VoiceApiError.md | 20 +- docs/VoiceCodeResponse.md | 18 +- openapi-config.yml | 3 +- pyproject.toml | 30 + requirements.txt | 4 +- test-requirements.txt | 2 + test/integration/test_calls.py | 20 +- test/integration/test_conferences.py | 22 +- test/integration/test_media_api.py | 2 +- test/integration/test_messages_api.py | 16 +- .../test_multi_factor_authentication.py | 10 +- test/integration/test_phone_number_lookup.py | 35 +- test/integration/test_recordings.py | 22 +- test/test_account_statistics.py | 56 + test/test_answer_callback.py | 70 + test/test_bridge_complete_callback.py | 70 + test/test_bridge_target_complete_callback.py | 67 + test/test_call_direction_enum.py | 37 + test/test_call_recording_metadata.py | 76 + test/test_call_state.py | 72 + test/test_call_state_enum.py | 37 + test/test_callback_method_enum.py | 37 + test/test_calls_api.py | 62 + test/test_code_request.py | 65 + test/test_conference.py | 70 + test/test_conference_completed_callback.py | 59 + test/test_conference_created_callback.py | 59 + test/test_conference_member.py | 60 + test/test_conference_member_exit_callback.py | 62 + test/test_conference_member_join_callback.py | 62 + ...conference_recording_available_callback.py | 68 + test/test_conference_recording_metadata.py | 65 + test/test_conference_redirect_callback.py | 59 + test/test_conference_state_enum.py | 37 + test/test_conferences_api.py | 97 + test/test_create_call.py | 93 + test/test_create_call_response.py | 84 + test/test_create_lookup_response.py | 56 + test/test_create_message_request_error.py | 63 + test/test_deferred_result.py | 56 + test/test_disconnect_callback.py | 71 + test/test_diversion.py | 61 + test/test_dtmf_callback.py | 71 + test/test_field_error.py | 56 + test/test_file_format_enum.py | 37 + test/test_gather_callback.py | 72 + test/test_inbound_message_callback.py | 88 + test/test_inbound_message_callback_message.py | 75 + test/test_initiate_callback.py | 76 + test/test_list_message_direction_enum.py | 37 + test/test_list_message_item.py | 71 + test/test_lookup_request.py | 60 + test/test_lookup_result.py | 63 + test/test_lookup_status.py | 69 + test/test_lookup_status_enum.py | 37 + ...est_machine_detection_complete_callback.py | 70 + test/test_machine_detection_configuration.py | 69 + test/test_machine_detection_mode_enum.py | 37 + test/test_machine_detection_result.py | 56 + test/test_media.py | 57 + test/test_media_api.py | 62 + test/test_message.py | 67 + test/test_message_delivered_callback.py | 88 + ...test_message_delivered_callback_message.py | 76 + test/test_message_direction_enum.py | 37 + test/test_message_failed_callback.py | 90 + test/test_message_failed_callback_message.py | 77 + test/test_message_request.py | 65 + test/test_message_sending_callback.py | 88 + test/test_message_sending_callback_message.py | 77 + test/test_message_status_enum.py | 37 + test/test_message_type_enum.py | 37 + test/test_messages_api.py | 48 + test/test_messages_list.py | 80 + test/test_messaging_code_response.py | 55 + test/test_messaging_request_error.py | 58 + test/test_mfa_api.py | 55 + test/test_mfa_forbidden_request_error.py | 55 + test/test_mfa_request_error.py | 56 + test/test_mfa_unauthorized_request_error.py | 55 + test/test_page_info.py | 58 + test/test_phone_number_lookup_api.py | 48 + test/test_priority_enum.py | 37 + test/test_recording_available_callback.py | 76 + test/test_recording_complete_callback.py | 76 + test/test_recording_state_enum.py | 37 + test/test_recordings_api.py | 104 + test/test_redirect_callback.py | 70 + test/test_redirect_method_enum.py | 37 + test/test_statistics_api.py | 41 + test/test_stir_shaken.py | 57 + test/test_tag.py | 56 + test/test_tn_lookup_request_error.py | 55 + test/test_transcribe_recording.py | 61 + test/test_transcription.py | 56 + test/test_transcription_available_callback.py | 77 + test/test_transcription_list.py | 59 + test/test_transcription_metadata.py | 58 + test/test_transfer_answer_callback.py | 69 + test/test_transfer_complete_callback.py | 72 + test/test_transfer_disconnect_callback.py | 74 + test/test_update_call.py | 64 + test/test_update_call_recording.py | 56 + test/test_update_conference.py | 63 + test/test_update_conference_member.py | 57 + test/test_verify_code_request.py | 61 + test/test_verify_code_response.py | 55 + test/test_voice_api_error.py | 57 + test/test_voice_code_response.py | 55 + test/unit/bxml/test_base_classes.py | 6 +- test/unit/bxml/test_bridge.py | 6 +- test/unit/bxml/test_bxml.py | 2 +- test/unit/bxml/test_conference.py | 5 +- test/unit/bxml/test_forward.py | 5 +- test/unit/bxml/test_gather.py | 4 +- test/unit/bxml/test_hangup.py | 4 +- test/unit/bxml/test_pause.py | 4 +- test/unit/bxml/test_pause_recording.py | 4 +- test/unit/bxml/test_phone_number.py | 5 +- test/unit/bxml/test_play_audio.py | 5 +- test/unit/bxml/test_record.py | 4 +- test/unit/bxml/test_redirect.py | 4 +- test/unit/bxml/test_response.py | 2 +- test/unit/bxml/test_resume_recording.py | 4 +- test/unit/bxml/test_ring.py | 5 +- test/unit/bxml/test_send_dtmf.py | 4 +- test/unit/bxml/test_sip_uri.py | 5 +- test/unit/bxml/test_speak_sentence.py | 4 +- test/unit/bxml/test_start_gather.py | 5 +- test/unit/bxml/test_start_recording.py | 5 +- test/unit/bxml/test_start_stream.py | 3 +- test/unit/bxml/test_stop_gather.py | 4 +- test/unit/bxml/test_stop_recording.py | 4 +- test/unit/bxml/test_stop_stream.py | 4 +- test/unit/bxml/test_stream_param.py | 4 +- test/unit/bxml/test_tag.py | 4 +- test/unit/bxml/test_transfer.py | 7 +- test/unit/test_account_statistics.py | 40 +- test/unit/test_answer_callback.py | 70 + test/unit/test_bridge_complete_callback.py | 70 + .../test_bridge_target_complete_callback.py | 67 + test/unit/test_call_callback.py | 40 - test/unit/test_call_direction_enum.py | 21 +- test/unit/test_call_recording_metadata.py | 66 +- test/unit/test_call_state.py | 58 +- test/unit/test_call_state_enum.py | 21 +- test/unit/test_callback_method_enum.py | 21 +- test/unit/test_calls_api.py | 13 +- test/unit/test_code_request.py | 49 +- test/unit/test_conference.py | 58 +- test/unit/test_conference_callback.py | 36 - .../test_conference_completed_callback.py | 59 + test/unit/test_conference_created_callback.py | 59 + test/unit/test_conference_member.py | 44 +- .../test_conference_member_exit_callback.py | 62 + .../test_conference_member_join_callback.py | 62 + ...conference_recording_available_callback.py | 68 + .../test_conference_recording_metadata.py | 51 +- .../unit/test_conference_redirect_callback.py | 59 + test/unit/test_conference_state_enum.py | 21 +- test/unit/test_conferences_api.py | 13 +- test/unit/test_create_call.py | 81 +- test/unit/test_create_call_response.py | 70 +- test/unit/test_create_lookup_response.py | 40 +- .../unit/test_create_message_request_error.py | 63 + test/unit/test_deferred_result.py | 40 +- test/unit/test_disconnect_callback.py | 71 + test/unit/test_diversion.py | 45 +- test/unit/test_dtmf_callback.py | 71 + test/unit/test_field_error.py | 56 + test/unit/test_file_format_enum.py | 21 +- test/unit/test_gather_callback.py | 72 + test/unit/test_inbound_message_callback.py | 88 + .../test_inbound_message_callback_message.py | 75 + test/unit/test_initiate_callback.py | 76 + test/unit/test_list_message_direction_enum.py | 21 +- test/unit/test_list_message_item.py | 61 +- test/unit/test_lookup_request.py | 44 +- test/unit/test_lookup_result.py | 63 + test/unit/test_lookup_status.py | 57 +- test/unit/test_lookup_status_enum.py | 21 +- test/unit/test_lookup_status_result_inner.py | 36 - ...est_machine_detection_complete_callback.py | 70 + .../test_machine_detection_configuration.py | 57 +- test/unit/test_machine_detection_mode_enum.py | 21 +- test/unit/test_machine_detection_result.py | 56 + test/unit/test_media.py | 41 +- test/unit/test_media_api.py | 13 +- test/unit/test_message.py | 55 +- test/unit/test_message_delivered_callback.py | 88 + ...test_message_delivered_callback_message.py | 76 + test/unit/test_message_direction_enum.py | 21 +- test/unit/test_message_failed_callback.py | 90 + .../test_message_failed_callback_message.py | 77 + test/unit/test_message_request.py | 51 +- test/unit/test_message_sending_callback.py | 88 + .../test_message_sending_callback_message.py | 77 + test/unit/test_message_status_enum.py | 21 +- test/unit/test_message_type_enum.py | 21 +- test/unit/test_messages_api.py | 13 +- test/unit/test_messages_list.py | 68 +- test/unit/test_messaging_code_response.py | 39 +- test/unit/test_messaging_request_error.py | 42 +- test/unit/test_mfa_api.py | 13 +- test/unit/test_mfa_forbidden_request_error.py | 39 +- test/unit/test_mfa_request_error.py | 40 +- .../test_mfa_unauthorized_request_error.py | 39 +- test/unit/test_page_info.py | 42 +- test/unit/test_phone_number_lookup_api.py | 13 +- test/unit/test_priority_enum.py | 21 +- .../unit/test_recording_available_callback.py | 76 + test/unit/test_recording_complete_callback.py | 76 + test/unit/test_recording_state_enum.py | 21 +- test/unit/test_recordings_api.py | 13 +- test/unit/test_redirect_callback.py | 70 + test/unit/test_redirect_method_enum.py | 21 +- test/unit/test_statistics_api.py | 13 +- test/unit/test_stir_shaken.py | 57 + test/unit/test_tag.py | 40 +- test/unit/test_tn_lookup_request_error.py | 39 +- test/unit/test_transcribe_recording.py | 47 +- test/unit/test_transcription.py | 40 +- .../test_transcription_available_callback.py | 77 + test/unit/test_transcription_list.py | 45 +- test/unit/test_transcription_metadata.py | 42 +- test/unit/test_transfer_answer_callback.py | 69 + test/unit/test_transfer_complete_callback.py | 72 + .../unit/test_transfer_disconnect_callback.py | 74 + test/unit/test_update_call.py | 52 +- test/unit/test_update_call_recording.py | 42 +- test/unit/test_update_conference.py | 51 +- test/unit/test_update_conference_member.py | 41 +- test/unit/test_verify_code_request.py | 45 +- test/unit/test_verify_code_response.py | 39 +- test/unit/test_voice_api_error.py | 41 +- test/unit/test_voice_code_response.py | 39 +- test/utils/call_cleanup.py | 6 +- 566 files changed, 28255 insertions(+), 35188 deletions(-) create mode 100644 .github/workflows/python.yml create mode 100644 bandwidth/api_response.py delete mode 100644 bandwidth/apis/__init__.py delete mode 100644 bandwidth/model/__init__.py delete mode 100644 bandwidth/model/account_statistics.py delete mode 100644 bandwidth/model/answer_callback.py delete mode 100644 bandwidth/model/bridge_complete_callback.py delete mode 100644 bandwidth/model/bridge_target_complete_callback.py delete mode 100644 bandwidth/model/bxml/__init__.py delete mode 100644 bandwidth/model/call_callback.py delete mode 100644 bandwidth/model/call_direction_enum.py delete mode 100644 bandwidth/model/call_recording_metadata.py delete mode 100644 bandwidth/model/call_state.py delete mode 100644 bandwidth/model/call_state_enum.py delete mode 100644 bandwidth/model/callback_method_enum.py delete mode 100644 bandwidth/model/code_request.py delete mode 100644 bandwidth/model/conference.py delete mode 100644 bandwidth/model/conference_callback.py delete mode 100644 bandwidth/model/conference_completed_callback.py delete mode 100644 bandwidth/model/conference_created_callback.py delete mode 100644 bandwidth/model/conference_member.py delete mode 100644 bandwidth/model/conference_member_exit_callback.py delete mode 100644 bandwidth/model/conference_member_join_callback.py delete mode 100644 bandwidth/model/conference_recording_available_callback.py delete mode 100644 bandwidth/model/conference_recording_metadata.py delete mode 100644 bandwidth/model/conference_redirect_callback.py delete mode 100644 bandwidth/model/conference_state_enum.py delete mode 100644 bandwidth/model/create_call.py delete mode 100644 bandwidth/model/create_call_response.py delete mode 100644 bandwidth/model/create_lookup_response.py delete mode 100644 bandwidth/model/create_message_request_error.py delete mode 100644 bandwidth/model/deferred_result.py delete mode 100644 bandwidth/model/disconenct_callback.py delete mode 100644 bandwidth/model/diversion.py delete mode 100644 bandwidth/model/dtmf_callback.py delete mode 100644 bandwidth/model/field_error.py delete mode 100644 bandwidth/model/file_format_enum.py delete mode 100644 bandwidth/model/gather_callback.py delete mode 100644 bandwidth/model/initiate_callback.py delete mode 100644 bandwidth/model/list_message_direction_enum.py delete mode 100644 bandwidth/model/list_message_item.py delete mode 100644 bandwidth/model/lookup_request.py delete mode 100644 bandwidth/model/lookup_result.py delete mode 100644 bandwidth/model/lookup_status.py delete mode 100644 bandwidth/model/lookup_status_enum.py delete mode 100644 bandwidth/model/lookup_status_result_inner.py delete mode 100644 bandwidth/model/machine_detection_complete_callback.py delete mode 100644 bandwidth/model/machine_detection_configuration.py delete mode 100644 bandwidth/model/machine_detection_mode_enum.py delete mode 100644 bandwidth/model/media.py delete mode 100644 bandwidth/model/message.py delete mode 100644 bandwidth/model/message_direction_enum.py delete mode 100644 bandwidth/model/message_request.py delete mode 100644 bandwidth/model/message_status_enum.py delete mode 100644 bandwidth/model/message_type_enum.py delete mode 100644 bandwidth/model/messages_list.py delete mode 100644 bandwidth/model/messaging_code_response.py delete mode 100644 bandwidth/model/messaging_request_error.py delete mode 100644 bandwidth/model/mfa_forbidden_request_error.py delete mode 100644 bandwidth/model/mfa_request_error.py delete mode 100644 bandwidth/model/mfa_unauthorized_request_error.py delete mode 100644 bandwidth/model/page_info.py delete mode 100644 bandwidth/model/priority_enum.py delete mode 100644 bandwidth/model/recording_available_callback.py delete mode 100644 bandwidth/model/recording_complete_callback.py delete mode 100644 bandwidth/model/recording_state_enum.py delete mode 100644 bandwidth/model/redirect_callback.py delete mode 100644 bandwidth/model/redirect_method_enum.py delete mode 100644 bandwidth/model/stir_shaken.py delete mode 100644 bandwidth/model/tag.py delete mode 100644 bandwidth/model/tn_lookup_request_error.py delete mode 100644 bandwidth/model/transcribe_recording.py delete mode 100644 bandwidth/model/transcription.py delete mode 100644 bandwidth/model/transcription_available_callback.py delete mode 100644 bandwidth/model/transcription_list.py delete mode 100644 bandwidth/model/transcription_metadata.py delete mode 100644 bandwidth/model/transfer_answer_callback.py delete mode 100644 bandwidth/model/transfer_complete_callback.py delete mode 100644 bandwidth/model/transfer_disconnect_callback.py delete mode 100644 bandwidth/model/update_call.py delete mode 100644 bandwidth/model/update_call_recording.py delete mode 100644 bandwidth/model/update_conference.py delete mode 100644 bandwidth/model/update_conference_member.py delete mode 100644 bandwidth/model/verify_code_request.py delete mode 100644 bandwidth/model/verify_code_response.py delete mode 100644 bandwidth/model/voice_api_error.py delete mode 100644 bandwidth/model/voice_code_response.py delete mode 100644 bandwidth/model_utils.py create mode 100644 bandwidth/models/account_statistics.py create mode 100644 bandwidth/models/answer_callback.py create mode 100644 bandwidth/models/bridge_complete_callback.py create mode 100644 bandwidth/models/bridge_target_complete_callback.py create mode 100644 bandwidth/models/bxml/__init__.py rename bandwidth/{model => models}/bxml/bxml.py (100%) rename bandwidth/{model => models}/bxml/response.py (100%) rename bandwidth/{model => models}/bxml/root.py (97%) rename bandwidth/{model => models}/bxml/terminal_verb.py (100%) rename bandwidth/{model => models}/bxml/verb.py (100%) rename bandwidth/{model => models}/bxml/verbs/__init__.py (94%) rename bandwidth/{model => models}/bxml/verbs/bridge.py (100%) rename bandwidth/{model => models}/bxml/verbs/conference.py (100%) rename bandwidth/{model => models}/bxml/verbs/forward.py (100%) rename bandwidth/{model => models}/bxml/verbs/gather.py (100%) rename bandwidth/{model => models}/bxml/verbs/hangup.py (100%) rename bandwidth/{model => models}/bxml/verbs/pause.py (100%) rename bandwidth/{model => models}/bxml/verbs/pause_recording.py (100%) rename bandwidth/{model => models}/bxml/verbs/phone_number.py (100%) rename bandwidth/{model => models}/bxml/verbs/play_audio.py (100%) rename bandwidth/{model => models}/bxml/verbs/record.py (100%) rename bandwidth/{model => models}/bxml/verbs/redirect.py (100%) rename bandwidth/{model => models}/bxml/verbs/resume_recording.py (100%) rename bandwidth/{model => models}/bxml/verbs/ring.py (100%) rename bandwidth/{model => models}/bxml/verbs/send_dtmf.py (100%) rename bandwidth/{model => models}/bxml/verbs/sip_uri.py (100%) rename bandwidth/{model => models}/bxml/verbs/speak_sentence.py (100%) rename bandwidth/{model => models}/bxml/verbs/start_gather.py (100%) rename bandwidth/{model => models}/bxml/verbs/start_recording.py (100%) rename bandwidth/{model => models}/bxml/verbs/start_stream.py (100%) rename bandwidth/{model => models}/bxml/verbs/stop_gather.py (100%) rename bandwidth/{model => models}/bxml/verbs/stop_recording.py (100%) rename bandwidth/{model => models}/bxml/verbs/stop_stream.py (100%) rename bandwidth/{model => models}/bxml/verbs/stream_param.py (100%) rename bandwidth/{model => models}/bxml/verbs/tag.py (100%) rename bandwidth/{model => models}/bxml/verbs/transfer.py (100%) create mode 100644 bandwidth/models/call_direction_enum.py create mode 100644 bandwidth/models/call_recording_metadata.py create mode 100644 bandwidth/models/call_state.py create mode 100644 bandwidth/models/call_state_enum.py create mode 100644 bandwidth/models/callback_method_enum.py create mode 100644 bandwidth/models/code_request.py create mode 100644 bandwidth/models/conference.py create mode 100644 bandwidth/models/conference_completed_callback.py create mode 100644 bandwidth/models/conference_created_callback.py create mode 100644 bandwidth/models/conference_member.py create mode 100644 bandwidth/models/conference_member_exit_callback.py create mode 100644 bandwidth/models/conference_member_join_callback.py create mode 100644 bandwidth/models/conference_recording_available_callback.py create mode 100644 bandwidth/models/conference_recording_metadata.py create mode 100644 bandwidth/models/conference_redirect_callback.py create mode 100644 bandwidth/models/conference_state_enum.py create mode 100644 bandwidth/models/create_call.py create mode 100644 bandwidth/models/create_call_response.py create mode 100644 bandwidth/models/create_lookup_response.py create mode 100644 bandwidth/models/create_message_request_error.py create mode 100644 bandwidth/models/deferred_result.py create mode 100644 bandwidth/models/disconnect_callback.py create mode 100644 bandwidth/models/diversion.py create mode 100644 bandwidth/models/dtmf_callback.py create mode 100644 bandwidth/models/field_error.py create mode 100644 bandwidth/models/file_format_enum.py create mode 100644 bandwidth/models/gather_callback.py create mode 100644 bandwidth/models/inbound_message_callback.py create mode 100644 bandwidth/models/inbound_message_callback_message.py create mode 100644 bandwidth/models/initiate_callback.py create mode 100644 bandwidth/models/list_message_direction_enum.py create mode 100644 bandwidth/models/list_message_item.py create mode 100644 bandwidth/models/lookup_request.py create mode 100644 bandwidth/models/lookup_result.py create mode 100644 bandwidth/models/lookup_status.py create mode 100644 bandwidth/models/lookup_status_enum.py create mode 100644 bandwidth/models/machine_detection_complete_callback.py create mode 100644 bandwidth/models/machine_detection_configuration.py create mode 100644 bandwidth/models/machine_detection_mode_enum.py create mode 100644 bandwidth/models/machine_detection_result.py create mode 100644 bandwidth/models/media.py create mode 100644 bandwidth/models/message.py create mode 100644 bandwidth/models/message_delivered_callback.py create mode 100644 bandwidth/models/message_delivered_callback_message.py create mode 100644 bandwidth/models/message_direction_enum.py create mode 100644 bandwidth/models/message_failed_callback.py create mode 100644 bandwidth/models/message_failed_callback_message.py create mode 100644 bandwidth/models/message_request.py create mode 100644 bandwidth/models/message_sending_callback.py create mode 100644 bandwidth/models/message_sending_callback_message.py create mode 100644 bandwidth/models/message_status_enum.py create mode 100644 bandwidth/models/message_type_enum.py create mode 100644 bandwidth/models/messages_list.py create mode 100644 bandwidth/models/messaging_code_response.py create mode 100644 bandwidth/models/messaging_request_error.py create mode 100644 bandwidth/models/mfa_forbidden_request_error.py create mode 100644 bandwidth/models/mfa_request_error.py create mode 100644 bandwidth/models/mfa_unauthorized_request_error.py create mode 100644 bandwidth/models/page_info.py create mode 100644 bandwidth/models/priority_enum.py create mode 100644 bandwidth/models/recording_available_callback.py create mode 100644 bandwidth/models/recording_complete_callback.py create mode 100644 bandwidth/models/recording_state_enum.py create mode 100644 bandwidth/models/redirect_callback.py create mode 100644 bandwidth/models/redirect_method_enum.py create mode 100644 bandwidth/models/stir_shaken.py create mode 100644 bandwidth/models/tag.py create mode 100644 bandwidth/models/tn_lookup_request_error.py create mode 100644 bandwidth/models/transcribe_recording.py create mode 100644 bandwidth/models/transcription.py create mode 100644 bandwidth/models/transcription_available_callback.py create mode 100644 bandwidth/models/transcription_list.py create mode 100644 bandwidth/models/transcription_metadata.py create mode 100644 bandwidth/models/transfer_answer_callback.py create mode 100644 bandwidth/models/transfer_complete_callback.py create mode 100644 bandwidth/models/transfer_disconnect_callback.py create mode 100644 bandwidth/models/update_call.py create mode 100644 bandwidth/models/update_call_recording.py create mode 100644 bandwidth/models/update_conference.py create mode 100644 bandwidth/models/update_conference_member.py create mode 100644 bandwidth/models/verify_code_request.py create mode 100644 bandwidth/models/verify_code_response.py create mode 100644 bandwidth/models/voice_api_error.py create mode 100644 bandwidth/models/voice_code_response.py create mode 100644 bandwidth/py.typed delete mode 100644 docs/CallCallback.md delete mode 100644 docs/ConferenceCallback.md rename docs/{DisconenctCallback.md => DisconnectCallback.md} (51%) create mode 100644 docs/InboundMessageCallback.md create mode 100644 docs/InboundMessageCallbackMessage.md delete mode 100644 docs/LookupStatusResultInner.md create mode 100644 docs/MachineDetectionResult.md create mode 100644 docs/MessageDeliveredCallback.md create mode 100644 docs/MessageDeliveredCallbackMessage.md create mode 100644 docs/MessageFailedCallback.md create mode 100644 docs/MessageFailedCallbackMessage.md create mode 100644 docs/MessageSendingCallback.md create mode 100644 docs/MessageSendingCallbackMessage.md delete mode 100644 docs/PublishPermissionsEnum.md delete mode 100644 docs/RequestError.md create mode 100644 pyproject.toml create mode 100644 test/test_account_statistics.py create mode 100644 test/test_answer_callback.py create mode 100644 test/test_bridge_complete_callback.py create mode 100644 test/test_bridge_target_complete_callback.py create mode 100644 test/test_call_direction_enum.py create mode 100644 test/test_call_recording_metadata.py create mode 100644 test/test_call_state.py create mode 100644 test/test_call_state_enum.py create mode 100644 test/test_callback_method_enum.py create mode 100644 test/test_calls_api.py create mode 100644 test/test_code_request.py create mode 100644 test/test_conference.py create mode 100644 test/test_conference_completed_callback.py create mode 100644 test/test_conference_created_callback.py create mode 100644 test/test_conference_member.py create mode 100644 test/test_conference_member_exit_callback.py create mode 100644 test/test_conference_member_join_callback.py create mode 100644 test/test_conference_recording_available_callback.py create mode 100644 test/test_conference_recording_metadata.py create mode 100644 test/test_conference_redirect_callback.py create mode 100644 test/test_conference_state_enum.py create mode 100644 test/test_conferences_api.py create mode 100644 test/test_create_call.py create mode 100644 test/test_create_call_response.py create mode 100644 test/test_create_lookup_response.py create mode 100644 test/test_create_message_request_error.py create mode 100644 test/test_deferred_result.py create mode 100644 test/test_disconnect_callback.py create mode 100644 test/test_diversion.py create mode 100644 test/test_dtmf_callback.py create mode 100644 test/test_field_error.py create mode 100644 test/test_file_format_enum.py create mode 100644 test/test_gather_callback.py create mode 100644 test/test_inbound_message_callback.py create mode 100644 test/test_inbound_message_callback_message.py create mode 100644 test/test_initiate_callback.py create mode 100644 test/test_list_message_direction_enum.py create mode 100644 test/test_list_message_item.py create mode 100644 test/test_lookup_request.py create mode 100644 test/test_lookup_result.py create mode 100644 test/test_lookup_status.py create mode 100644 test/test_lookup_status_enum.py create mode 100644 test/test_machine_detection_complete_callback.py create mode 100644 test/test_machine_detection_configuration.py create mode 100644 test/test_machine_detection_mode_enum.py create mode 100644 test/test_machine_detection_result.py create mode 100644 test/test_media.py create mode 100644 test/test_media_api.py create mode 100644 test/test_message.py create mode 100644 test/test_message_delivered_callback.py create mode 100644 test/test_message_delivered_callback_message.py create mode 100644 test/test_message_direction_enum.py create mode 100644 test/test_message_failed_callback.py create mode 100644 test/test_message_failed_callback_message.py create mode 100644 test/test_message_request.py create mode 100644 test/test_message_sending_callback.py create mode 100644 test/test_message_sending_callback_message.py create mode 100644 test/test_message_status_enum.py create mode 100644 test/test_message_type_enum.py create mode 100644 test/test_messages_api.py create mode 100644 test/test_messages_list.py create mode 100644 test/test_messaging_code_response.py create mode 100644 test/test_messaging_request_error.py create mode 100644 test/test_mfa_api.py create mode 100644 test/test_mfa_forbidden_request_error.py create mode 100644 test/test_mfa_request_error.py create mode 100644 test/test_mfa_unauthorized_request_error.py create mode 100644 test/test_page_info.py create mode 100644 test/test_phone_number_lookup_api.py create mode 100644 test/test_priority_enum.py create mode 100644 test/test_recording_available_callback.py create mode 100644 test/test_recording_complete_callback.py create mode 100644 test/test_recording_state_enum.py create mode 100644 test/test_recordings_api.py create mode 100644 test/test_redirect_callback.py create mode 100644 test/test_redirect_method_enum.py create mode 100644 test/test_statistics_api.py create mode 100644 test/test_stir_shaken.py create mode 100644 test/test_tag.py create mode 100644 test/test_tn_lookup_request_error.py create mode 100644 test/test_transcribe_recording.py create mode 100644 test/test_transcription.py create mode 100644 test/test_transcription_available_callback.py create mode 100644 test/test_transcription_list.py create mode 100644 test/test_transcription_metadata.py create mode 100644 test/test_transfer_answer_callback.py create mode 100644 test/test_transfer_complete_callback.py create mode 100644 test/test_transfer_disconnect_callback.py create mode 100644 test/test_update_call.py create mode 100644 test/test_update_call_recording.py create mode 100644 test/test_update_conference.py create mode 100644 test/test_update_conference_member.py create mode 100644 test/test_verify_code_request.py create mode 100644 test/test_verify_code_response.py create mode 100644 test/test_voice_api_error.py create mode 100644 test/test_voice_code_response.py create mode 100644 test/unit/test_answer_callback.py create mode 100644 test/unit/test_bridge_complete_callback.py create mode 100644 test/unit/test_bridge_target_complete_callback.py delete mode 100644 test/unit/test_call_callback.py delete mode 100644 test/unit/test_conference_callback.py create mode 100644 test/unit/test_conference_completed_callback.py create mode 100644 test/unit/test_conference_created_callback.py create mode 100644 test/unit/test_conference_member_exit_callback.py create mode 100644 test/unit/test_conference_member_join_callback.py create mode 100644 test/unit/test_conference_recording_available_callback.py create mode 100644 test/unit/test_conference_redirect_callback.py create mode 100644 test/unit/test_create_message_request_error.py create mode 100644 test/unit/test_disconnect_callback.py create mode 100644 test/unit/test_dtmf_callback.py create mode 100644 test/unit/test_field_error.py create mode 100644 test/unit/test_gather_callback.py create mode 100644 test/unit/test_inbound_message_callback.py create mode 100644 test/unit/test_inbound_message_callback_message.py create mode 100644 test/unit/test_initiate_callback.py create mode 100644 test/unit/test_lookup_result.py delete mode 100644 test/unit/test_lookup_status_result_inner.py create mode 100644 test/unit/test_machine_detection_complete_callback.py create mode 100644 test/unit/test_machine_detection_result.py create mode 100644 test/unit/test_message_delivered_callback.py create mode 100644 test/unit/test_message_delivered_callback_message.py create mode 100644 test/unit/test_message_failed_callback.py create mode 100644 test/unit/test_message_failed_callback_message.py create mode 100644 test/unit/test_message_sending_callback.py create mode 100644 test/unit/test_message_sending_callback_message.py create mode 100644 test/unit/test_recording_available_callback.py create mode 100644 test/unit/test_recording_complete_callback.py create mode 100644 test/unit/test_redirect_callback.py create mode 100644 test/unit/test_stir_shaken.py create mode 100644 test/unit/test_transcription_available_callback.py create mode 100644 test/unit/test_transfer_answer_callback.py create mode 100644 test/unit/test_transfer_complete_callback.py create mode 100644 test/unit/test_transfer_disconnect_callback.py diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000..f2f0e990 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,37 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: bandwidth Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4eea6662..4b6ac748 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,24 +1,25 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=bandwidth -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 5431c8b7..895bb936 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -25,5 +25,5 @@ .gitignore setup.cfg setup.py -*requirements.txt +#*requirements.txt test/* diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ae594a2e..59040755 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/python.yml .gitlab-ci.yml .travis.yml README.md @@ -12,91 +13,99 @@ bandwidth/api/phone_number_lookup_api.py bandwidth/api/recordings_api.py bandwidth/api/statistics_api.py bandwidth/api_client.py -bandwidth/apis/__init__.py +bandwidth/api_response.py bandwidth/configuration.py bandwidth/exceptions.py -bandwidth/model/__init__.py -bandwidth/model/account_statistics.py -bandwidth/model/answer_callback.py -bandwidth/model/bridge_complete_callback.py -bandwidth/model/bridge_target_complete_callback.py -bandwidth/model/call_direction_enum.py -bandwidth/model/call_recording_metadata.py -bandwidth/model/call_state.py -bandwidth/model/call_state_enum.py -bandwidth/model/callback_method_enum.py -bandwidth/model/code_request.py -bandwidth/model/conference.py -bandwidth/model/conference_completed_callback.py -bandwidth/model/conference_created_callback.py -bandwidth/model/conference_member.py -bandwidth/model/conference_member_exit_callback.py -bandwidth/model/conference_member_join_callback.py -bandwidth/model/conference_recording_available_callback.py -bandwidth/model/conference_recording_metadata.py -bandwidth/model/conference_redirect_callback.py -bandwidth/model/conference_state_enum.py -bandwidth/model/create_call.py -bandwidth/model/create_call_response.py -bandwidth/model/create_lookup_response.py -bandwidth/model/create_message_request_error.py -bandwidth/model/deferred_result.py -bandwidth/model/disconenct_callback.py -bandwidth/model/diversion.py -bandwidth/model/dtmf_callback.py -bandwidth/model/field_error.py -bandwidth/model/file_format_enum.py -bandwidth/model/gather_callback.py -bandwidth/model/initiate_callback.py -bandwidth/model/list_message_direction_enum.py -bandwidth/model/list_message_item.py -bandwidth/model/lookup_request.py -bandwidth/model/lookup_result.py -bandwidth/model/lookup_status.py -bandwidth/model/lookup_status_enum.py -bandwidth/model/machine_detection_complete_callback.py -bandwidth/model/machine_detection_configuration.py -bandwidth/model/machine_detection_mode_enum.py -bandwidth/model/media.py -bandwidth/model/message.py -bandwidth/model/message_direction_enum.py -bandwidth/model/message_request.py -bandwidth/model/message_status_enum.py -bandwidth/model/message_type_enum.py -bandwidth/model/messages_list.py -bandwidth/model/messaging_code_response.py -bandwidth/model/messaging_request_error.py -bandwidth/model/mfa_forbidden_request_error.py -bandwidth/model/mfa_request_error.py -bandwidth/model/mfa_unauthorized_request_error.py -bandwidth/model/page_info.py -bandwidth/model/priority_enum.py -bandwidth/model/recording_available_callback.py -bandwidth/model/recording_complete_callback.py -bandwidth/model/recording_state_enum.py -bandwidth/model/redirect_callback.py -bandwidth/model/redirect_method_enum.py -bandwidth/model/stir_shaken.py -bandwidth/model/tag.py -bandwidth/model/tn_lookup_request_error.py -bandwidth/model/transcribe_recording.py -bandwidth/model/transcription.py -bandwidth/model/transcription_available_callback.py -bandwidth/model/transcription_list.py -bandwidth/model/transcription_metadata.py -bandwidth/model/transfer_answer_callback.py -bandwidth/model/transfer_complete_callback.py -bandwidth/model/transfer_disconnect_callback.py -bandwidth/model/update_call.py -bandwidth/model/update_call_recording.py -bandwidth/model/update_conference.py -bandwidth/model/update_conference_member.py -bandwidth/model/verify_code_request.py -bandwidth/model/verify_code_response.py -bandwidth/model/voice_api_error.py -bandwidth/model/voice_code_response.py -bandwidth/model_utils.py bandwidth/models/__init__.py +bandwidth/models/account_statistics.py +bandwidth/models/answer_callback.py +bandwidth/models/bridge_complete_callback.py +bandwidth/models/bridge_target_complete_callback.py +bandwidth/models/call_direction_enum.py +bandwidth/models/call_recording_metadata.py +bandwidth/models/call_state.py +bandwidth/models/call_state_enum.py +bandwidth/models/callback_method_enum.py +bandwidth/models/code_request.py +bandwidth/models/conference.py +bandwidth/models/conference_completed_callback.py +bandwidth/models/conference_created_callback.py +bandwidth/models/conference_member.py +bandwidth/models/conference_member_exit_callback.py +bandwidth/models/conference_member_join_callback.py +bandwidth/models/conference_recording_available_callback.py +bandwidth/models/conference_recording_metadata.py +bandwidth/models/conference_redirect_callback.py +bandwidth/models/conference_state_enum.py +bandwidth/models/create_call.py +bandwidth/models/create_call_response.py +bandwidth/models/create_lookup_response.py +bandwidth/models/create_message_request_error.py +bandwidth/models/deferred_result.py +bandwidth/models/disconnect_callback.py +bandwidth/models/diversion.py +bandwidth/models/dtmf_callback.py +bandwidth/models/field_error.py +bandwidth/models/file_format_enum.py +bandwidth/models/gather_callback.py +bandwidth/models/inbound_message_callback.py +bandwidth/models/inbound_message_callback_message.py +bandwidth/models/initiate_callback.py +bandwidth/models/list_message_direction_enum.py +bandwidth/models/list_message_item.py +bandwidth/models/lookup_request.py +bandwidth/models/lookup_result.py +bandwidth/models/lookup_status.py +bandwidth/models/lookup_status_enum.py +bandwidth/models/machine_detection_complete_callback.py +bandwidth/models/machine_detection_configuration.py +bandwidth/models/machine_detection_mode_enum.py +bandwidth/models/machine_detection_result.py +bandwidth/models/media.py +bandwidth/models/message.py +bandwidth/models/message_delivered_callback.py +bandwidth/models/message_delivered_callback_message.py +bandwidth/models/message_direction_enum.py +bandwidth/models/message_failed_callback.py +bandwidth/models/message_failed_callback_message.py +bandwidth/models/message_request.py +bandwidth/models/message_sending_callback.py +bandwidth/models/message_sending_callback_message.py +bandwidth/models/message_status_enum.py +bandwidth/models/message_type_enum.py +bandwidth/models/messages_list.py +bandwidth/models/messaging_code_response.py +bandwidth/models/messaging_request_error.py +bandwidth/models/mfa_forbidden_request_error.py +bandwidth/models/mfa_request_error.py +bandwidth/models/mfa_unauthorized_request_error.py +bandwidth/models/page_info.py +bandwidth/models/priority_enum.py +bandwidth/models/recording_available_callback.py +bandwidth/models/recording_complete_callback.py +bandwidth/models/recording_state_enum.py +bandwidth/models/redirect_callback.py +bandwidth/models/redirect_method_enum.py +bandwidth/models/stir_shaken.py +bandwidth/models/tag.py +bandwidth/models/tn_lookup_request_error.py +bandwidth/models/transcribe_recording.py +bandwidth/models/transcription.py +bandwidth/models/transcription_available_callback.py +bandwidth/models/transcription_list.py +bandwidth/models/transcription_metadata.py +bandwidth/models/transfer_answer_callback.py +bandwidth/models/transfer_complete_callback.py +bandwidth/models/transfer_disconnect_callback.py +bandwidth/models/update_call.py +bandwidth/models/update_call_recording.py +bandwidth/models/update_conference.py +bandwidth/models/update_conference_member.py +bandwidth/models/verify_code_request.py +bandwidth/models/verify_code_response.py +bandwidth/models/voice_api_error.py +bandwidth/models/voice_code_response.py +bandwidth/py.typed bandwidth/rest.py docs/AccountStatistics.md docs/AnswerCallback.md @@ -125,12 +134,14 @@ docs/CreateCallResponse.md docs/CreateLookupResponse.md docs/CreateMessageRequestError.md docs/DeferredResult.md -docs/DisconenctCallback.md +docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md docs/FieldError.md docs/FileFormatEnum.md docs/GatherCallback.md +docs/InboundMessageCallback.md +docs/InboundMessageCallbackMessage.md docs/InitiateCallback.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md @@ -142,11 +153,18 @@ docs/MFAApi.md docs/MachineDetectionCompleteCallback.md docs/MachineDetectionConfiguration.md docs/MachineDetectionModeEnum.md +docs/MachineDetectionResult.md docs/Media.md docs/MediaApi.md docs/Message.md +docs/MessageDeliveredCallback.md +docs/MessageDeliveredCallbackMessage.md docs/MessageDirectionEnum.md +docs/MessageFailedCallback.md +docs/MessageFailedCallbackMessage.md docs/MessageRequest.md +docs/MessageSendingCallback.md +docs/MessageSendingCallbackMessage.md docs/MessageStatusEnum.md docs/MessageTypeEnum.md docs/MessagesApi.md @@ -186,4 +204,7 @@ docs/VerifyCodeResponse.md docs/VoiceApiError.md docs/VoiceCodeResponse.md git_push.sh +pyproject.toml +requirements.txt +test-requirements.txt tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 6d54bbd7..41225218 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +7.0.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index cc23b301..27e94b28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/README.md b/README.md index 2c93e413..35194257 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Bandwidth's Communication APIs This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Package version: 1.0.0 +- Package version: 15.0.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com) ## Requirements. -Python >=3.6 +Python 3.7+ ## Installation & Usage ### pip install @@ -41,6 +41,10 @@ Then import the package: import bandwidth ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: @@ -49,13 +53,9 @@ Please follow the [installation procedure](#installation--usage) and then run th import time import bandwidth +from bandwidth.rest import ApiException from pprint import pprint -from bandwidth.api import calls_api -from bandwidth.model.call_state import CallState -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.voice_api_error import VoiceApiError + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -69,60 +69,26 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = calls_api.CallsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - create_call = CreateCall( - to="+19195551234", - _from="+19195554321", - uui="eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64", - application_id="1234-qwer-5679-tyui", - answer_url="https://www.myCallbackServer.com/webhooks/answer", - answer_method=CallbackMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - answer_fallback_url="https://www.myFallbackServer.com/webhooks/answer", - answer_fallback_method=CallbackMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - disconnect_url="disconnect_url_example", - disconnect_method=CallbackMethodEnum("POST"), - call_timeout=30, - callback_timeout=15, - machine_detection=MachineDetectionConfiguration( - mode=MachineDetectionModeEnum("async"), - detection_timeout=15, - silence_timeout=10, - speech_threshold=10, - speech_end_threshold=5, - machine_speech_end_threshold=5, - delay_result=False, - callback_url="https://myServer.com/bandwidth/webhooks/machineDetectionComplete", - callback_method=CallbackMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - fallback_url="https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete", - fallback_method=CallbackMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - ), - priority=5, - tag="tag_example", - ) # CreateCall | JSON object containing information to create an outbound call + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + create_call = bandwidth.CreateCall() # CreateCall | JSON object containing information to create an outbound call try: # Create Call api_response = api_instance.create_call(account_id, create_call) + print("The response of CallsApi->create_call:\n") pprint(api_response) - except bandwidth.ApiException as e: + except ApiException as e: print("Exception when calling CallsApi->create_call: %s\n" % e) + ``` ## Documentation for API Endpoints @@ -195,12 +161,14 @@ Class | Method | HTTP request | Description - [CreateLookupResponse](docs/CreateLookupResponse.md) - [CreateMessageRequestError](docs/CreateMessageRequestError.md) - [DeferredResult](docs/DeferredResult.md) - - [DisconenctCallback](docs/DisconenctCallback.md) + - [DisconnectCallback](docs/DisconnectCallback.md) - [Diversion](docs/Diversion.md) - [DtmfCallback](docs/DtmfCallback.md) - [FieldError](docs/FieldError.md) - [FileFormatEnum](docs/FileFormatEnum.md) - [GatherCallback](docs/GatherCallback.md) + - [InboundMessageCallback](docs/InboundMessageCallback.md) + - [InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md) - [InitiateCallback](docs/InitiateCallback.md) - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [ListMessageItem](docs/ListMessageItem.md) @@ -211,10 +179,17 @@ Class | Method | HTTP request | Description - [MachineDetectionCompleteCallback](docs/MachineDetectionCompleteCallback.md) - [MachineDetectionConfiguration](docs/MachineDetectionConfiguration.md) - [MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md) + - [MachineDetectionResult](docs/MachineDetectionResult.md) - [Media](docs/Media.md) - [Message](docs/Message.md) + - [MessageDeliveredCallback](docs/MessageDeliveredCallback.md) + - [MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md) - [MessageDirectionEnum](docs/MessageDirectionEnum.md) + - [MessageFailedCallback](docs/MessageFailedCallback.md) + - [MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md) - [MessageRequest](docs/MessageRequest.md) + - [MessageSendingCallback](docs/MessageSendingCallback.md) + - [MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md) - [MessageStatusEnum](docs/MessageStatusEnum.md) - [MessageTypeEnum](docs/MessageTypeEnum.md) - [MessagesList](docs/MessagesList.md) @@ -251,10 +226,13 @@ Class | Method | HTTP request | Description - [VoiceCodeResponse](docs/VoiceCodeResponse.md) + ## Documentation For Authorization -## Basic +Authentication schemes defined for the API: + +### Basic - **Type**: HTTP basic authentication @@ -264,22 +242,3 @@ Class | Method | HTTP request | Description letstalk@bandwidth.com -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in bandwidth.apis and bandwidth.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from bandwidth.api.default_api import DefaultApi` -- `from bandwidth.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import bandwidth -from bandwidth.apis import * -from bandwidth.models import * -``` - diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 514d593c..c7a1b41e 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -1,28 +1,129 @@ +# coding: utf-8 + # flake8: noqa """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -__version__ = "1.0.0" +__version__ = "15.0.0" + +# import apis into sdk package +from bandwidth.api.calls_api import CallsApi +from bandwidth.api.conferences_api import ConferencesApi +from bandwidth.api.mfa_api import MFAApi +from bandwidth.api.media_api import MediaApi +from bandwidth.api.messages_api import MessagesApi +from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi +from bandwidth.api.recordings_api import RecordingsApi +from bandwidth.api.statistics_api import StatisticsApi # import ApiClient +from bandwidth.api_response import ApiResponse from bandwidth.api_client import ApiClient - -# import Configuration from bandwidth.configuration import Configuration - -# import exceptions from bandwidth.exceptions import OpenApiException -from bandwidth.exceptions import ApiAttributeError from bandwidth.exceptions import ApiTypeError from bandwidth.exceptions import ApiValueError from bandwidth.exceptions import ApiKeyError +from bandwidth.exceptions import ApiAttributeError from bandwidth.exceptions import ApiException + +# import models into sdk package +from bandwidth.models.account_statistics import AccountStatistics +from bandwidth.models.answer_callback import AnswerCallback +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.conference import Conference +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback +from bandwidth.models.conference_member import ConferenceMember +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback +from bandwidth.models.conference_state_enum import ConferenceStateEnum +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.create_message_request_error import CreateMessageRequestError +from bandwidth.models.deferred_result import DeferredResult +from bandwidth.models.disconnect_callback import DisconnectCallback +from bandwidth.models.diversion import Diversion +from bandwidth.models.dtmf_callback import DtmfCallback +from bandwidth.models.field_error import FieldError +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.gather_callback import GatherCallback +from bandwidth.models.inbound_message_callback import InboundMessageCallback +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage +from bandwidth.models.initiate_callback import InitiateCallback +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.list_message_item import ListMessageItem +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.models.lookup_result import LookupResult +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.models.lookup_status_enum import LookupStatusEnum +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum +from bandwidth.models.machine_detection_result import MachineDetectionResult +from bandwidth.models.media import Media +from bandwidth.models.message import Message +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.message_failed_callback import MessageFailedCallback +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage +from bandwidth.models.message_request import MessageRequest +from bandwidth.models.message_sending_callback import MessageSendingCallback +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.messages_list import MessagesList +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.models.messaging_request_error import MessagingRequestError +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError +from bandwidth.models.mfa_request_error import MfaRequestError +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError +from bandwidth.models.page_info import PageInfo +from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.recording_available_callback import RecordingAvailableCallback +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback +from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.redirect_callback import RedirectCallback +from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.stir_shaken import StirShaken +from bandwidth.models.tag import Tag +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError +from bandwidth.models.transcribe_recording import TranscribeRecording +from bandwidth.models.transcription import Transcription +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback +from bandwidth.models.transcription_list import TranscriptionList +from bandwidth.models.transcription_metadata import TranscriptionMetadata +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback +from bandwidth.models.update_call import UpdateCall +from bandwidth.models.update_call_recording import UpdateCallRecording +from bandwidth.models.update_conference import UpdateConference +from bandwidth.models.update_conference_member import UpdateConferenceMember +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse +from bandwidth.models.voice_api_error import VoiceApiError +from bandwidth.models.voice_code_response import VoiceCodeResponse diff --git a/bandwidth/api/__init__.py b/bandwidth/api/__init__.py index 5c8b579b..1af480a8 100644 --- a/bandwidth/api/__init__.py +++ b/bandwidth/api/__init__.py @@ -1,3 +1,12 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from bandwidth.apis import CallsApi +# flake8: noqa + +# import apis into api package +from bandwidth.api.calls_api import CallsApi +from bandwidth.api.conferences_api import ConferencesApi +from bandwidth.api.mfa_api import MFAApi +from bandwidth.api.media_api import MediaApi +from bandwidth.api.messages_api import MessagesApi +from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi +from bandwidth.api.recordings_api import RecordingsApi +from bandwidth.api.statistics_api import StatisticsApi + diff --git a/bandwidth/api/calls_api.py b/bandwidth/api/calls_api.py index c866db85..96e7569f 100644 --- a/bandwidth/api/calls_api.py +++ b/bandwidth/api/calls_api.py @@ -1,32 +1,38 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from bandwidth.models.call_state import CallState +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.update_call import UpdateCall + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.call_state import CallState -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.voice_api_error import VoiceApiError class CallsApi(object): @@ -38,278 +44,11 @@ class CallsApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_call_endpoint = _Endpoint( - settings={ - 'response_type': (CreateCallResponse,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls', - 'operation_id': 'create_call', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'create_call', - ], - 'required': [ - 'account_id', - 'create_call', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'create_call': - (CreateCall,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'create_call': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.get_call_state_endpoint = _Endpoint( - settings={ - 'response_type': (CallState,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}', - 'operation_id': 'get_call_state', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - ], - 'required': [ - 'account_id', - 'call_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_call_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}', - 'operation_id': 'update_call', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'update_call', - ], - 'required': [ - 'account_id', - 'call_id', - 'update_call', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'update_call': - (UpdateCall,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'update_call': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.update_call_bxml_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/bxml', - 'operation_id': 'update_call_bxml', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'body', - ], - 'required': [ - 'account_id', - 'call_id', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'body': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/xml' - ] - }, - api_client=api_client - ) - def create_call( - self, - account_id, - create_call, - **kwargs - ): + @validate_arguments + def create_call(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], create_call : Annotated[CreateCall, Field(..., description="JSON object containing information to create an outbound call")], **kwargs) -> CreateCallResponse: # noqa: E501 """Create Call # noqa: E501 Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. # noqa: E501 @@ -319,84 +58,172 @@ def create_call( >>> thread = api.create_call(account_id, create_call, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - create_call (CreateCall): JSON object containing information to create an outbound call - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateCallResponse - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param create_call: JSON object containing information to create an outbound call (required) + :type create_call: CreateCall + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CreateCallResponse """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['create_call'] = \ - create_call - return self.create_call_endpoint.call_with_http_info(**kwargs) - - def get_call_state( - self, - account_id, - call_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_call_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_call_with_http_info(account_id, create_call, **kwargs) # noqa: E501 + + @validate_arguments + def create_call_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], create_call : Annotated[CreateCall, Field(..., description="JSON object containing information to create an outbound call")], **kwargs) -> ApiResponse: # noqa: E501 + """Create Call # noqa: E501 + + Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_call_with_http_info(account_id, create_call, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param create_call: JSON object containing information to create an outbound call (required) + :type create_call: CreateCall + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CreateCallResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'create_call' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_call" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['create_call'] is not None: + _body_params = _params['create_call'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '201': "CreateCallResponse", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_call_state(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> CallState: # noqa: E501 """Get Call State Information # noqa: E501 Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response. # noqa: E501 @@ -406,85 +233,165 @@ def get_call_state( >>> thread = api.get_call_state(account_id, call_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CallState - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CallState """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - return self.get_call_state_endpoint.call_with_http_info(**kwargs) - - def update_call( - self, - account_id, - call_id, - update_call, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_call_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_call_state_with_http_info(account_id, call_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_call_state_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Call State Information # noqa: E501 + + Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_call_state_with_http_info(account_id, call_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CallState, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_call_state" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "CallState", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_call(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call : Annotated[UpdateCall, Field(..., description="JSON object containing information to redirect an existing call to a new BXML document")], **kwargs) -> None: # noqa: E501 """Update Call # noqa: E501 Interrupts and redirects a call to a different URL that should return a BXML document. # noqa: E501 @@ -494,88 +401,170 @@ def update_call( >>> thread = api.update_call(account_id, call_id, update_call, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - update_call (UpdateCall): JSON object containing information to redirect an existing call to a new BXML document - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param update_call: JSON object containing information to redirect an existing call to a new BXML document (required) + :type update_call: UpdateCall + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['update_call'] = \ - update_call - return self.update_call_endpoint.call_with_http_info(**kwargs) - - def update_call_bxml( - self, - account_id, - call_id, - body, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_call_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_call_with_http_info(account_id, call_id, update_call, **kwargs) # noqa: E501 + + @validate_arguments + def update_call_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call : Annotated[UpdateCall, Field(..., description="JSON object containing information to redirect an existing call to a new BXML document")], **kwargs) -> ApiResponse: # noqa: E501 + """Update Call # noqa: E501 + + Interrupts and redirects a call to a different URL that should return a BXML document. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_call_with_http_info(account_id, call_id, update_call, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param update_call: JSON object containing information to redirect an existing call to a new BXML document (required) + :type update_call: UpdateCall + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'update_call' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_call" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['update_call'] is not None: + _body_params = _params['update_call'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_call_bxml(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], body : StrictStr, **kwargs) -> None: # noqa: E501 """Update Call BXML # noqa: E501 Interrupts and replaces an active call's BXML document. # noqa: E501 @@ -585,78 +574,164 @@ def update_call_bxml( >>> thread = api.update_call_bxml(account_id, call_id, body, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - body (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param body: (required) + :type body: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_call_bxml_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_call_bxml_with_http_info(account_id, call_id, body, **kwargs) # noqa: E501 + + @validate_arguments + def update_call_bxml_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], body : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 + """Update Call BXML # noqa: E501 + + Interrupts and replaces an active call's BXML document. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_call_bxml_with_http_info(account_id, call_id, body, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param body: (required) + :type body: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['body'] = \ - body - return self.update_call_bxml_endpoint.call_with_http_info(**kwargs) + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_call_bxml" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body'] is not None: + _body_params = _params['body'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/xml'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/bxml', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/conferences_api.py b/bandwidth/api/conferences_api.py index f31c395e..bfa60933 100644 --- a/bandwidth/api/conferences_api.py +++ b/bandwidth/api/conferences_api.py @@ -1,33 +1,41 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, conint + +from typing import List, Optional, Union + +from bandwidth.models.conference import Conference +from bandwidth.models.conference_member import ConferenceMember +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.models.update_conference import UpdateConference +from bandwidth.models.update_conference_member import UpdateConferenceMember + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.conference import Conference -from bandwidth.model.conference_member import ConferenceMember -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata -from bandwidth.model.update_conference import UpdateConference -from bandwidth.model.update_conference_member import UpdateConferenceMember -from bandwidth.model.voice_api_error import VoiceApiError class ConferencesApi(object): @@ -39,646 +47,11 @@ class ConferencesApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.download_conference_recording_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media', - 'operation_id': 'download_conference_recording', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'conference_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'audio/vnd.wave', - 'audio/mpeg', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_conference_endpoint = _Endpoint( - settings={ - 'response_type': (Conference,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}', - 'operation_id': 'get_conference', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - ], - 'required': [ - 'account_id', - 'conference_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_conference_member_endpoint = _Endpoint( - settings={ - 'response_type': (ConferenceMember,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', - 'operation_id': 'get_conference_member', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'member_id', - ], - 'required': [ - 'account_id', - 'conference_id', - 'member_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'member_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - 'member_id': 'memberId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'member_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_conference_recording_endpoint = _Endpoint( - settings={ - 'response_type': (ConferenceRecordingMetadata,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}', - 'operation_id': 'get_conference_recording', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'conference_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_conference_recordings_endpoint = _Endpoint( - settings={ - 'response_type': ([ConferenceRecordingMetadata],), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/recordings', - 'operation_id': 'list_conference_recordings', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - ], - 'required': [ - 'account_id', - 'conference_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_conferences_endpoint = _Endpoint( - settings={ - 'response_type': ([Conference],), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences', - 'operation_id': 'list_conferences', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'name', - 'min_created_time', - 'max_created_time', - 'page_size', - 'page_token', - ], - 'required': [ - 'account_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'name': - (str,), - 'min_created_time': - (str,), - 'max_created_time': - (str,), - 'page_size': - (int,), - 'page_token': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'name': 'name', - 'min_created_time': 'minCreatedTime', - 'max_created_time': 'maxCreatedTime', - 'page_size': 'pageSize', - 'page_token': 'pageToken', - }, - 'location_map': { - 'account_id': 'path', - 'name': 'query', - 'min_created_time': 'query', - 'max_created_time': 'query', - 'page_size': 'query', - 'page_token': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_conference_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}', - 'operation_id': 'update_conference', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'update_conference', - ], - 'required': [ - 'account_id', - 'conference_id', - 'update_conference', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'update_conference': - (UpdateConference,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'update_conference': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.update_conference_bxml_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/bxml', - 'operation_id': 'update_conference_bxml', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'body', - ], - 'required': [ - 'account_id', - 'conference_id', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'body': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/xml' - ] - }, - api_client=api_client - ) - self.update_conference_member_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', - 'operation_id': 'update_conference_member', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'conference_id', - 'member_id', - 'update_conference_member', - ], - 'required': [ - 'account_id', - 'conference_id', - 'member_id', - 'update_conference_member', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'conference_id': - (str,), - 'member_id': - (str,), - 'update_conference_member': - (UpdateConferenceMember,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'conference_id': 'conferenceId', - 'member_id': 'memberId', - }, - 'location_map': { - 'account_id': 'path', - 'conference_id': 'path', - 'member_id': 'path', - 'update_conference_member': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - def download_conference_recording( - self, - account_id, - conference_id, - recording_id, - **kwargs - ): + @validate_arguments + def download_conference_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> bytearray: # noqa: E501 """Download Conference Recording # noqa: E501 Downloads the specified recording file. # noqa: E501 @@ -688,87 +61,173 @@ def download_conference_recording( >>> thread = api.download_conference_recording(account_id, conference_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: bytearray """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['recording_id'] = \ - recording_id - return self.download_conference_recording_endpoint.call_with_http_info(**kwargs) - - def get_conference( - self, - account_id, - conference_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the download_conference_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.download_conference_recording_with_http_info(account_id, conference_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def download_conference_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Download Conference Recording # noqa: E501 + + Downloads the specified recording file. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.download_conference_recording_with_http_info(account_id, conference_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method download_conference_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['audio/vnd.wave', 'audio/mpeg', 'application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "bytearray", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_conference(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> Conference: # noqa: E501 """Get Conference Information # noqa: E501 Returns information about the specified conference. # noqa: E501 @@ -778,85 +237,165 @@ def get_conference( >>> thread = api.get_conference(account_id, conference_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Conference - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Conference """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - return self.get_conference_endpoint.call_with_http_info(**kwargs) - - def get_conference_member( - self, - account_id, - conference_id, - member_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_conference_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_conference_with_http_info(account_id, conference_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_conference_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Conference Information # noqa: E501 + + Returns information about the specified conference. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_conference_with_http_info(account_id, conference_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Conference, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_conference" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "Conference", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_conference_member(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], **kwargs) -> ConferenceMember: # noqa: E501 """Get Conference Member # noqa: E501 Returns information about the specified conference member. # noqa: E501 @@ -866,88 +405,173 @@ def get_conference_member( >>> thread = api.get_conference_member(account_id, conference_id, member_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - member_id (str): Programmable Voice API Conference Member ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ConferenceMember - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param member_id: Programmable Voice API Conference Member ID. (required) + :type member_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ConferenceMember """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['member_id'] = \ - member_id - return self.get_conference_member_endpoint.call_with_http_info(**kwargs) - - def get_conference_recording( - self, - account_id, - conference_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_conference_member_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_conference_member_with_http_info(account_id, conference_id, member_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_conference_member_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Conference Member # noqa: E501 + + Returns information about the specified conference member. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_conference_member_with_http_info(account_id, conference_id, member_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param member_id: Programmable Voice API Conference Member ID. (required) + :type member_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ConferenceMember, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'member_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_conference_member" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + if _params['member_id']: + _path_params['memberId'] = _params['member_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "ConferenceMember", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_conference_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ConferenceRecordingMetadata: # noqa: E501 """Get Conference Recording Information # noqa: E501 Returns metadata for the specified recording. # noqa: E501 @@ -957,87 +581,173 @@ def get_conference_recording( >>> thread = api.get_conference_recording(account_id, conference_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ConferenceRecordingMetadata - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ConferenceRecordingMetadata """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['recording_id'] = \ - recording_id - return self.get_conference_recording_endpoint.call_with_http_info(**kwargs) - - def list_conference_recordings( - self, - account_id, - conference_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_conference_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_conference_recording_with_http_info(account_id, conference_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_conference_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Conference Recording Information # noqa: E501 + + Returns metadata for the specified recording. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_conference_recording_with_http_info(account_id, conference_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ConferenceRecordingMetadata, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_conference_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "ConferenceRecordingMetadata", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_conference_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> List[ConferenceRecordingMetadata]: # noqa: E501 """Get Conference Recordings # noqa: E501 Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. # noqa: E501 @@ -1047,173 +757,365 @@ def list_conference_recordings( >>> thread = api.list_conference_recordings(account_id, conference_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [ConferenceRecordingMetadata] - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[ConferenceRecordingMetadata] """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - return self.list_conference_recordings_endpoint.call_with_http_info(**kwargs) - - def list_conferences( - self, - account_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_conference_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_conference_recordings_with_http_info(account_id, conference_id, **kwargs) # noqa: E501 + + @validate_arguments + def list_conference_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Conference Recordings # noqa: E501 + + Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_conference_recordings_with_http_info(account_id, conference_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[ConferenceRecordingMetadata], status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_conference_recordings" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "List[ConferenceRecordingMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/recordings', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_conferences(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], name : Annotated[Optional[StrictStr], Field(description="Filter results by the `name` field.")] = None, min_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).")] = None, max_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).")] = None, page_size : Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description="Specifies the max number of conferences that will be returned.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, **kwargs) -> List[Conference]: # noqa: E501 """Get Conferences # noqa: E501 Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of conference records. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_conferences(account_id, async_req=True) + >>> thread = api.list_conferences(account_id, name, min_created_time, max_created_time, page_size, page_token, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - - Keyword Args: - name (str): Filter results by the `name` field.. [optional] - min_created_time (str): Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).. [optional] - max_created_time (str): Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).. [optional] - page_size (int): Specifies the max number of conferences that will be returned.. [optional] if omitted the server will use the default value of 1000 - page_token (str): Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Conference] - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param name: Filter results by the `name` field. + :type name: str + :param min_created_time: Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + :type min_created_time: str + :param max_created_time: Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + :type max_created_time: str + :param page_size: Specifies the max number of conferences that will be returned. + :type page_size: int + :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + :type page_token: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[Conference] """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - return self.list_conferences_endpoint.call_with_http_info(**kwargs) - - def update_conference( - self, - account_id, - conference_id, - update_conference, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_conferences_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_conferences_with_http_info(account_id, name, min_created_time, max_created_time, page_size, page_token, **kwargs) # noqa: E501 + + @validate_arguments + def list_conferences_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], name : Annotated[Optional[StrictStr], Field(description="Filter results by the `name` field.")] = None, min_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).")] = None, max_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).")] = None, page_size : Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description="Specifies the max number of conferences that will be returned.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Get Conferences # noqa: E501 + + Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of conference records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_conferences_with_http_info(account_id, name, min_created_time, max_created_time, page_size, page_token, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param name: Filter results by the `name` field. + :type name: str + :param min_created_time: Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + :type min_created_time: str + :param max_created_time: Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + :type max_created_time: str + :param page_size: Specifies the max number of conferences that will be returned. + :type page_size: int + :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + :type page_token: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[Conference], status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'name', + 'min_created_time', + 'max_created_time', + 'page_size', + 'page_token' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_conferences" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + if _params.get('name') is not None: # noqa: E501 + _query_params.append(('name', _params['name'])) + + if _params.get('min_created_time') is not None: # noqa: E501 + _query_params.append(('minCreatedTime', _params['min_created_time'])) + + if _params.get('max_created_time') is not None: # noqa: E501 + _query_params.append(('maxCreatedTime', _params['max_created_time'])) + + if _params.get('page_size') is not None: # noqa: E501 + _query_params.append(('pageSize', _params['page_size'])) + + if _params.get('page_token') is not None: # noqa: E501 + _query_params.append(('pageToken', _params['page_token'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "List[Conference]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/conferences', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_conference(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], update_conference : UpdateConference, **kwargs) -> None: # noqa: E501 """Update Conference # noqa: E501 Update the conference state. # noqa: E501 @@ -1223,88 +1125,170 @@ def update_conference( >>> thread = api.update_conference(account_id, conference_id, update_conference, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - update_conference (UpdateConference): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param update_conference: (required) + :type update_conference: UpdateConference + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['update_conference'] = \ - update_conference - return self.update_conference_endpoint.call_with_http_info(**kwargs) - - def update_conference_bxml( - self, - account_id, - conference_id, - body, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_conference_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_conference_with_http_info(account_id, conference_id, update_conference, **kwargs) # noqa: E501 + + @validate_arguments + def update_conference_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], update_conference : UpdateConference, **kwargs) -> ApiResponse: # noqa: E501 + """Update Conference # noqa: E501 + + Update the conference state. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_conference_with_http_info(account_id, conference_id, update_conference, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param update_conference: (required) + :type update_conference: UpdateConference + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'update_conference' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_conference" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['update_conference'] is not None: + _body_params = _params['update_conference'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_conference_bxml(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], body : StrictStr, **kwargs) -> None: # noqa: E501 """Update Conference BXML # noqa: E501 Update the conference BXML document. # noqa: E501 @@ -1314,89 +1298,170 @@ def update_conference_bxml( >>> thread = api.update_conference_bxml(account_id, conference_id, body, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - body (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param body: (required) + :type body: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['body'] = \ - body - return self.update_conference_bxml_endpoint.call_with_http_info(**kwargs) - - def update_conference_member( - self, - account_id, - conference_id, - member_id, - update_conference_member, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_conference_bxml_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_conference_bxml_with_http_info(account_id, conference_id, body, **kwargs) # noqa: E501 + + @validate_arguments + def update_conference_bxml_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], body : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 + """Update Conference BXML # noqa: E501 + + Update the conference BXML document. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_conference_bxml_with_http_info(account_id, conference_id, body, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param body: (required) + :type body: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_conference_bxml" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body'] is not None: + _body_params = _params['body'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/xml'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/bxml', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_conference_member(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], update_conference_member : UpdateConferenceMember, **kwargs) -> None: # noqa: E501 """Update Conference Member # noqa: E501 Updates settings for a particular conference member. # noqa: E501 @@ -1406,81 +1471,172 @@ def update_conference_member( >>> thread = api.update_conference_member(account_id, conference_id, member_id, update_conference_member, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - conference_id (str): Programmable Voice API Conference ID - member_id (str): Programmable Voice API Conference Member ID - update_conference_member (UpdateConferenceMember): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param member_id: Programmable Voice API Conference Member ID. (required) + :type member_id: str + :param update_conference_member: (required) + :type update_conference_member: UpdateConferenceMember + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_conference_member_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, **kwargs) # noqa: E501 + + @validate_arguments + def update_conference_member_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], update_conference_member : UpdateConferenceMember, **kwargs) -> ApiResponse: # noqa: E501 + """Update Conference Member # noqa: E501 + + Updates settings for a particular conference member. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param conference_id: Programmable Voice API Conference ID. (required) + :type conference_id: str + :param member_id: Programmable Voice API Conference Member ID. (required) + :type member_id: str + :param update_conference_member: (required) + :type update_conference_member: UpdateConferenceMember + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['conference_id'] = \ - conference_id - kwargs['member_id'] = \ - member_id - kwargs['update_conference_member'] = \ - update_conference_member - return self.update_conference_member_endpoint.call_with_http_info(**kwargs) + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'conference_id', + 'member_id', + 'update_conference_member' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_conference_member" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['conference_id']: + _path_params['conferenceId'] = _params['conference_id'] + + if _params['member_id']: + _path_params['memberId'] = _params['member_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['update_conference_member'] is not None: + _body_params = _params['update_conference_member'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/media_api.py b/bandwidth/api/media_api.py index 85ba61ac..feb05fe2 100644 --- a/bandwidth/api/media_api.py +++ b/bandwidth/api/media_api.py @@ -1,29 +1,37 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictStr + +from typing import List, Optional, Union + +from bandwidth.models.media import Media + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.media import Media -from bandwidth.model.messaging_request_error import MessagingRequestError class MediaApi(object): @@ -35,323 +43,11 @@ class MediaApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.delete_media_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/media/{mediaId}', - 'operation_id': 'delete_media', - 'http_method': 'DELETE', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'media_id', - ], - 'required': [ - 'account_id', - 'media_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'media_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'media_id': 'mediaId', - }, - 'location_map': { - 'account_id': 'path', - 'media_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_media_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/media/{mediaId}', - 'operation_id': 'get_media', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'media_id', - ], - 'required': [ - 'account_id', - 'media_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'media_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'media_id': 'mediaId', - }, - 'location_map': { - 'account_id': 'path', - 'media_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/octet-stream', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_media_endpoint = _Endpoint( - settings={ - 'response_type': ([Media],), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/media', - 'operation_id': 'list_media', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'continuation_token', - ], - 'required': [ - 'account_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'continuation_token': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'continuation_token': 'Continuation-Token', - }, - 'location_map': { - 'account_id': 'path', - 'continuation_token': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.upload_media_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/media/{mediaId}', - 'operation_id': 'upload_media', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'media_id', - 'body', - 'content_type', - 'cache_control', - ], - 'required': [ - 'account_id', - 'media_id', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'media_id': - (str,), - 'body': - (file_type,), - 'content_type': - (str,), - 'cache_control': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'media_id': 'mediaId', - 'content_type': 'Content-Type', - 'cache_control': 'Cache-Control', - }, - 'location_map': { - 'account_id': 'path', - 'media_id': 'path', - 'body': 'body', - 'content_type': 'header', - 'cache_control': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'application/ogg', - 'application/pdf', - 'application/rtf', - 'application/zip', - 'application/x-tar', - 'application/xml', - 'application/gzip', - 'application/x-bzip2', - 'application/x-gzip', - 'application/smil', - 'application/javascript', - 'audio/mp4', - 'audio/mpeg', - 'audio/ogg', - 'audio/flac', - 'audio/webm', - 'audio/wav', - 'audio/amr', - 'audio/3gpp', - 'image/bmp', - 'image/gif', - 'image/jpeg', - 'image/pjpeg', - 'image/png', - 'image/svg+xml', - 'image/tiff', - 'image/webp', - 'image/x-icon', - 'text/css', - 'text/csv', - 'text/calendar', - 'text/plain', - 'text/javascript', - 'text/vcard', - 'text/vnd.wap.wml', - 'text/xml', - 'video/avi', - 'video/mp4', - 'video/mpeg', - 'video/ogg', - 'video/quicktime', - 'video/webm', - 'video/x-ms-wmv' - ] - }, - api_client=api_client - ) - def delete_media( - self, - account_id, - media_id, - **kwargs - ): + @validate_arguments + def delete_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> None: # noqa: E501 """Delete Media # noqa: E501 Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. # noqa: E501 @@ -361,84 +57,155 @@ def delete_media( >>> thread = api.delete_media(account_id, media_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - media_id (str): Media ID to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['media_id'] = \ - media_id - return self.delete_media_endpoint.call_with_http_info(**kwargs) - - def get_media( - self, - account_id, - media_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_media_with_http_info(account_id, media_id, **kwargs) # noqa: E501 + + @validate_arguments + def delete_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> ApiResponse: # noqa: E501 + """Delete Media # noqa: E501 + + Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_media_with_http_info(account_id, media_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'media_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_media" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['media_id']: + _path_params['mediaId'] = _params['media_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/users/{accountId}/media/{mediaId}', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> bytearray: # noqa: E501 """Get Media # noqa: E501 Downloads a media file you previously uploaded. # noqa: E501 @@ -448,252 +215,521 @@ def get_media( >>> thread = api.get_media(account_id, media_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - media_id (str): Media ID to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: bytearray """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['media_id'] = \ - media_id - return self.get_media_endpoint.call_with_http_info(**kwargs) - - def list_media( - self, - account_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_media_with_http_info(account_id, media_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Media # noqa: E501 + + Downloads a media file you previously uploaded. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_media_with_http_info(account_id, media_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'media_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_media" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['media_id']: + _path_params['mediaId'] = _params['media_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/octet-stream', 'application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "bytearray", + '400': "MessagingRequestError", + '401': "MessagingRequestError", + '403': "MessagingRequestError", + '404': "MessagingRequestError", + '406': "MessagingRequestError", + '415': "MessagingRequestError", + '429': "MessagingRequestError", + '500': "MessagingRequestError", + } + + return self.api_client.call_api( + '/users/{accountId}/media/{mediaId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], continuation_token : Annotated[Optional[StrictStr], Field(description="Continuation token used to retrieve subsequent media.")] = None, **kwargs) -> List[Media]: # noqa: E501 """List Media # noqa: E501 Gets a list of your media files. No query parameters are supported. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_media(account_id, async_req=True) + >>> thread = api.list_media(account_id, continuation_token, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - - Keyword Args: - continuation_token (str): Continuation token used to retrieve subsequent media.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [Media] - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param continuation_token: Continuation token used to retrieve subsequent media. + :type continuation_token: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[Media] """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - return self.list_media_endpoint.call_with_http_info(**kwargs) - - def upload_media( - self, - account_id, - media_id, - body, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_media_with_http_info(account_id, continuation_token, **kwargs) # noqa: E501 + + @validate_arguments + def list_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], continuation_token : Annotated[Optional[StrictStr], Field(description="Continuation token used to retrieve subsequent media.")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """List Media # noqa: E501 + + Gets a list of your media files. No query parameters are supported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_media_with_http_info(account_id, continuation_token, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param continuation_token: Continuation token used to retrieve subsequent media. + :type continuation_token: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[Media], status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'continuation_token' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_media" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + if _params['continuation_token']: + _header_params['Continuation-Token'] = _params['continuation_token'] + + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "List[Media]", + '400': "MessagingRequestError", + '401': "MessagingRequestError", + '403': "MessagingRequestError", + '404': "MessagingRequestError", + '406': "MessagingRequestError", + '415': "MessagingRequestError", + '429': "MessagingRequestError", + '500': "MessagingRequestError", + } + + return self.api_client.call_api( + '/users/{accountId}/media', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def upload_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], body : Union[StrictBytes, StrictStr], content_type : Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, cache_control : Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, **kwargs) -> None: # noqa: E501 """Upload Media # noqa: E501 - Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # noqa: E501 + Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_media(account_id, media_id, body, async_req=True) + >>> thread = api.upload_media(account_id, media_id, body, content_type, cache_control, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - media_id (str): Media ID to retrieve. - body (file_type): - - Keyword Args: - content_type (str): The media type of the entity-body.. [optional] - cache_control (str): General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param body: (required) + :type body: bytearray + :param content_type: The media type of the entity-body. + :type content_type: str + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :type cache_control: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the upload_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.upload_media_with_http_info(account_id, media_id, body, content_type, cache_control, **kwargs) # noqa: E501 + + @validate_arguments + def upload_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], body : Union[StrictBytes, StrictStr], content_type : Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, cache_control : Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Upload Media # noqa: E501 + + Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_media_with_http_info(account_id, media_id, body, content_type, cache_control, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param media_id: Media ID to retrieve. (required) + :type media_id: str + :param body: (required) + :type body: bytearray + :param content_type: The media type of the entity-body. + :type content_type: str + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :type cache_control: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['media_id'] = \ - media_id - kwargs['body'] = \ - body - return self.upload_media_endpoint.call_with_http_info(**kwargs) + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'media_id', + 'body', + 'content_type', + 'cache_control' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_media" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['media_id']: + _path_params['mediaId'] = _params['media_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + if _params['content_type']: + _header_params['Content-Type'] = _params['content_type'] + + if _params['cache_control']: + _header_params['Cache-Control'] = _params['cache_control'] + + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body'] is not None: + _body_params = _params['body'] + # convert to byte array if the input is a file name (str) + if isinstance(_body_params, str): + with io.open(_body_params, "rb") as _fp: + _body_params_from_file = _fp.read() + _body_params = _body_params_from_file + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/users/{accountId}/media/{mediaId}', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py index 2de159e4..10a99b55 100644 --- a/bandwidth/api/messages_api.py +++ b/bandwidth/api/messages_api.py @@ -1,35 +1,42 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr + +from typing import Optional + +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.message import Message +from bandwidth.models.message_request import MessageRequest +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.messages_list import MessagesList + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.create_message_request_error import CreateMessageRequestError -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum -from bandwidth.model.message import Message -from bandwidth.model.message_request import MessageRequest -from bandwidth.model.message_status_enum import MessageStatusEnum -from bandwidth.model.message_type_enum import MessageTypeEnum -from bandwidth.model.messages_list import MessagesList -from bandwidth.model.messaging_request_error import MessagingRequestError class MessagesApi(object): @@ -41,199 +48,11 @@ class MessagesApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_message_endpoint = _Endpoint( - settings={ - 'response_type': (Message,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/messages', - 'operation_id': 'create_message', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'message_request', - ], - 'required': [ - 'account_id', - 'message_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'message_request': - (MessageRequest,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'message_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.list_messages_endpoint = _Endpoint( - settings={ - 'response_type': (MessagesList,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/users/{accountId}/messages', - 'operation_id': 'list_messages', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://messaging.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'message_id', - 'source_tn', - 'destination_tn', - 'message_status', - 'message_direction', - 'carrier_name', - 'message_type', - 'error_code', - 'from_date_time', - 'to_date_time', - 'sort', - 'page_token', - 'limit', - ], - 'required': [ - 'account_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'message_id': - (str,), - 'source_tn': - (str,), - 'destination_tn': - (str,), - 'message_status': - (MessageStatusEnum,), - 'message_direction': - (ListMessageDirectionEnum,), - 'carrier_name': - (str,), - 'message_type': - (MessageTypeEnum,), - 'error_code': - (int,), - 'from_date_time': - (str,), - 'to_date_time': - (str,), - 'sort': - (str,), - 'page_token': - (str,), - 'limit': - (int,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'message_id': 'messageId', - 'source_tn': 'sourceTn', - 'destination_tn': 'destinationTn', - 'message_status': 'messageStatus', - 'message_direction': 'messageDirection', - 'carrier_name': 'carrierName', - 'message_type': 'messageType', - 'error_code': 'errorCode', - 'from_date_time': 'fromDateTime', - 'to_date_time': 'toDateTime', - 'sort': 'sort', - 'page_token': 'pageToken', - 'limit': 'limit', - }, - 'location_map': { - 'account_id': 'path', - 'message_id': 'query', - 'source_tn': 'query', - 'destination_tn': 'query', - 'message_status': 'query', - 'message_direction': 'query', - 'carrier_name': 'query', - 'message_type': 'query', - 'error_code': 'query', - 'from_date_time': 'query', - 'to_date_time': 'query', - 'sort': 'query', - 'page_token': 'query', - 'limit': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - def create_message( - self, - account_id, - message_request, - **kwargs - ): + @validate_arguments + def create_message(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_request : MessageRequest, **kwargs) -> Message: # noqa: E501 """Create Message # noqa: E501 Endpoint for sending text messages and picture messages using V2 messaging. # noqa: E501 @@ -243,171 +62,445 @@ def create_message( >>> thread = api.create_message(account_id, message_request, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - message_request (MessageRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Message - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param message_request: (required) + :type message_request: MessageRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: Message """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_message_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_message_with_http_info(account_id, message_request, **kwargs) # noqa: E501 + + @validate_arguments + def create_message_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_request : MessageRequest, **kwargs) -> ApiResponse: # noqa: E501 + """Create Message # noqa: E501 + + Endpoint for sending text messages and picture messages using V2 messaging. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_message_with_http_info(account_id, message_request, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param message_request: (required) + :type message_request: MessageRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Message, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'message_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['message_request'] = \ - message_request - return self.create_message_endpoint.call_with_http_info(**kwargs) - - def list_messages( - self, - account_id, - **kwargs - ): + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_message" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['message_request'] is not None: + _body_params = _params['message_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '202': "Message", + '400': "CreateMessageRequestError", + '401': "MessagingRequestError", + '403': "MessagingRequestError", + '404': "MessagingRequestError", + '406': "MessagingRequestError", + '415': "MessagingRequestError", + '429': "MessagingRequestError", + '500': "MessagingRequestError", + } + + return self.api_client.call_api( + '/users/{accountId}/messages', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_messages(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_id : Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, source_tn : Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, destination_tn : Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, message_status : Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction : Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, carrier_name : Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, message_type : Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code : Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, from_date_time : Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, to_date_time : Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, campaign_id : Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort : Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count : Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, **kwargs) -> MessagesList: # noqa: E501 """List Messages # noqa: E501 Returns a list of messages based on query parameters. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_messages(account_id, async_req=True) + >>> thread = api.list_messages(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID. - - Keyword Args: - message_id (str): The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.. [optional] - source_tn (str): The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').. [optional] - destination_tn (str): The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').. [optional] - message_status (MessageStatusEnum): The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.. [optional] - message_direction (ListMessageDirectionEnum): The direction of the message. One of INBOUND OUTBOUND.. [optional] - carrier_name (str): The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).. [optional] - message_type (MessageTypeEnum): The type of message. Either sms or mms.. [optional] - error_code (int): The error code of the message.. [optional] - from_date_time (str): The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.. [optional] - to_date_time (str): The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.. [optional] - sort (str): The field and direction to sort by combined with a colon. Direction is either asc or desc.. [optional] - page_token (str): A base64 encoded value used for pagination of results.. [optional] - limit (int): The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - MessagesList - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :type message_id: str + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :type source_tn: str + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :type destination_tn: str + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :type message_status: MessageStatusEnum + :param message_direction: The direction of the message. One of INBOUND OUTBOUND. + :type message_direction: ListMessageDirectionEnum + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :type carrier_name: str + :param message_type: The type of message. Either sms or mms. + :type message_type: MessageTypeEnum + :param error_code: The error code of the message. + :type error_code: int + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :type from_date_time: str + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :type to_date_time: str + :param campaign_id: The campaign ID of the message. + :type campaign_id: str + :param sort: The field and direction to sort by combined with a colon. Direction is either asc or desc. + :type sort: str + :param page_token: A base64 encoded value used for pagination of results. + :type page_token: str + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :type limit: int + :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. + :type limit_total_count: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: MessagesList """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_messages_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_messages_with_http_info(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, **kwargs) # noqa: E501 + + @validate_arguments + def list_messages_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_id : Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, source_tn : Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, destination_tn : Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, message_status : Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction : Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, carrier_name : Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, message_type : Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code : Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, from_date_time : Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, to_date_time : Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, campaign_id : Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort : Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count : Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """List Messages # noqa: E501 + + Returns a list of messages based on query parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_messages_with_http_info(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :type message_id: str + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :type source_tn: str + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :type destination_tn: str + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :type message_status: MessageStatusEnum + :param message_direction: The direction of the message. One of INBOUND OUTBOUND. + :type message_direction: ListMessageDirectionEnum + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :type carrier_name: str + :param message_type: The type of message. Either sms or mms. + :type message_type: MessageTypeEnum + :param error_code: The error code of the message. + :type error_code: int + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :type from_date_time: str + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :type to_date_time: str + :param campaign_id: The campaign ID of the message. + :type campaign_id: str + :param sort: The field and direction to sort by combined with a colon. Direction is either asc or desc. + :type sort: str + :param page_token: A base64 encoded value used for pagination of results. + :type page_token: str + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :type limit: int + :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. + :type limit_total_count: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(MessagesList, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://messaging.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'message_id', + 'source_tn', + 'destination_tn', + 'message_status', + 'message_direction', + 'carrier_name', + 'message_type', + 'error_code', + 'from_date_time', + 'to_date_time', + 'campaign_id', + 'sort', + 'page_token', + 'limit', + 'limit_total_count' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - return self.list_messages_endpoint.call_with_http_info(**kwargs) + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_messages" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + if _params.get('message_id') is not None: # noqa: E501 + _query_params.append(('messageId', _params['message_id'])) + + if _params.get('source_tn') is not None: # noqa: E501 + _query_params.append(('sourceTn', _params['source_tn'])) + + if _params.get('destination_tn') is not None: # noqa: E501 + _query_params.append(('destinationTn', _params['destination_tn'])) + + if _params.get('message_status') is not None: # noqa: E501 + _query_params.append(('messageStatus', _params['message_status'].value)) + + if _params.get('message_direction') is not None: # noqa: E501 + _query_params.append(('messageDirection', _params['message_direction'].value)) + + if _params.get('carrier_name') is not None: # noqa: E501 + _query_params.append(('carrierName', _params['carrier_name'])) + + if _params.get('message_type') is not None: # noqa: E501 + _query_params.append(('messageType', _params['message_type'].value)) + + if _params.get('error_code') is not None: # noqa: E501 + _query_params.append(('errorCode', _params['error_code'])) + + if _params.get('from_date_time') is not None: # noqa: E501 + _query_params.append(('fromDateTime', _params['from_date_time'])) + + if _params.get('to_date_time') is not None: # noqa: E501 + _query_params.append(('toDateTime', _params['to_date_time'])) + + if _params.get('campaign_id') is not None: # noqa: E501 + _query_params.append(('campaignId', _params['campaign_id'])) + + if _params.get('sort') is not None: # noqa: E501 + _query_params.append(('sort', _params['sort'])) + + if _params.get('page_token') is not None: # noqa: E501 + _query_params.append(('pageToken', _params['page_token'])) + + if _params.get('limit') is not None: # noqa: E501 + _query_params.append(('limit', _params['limit'])) + + if _params.get('limit_total_count') is not None: # noqa: E501 + _query_params.append(('limitTotalCount', _params['limit_total_count'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "MessagesList", + '400': "MessagingRequestError", + '401': "MessagingRequestError", + '403': "MessagingRequestError", + '404': "MessagingRequestError", + '415': "MessagingRequestError", + '429': "MessagingRequestError", + '500': "MessagingRequestError", + } + + return self.api_client.call_api( + '/users/{accountId}/messages', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/mfa_api.py b/bandwidth/api/mfa_api.py index b4bc1dae..b18fe2ca 100644 --- a/bandwidth/api/mfa_api.py +++ b/bandwidth/api/mfa_api.py @@ -1,35 +1,39 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse +from bandwidth.models.voice_code_response import VoiceCodeResponse + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.code_request import CodeRequest -from bandwidth.model.messaging_code_response import MessagingCodeResponse -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError -from bandwidth.model.mfa_request_error import MfaRequestError -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError -from bandwidth.model.verify_code_request import VerifyCodeRequest -from bandwidth.model.verify_code_response import VerifyCodeResponse -from bandwidth.model.voice_code_response import VoiceCodeResponse class MFAApi(object): @@ -41,204 +45,11 @@ class MFAApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.generate_messaging_code_endpoint = _Endpoint( - settings={ - 'response_type': (MessagingCodeResponse,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/code/messaging', - 'operation_id': 'generate_messaging_code', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://mfa.bandwidth.com/api/v1", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'code_request', - ], - 'required': [ - 'account_id', - 'code_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'code_request': - (CodeRequest,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'code_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.generate_voice_code_endpoint = _Endpoint( - settings={ - 'response_type': (VoiceCodeResponse,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/code/voice', - 'operation_id': 'generate_voice_code', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://mfa.bandwidth.com/api/v1", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'code_request', - ], - 'required': [ - 'account_id', - 'code_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'code_request': - (CodeRequest,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'code_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.verify_code_endpoint = _Endpoint( - settings={ - 'response_type': (VerifyCodeResponse,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/code/verify', - 'operation_id': 'verify_code', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://mfa.bandwidth.com/api/v1", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'verify_code_request', - ], - 'required': [ - 'account_id', - 'verify_code_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'verify_code_request': - (VerifyCodeRequest,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'verify_code_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - def generate_messaging_code( - self, - account_id, - code_request, - **kwargs - ): + @validate_arguments + def generate_messaging_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> MessagingCodeResponse: # noqa: E501 """Messaging Authentication Code # noqa: E501 Send an MFA code via text message (SMS). # noqa: E501 @@ -248,84 +59,168 @@ def generate_messaging_code( >>> thread = api.generate_messaging_code(account_id, code_request, async_req=True) >>> result = thread.get() - Args: - account_id (str): Bandwidth Account ID with Voice service enabled. - code_request (CodeRequest): MFA code request body. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - MessagingCodeResponse - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param code_request: MFA code request body. (required) + :type code_request: CodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: MessagingCodeResponse """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the generate_messaging_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.generate_messaging_code_with_http_info(account_id, code_request, **kwargs) # noqa: E501 + + @validate_arguments + def generate_messaging_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> ApiResponse: # noqa: E501 + """Messaging Authentication Code # noqa: E501 + + Send an MFA code via text message (SMS). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.generate_messaging_code_with_http_info(account_id, code_request, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param code_request: MFA code request body. (required) + :type code_request: CodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(MessagingCodeResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://mfa.bandwidth.com/api/v1' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'code_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['code_request'] = \ - code_request - return self.generate_messaging_code_endpoint.call_with_http_info(**kwargs) - - def generate_voice_code( - self, - account_id, - code_request, - **kwargs - ): + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method generate_messaging_code" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['code_request'] is not None: + _body_params = _params['code_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "MessagingCodeResponse", + '400': "MfaRequestError", + '401': "MfaUnauthorizedRequestError", + '403': "MfaForbiddenRequestError", + '500': "MfaRequestError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/code/messaging', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def generate_voice_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> VoiceCodeResponse: # noqa: E501 """Voice Authentication Code # noqa: E501 Send an MFA Code via a phone call. # noqa: E501 @@ -335,84 +230,168 @@ def generate_voice_code( >>> thread = api.generate_voice_code(account_id, code_request, async_req=True) >>> result = thread.get() - Args: - account_id (str): Bandwidth Account ID with Voice service enabled. - code_request (CodeRequest): MFA code request body. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - VoiceCodeResponse - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param code_request: MFA code request body. (required) + :type code_request: CodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: VoiceCodeResponse """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the generate_voice_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.generate_voice_code_with_http_info(account_id, code_request, **kwargs) # noqa: E501 + + @validate_arguments + def generate_voice_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> ApiResponse: # noqa: E501 + """Voice Authentication Code # noqa: E501 + + Send an MFA Code via a phone call. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.generate_voice_code_with_http_info(account_id, code_request, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param code_request: MFA code request body. (required) + :type code_request: CodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VoiceCodeResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://mfa.bandwidth.com/api/v1' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'code_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['code_request'] = \ - code_request - return self.generate_voice_code_endpoint.call_with_http_info(**kwargs) - - def verify_code( - self, - account_id, - verify_code_request, - **kwargs - ): + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method generate_voice_code" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['code_request'] is not None: + _body_params = _params['code_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "VoiceCodeResponse", + '400': "MfaRequestError", + '401': "MfaUnauthorizedRequestError", + '403': "MfaForbiddenRequestError", + '500': "MfaRequestError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/code/voice', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def verify_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], verify_code_request : Annotated[VerifyCodeRequest, Field(..., description="MFA code verify request body.")], **kwargs) -> VerifyCodeResponse: # noqa: E501 """Verify Authentication Code # noqa: E501 Verify a previously sent MFA code. # noqa: E501 @@ -422,75 +401,163 @@ def verify_code( >>> thread = api.verify_code(account_id, verify_code_request, async_req=True) >>> result = thread.get() - Args: - account_id (str): Bandwidth Account ID with Voice service enabled. - verify_code_request (VerifyCodeRequest): MFA code verify request body. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - VerifyCodeResponse - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param verify_code_request: MFA code verify request body. (required) + :type verify_code_request: VerifyCodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: VerifyCodeResponse """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the verify_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.verify_code_with_http_info(account_id, verify_code_request, **kwargs) # noqa: E501 + + @validate_arguments + def verify_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], verify_code_request : Annotated[VerifyCodeRequest, Field(..., description="MFA code verify request body.")], **kwargs) -> ApiResponse: # noqa: E501 + """Verify Authentication Code # noqa: E501 + + Verify a previously sent MFA code. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.verify_code_with_http_info(account_id, verify_code_request, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param verify_code_request: MFA code verify request body. (required) + :type verify_code_request: VerifyCodeRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VerifyCodeResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://mfa.bandwidth.com/api/v1' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'verify_code_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['verify_code_request'] = \ - verify_code_request - return self.verify_code_endpoint.call_with_http_info(**kwargs) + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method verify_code" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['verify_code_request'] is not None: + _body_params = _params['verify_code_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "VerifyCodeResponse", + '400': "MfaRequestError", + '401': "MfaUnauthorizedRequestError", + '403': "MfaForbiddenRequestError", + '429': "MfaRequestError", + '500': "MfaRequestError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/code/verify', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/phone_number_lookup_api.py b/bandwidth/api/phone_number_lookup_api.py index dd86fdfc..da3e3140 100644 --- a/bandwidth/api/phone_number_lookup_api.py +++ b/bandwidth/api/phone_number_lookup_api.py @@ -1,31 +1,37 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.models.lookup_status import LookupStatus + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.create_lookup_response import CreateLookupResponse -from bandwidth.model.lookup_request import LookupRequest -from bandwidth.model.lookup_status import LookupStatus -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError class PhoneNumberLookupApi(object): @@ -37,140 +43,11 @@ class PhoneNumberLookupApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_lookup_endpoint = _Endpoint( - settings={ - 'response_type': (CreateLookupResponse,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/tnlookup', - 'operation_id': 'create_lookup', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://numbers.bandwidth.com/api/v1", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'lookup_request', - ], - 'required': [ - 'account_id', - 'lookup_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'lookup_request': - (LookupRequest,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - 'lookup_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.get_lookup_status_endpoint = _Endpoint( - settings={ - 'response_type': (LookupStatus,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/tnlookup/{requestId}', - 'operation_id': 'get_lookup_status', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://numbers.bandwidth.com/api/v1", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'request_id', - ], - 'required': [ - 'account_id', - 'request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'request_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'request_id': 'requestId', - }, - 'location_map': { - 'account_id': 'path', - 'request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - def create_lookup( - self, - account_id, - lookup_request, - **kwargs - ): + @validate_arguments + def create_lookup(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], lookup_request : Annotated[LookupRequest, Field(..., description="Phone number lookup request.")], **kwargs) -> CreateLookupResponse: # noqa: E501 """Create Lookup # noqa: E501 Create a Phone Number Lookup Request. # noqa: E501 @@ -180,84 +57,170 @@ def create_lookup( >>> thread = api.create_lookup(account_id, lookup_request, async_req=True) >>> result = thread.get() - Args: - account_id (str): The ID of the Bandwidth account that the user belongs to. - lookup_request (LookupRequest): Phone number lookup request. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateLookupResponse - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param lookup_request: Phone number lookup request. (required) + :type lookup_request: LookupRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CreateLookupResponse """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the create_lookup_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.create_lookup_with_http_info(account_id, lookup_request, **kwargs) # noqa: E501 + + @validate_arguments + def create_lookup_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], lookup_request : Annotated[LookupRequest, Field(..., description="Phone number lookup request.")], **kwargs) -> ApiResponse: # noqa: E501 + """Create Lookup # noqa: E501 + + Create a Phone Number Lookup Request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_lookup_with_http_info(account_id, lookup_request, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param lookup_request: Phone number lookup request. (required) + :type lookup_request: LookupRequest + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CreateLookupResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://numbers.bandwidth.com/api/v1' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'lookup_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['lookup_request'] = \ - lookup_request - return self.create_lookup_endpoint.call_with_http_info(**kwargs) - - def get_lookup_status( - self, - account_id, - request_id, - **kwargs - ): + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_lookup" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['lookup_request'] is not None: + _body_params = _params['lookup_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '202': "CreateLookupResponse", + '400': "TnLookupRequestError", + '401': "TnLookupRequestError", + '403': "TnLookupRequestError", + '415': "TnLookupRequestError", + '429': "TnLookupRequestError", + '500': "TnLookupRequestError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/tnlookup', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_lookup_status(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], request_id : Annotated[StrictStr, Field(..., description="The phone number lookup request ID from Bandwidth.")], **kwargs) -> LookupStatus: # noqa: E501 """Get Lookup Request Status # noqa: E501 Get an existing Phone Number Lookup Request. # noqa: E501 @@ -267,75 +230,157 @@ def get_lookup_status( >>> thread = api.get_lookup_status(account_id, request_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): The ID of the Bandwidth account that the user belongs to. - request_id (str): The phone number lookup request ID from Bandwidth. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - LookupStatus - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param request_id: The phone number lookup request ID from Bandwidth. (required) + :type request_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: LookupStatus """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_lookup_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_lookup_status_with_http_info(account_id, request_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_lookup_status_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], request_id : Annotated[StrictStr, Field(..., description="The phone number lookup request ID from Bandwidth.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Lookup Request Status # noqa: E501 + + Get an existing Phone Number Lookup Request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_lookup_status_with_http_info(account_id, request_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param request_id: The phone number lookup request ID from Bandwidth. (required) + :type request_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(LookupStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://numbers.bandwidth.com/api/v1' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'request_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['request_id'] = \ - request_id - return self.get_lookup_status_endpoint.call_with_http_info(**kwargs) + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_lookup_status" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['request_id']: + _path_params['requestId'] = _params['request_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "LookupStatus", + '400': "TnLookupRequestError", + '401': "TnLookupRequestError", + '403': "TnLookupRequestError", + '404': None, + '429': "TnLookupRequestError", + '500': "TnLookupRequestError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/tnlookup/{requestId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/recordings_api.py b/bandwidth/api/recordings_api.py index b0029fe7..fadfc4ca 100644 --- a/bandwidth/api/recordings_api.py +++ b/bandwidth/api/recordings_api.py @@ -1,32 +1,40 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from typing import List, Optional, Union + +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.transcribe_recording import TranscribeRecording +from bandwidth.models.transcription_list import TranscriptionList +from bandwidth.models.update_call_recording import UpdateCallRecording + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.call_recording_metadata import CallRecordingMetadata -from bandwidth.model.transcribe_recording import TranscribeRecording -from bandwidth.model.transcription_list import TranscriptionList -from bandwidth.model.update_call_recording import UpdateCallRecording -from bandwidth.model.voice_api_error import VoiceApiError class RecordingsApi(object): @@ -38,708 +46,11 @@ class RecordingsApi(object): def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.delete_call_transcription_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', - 'operation_id': 'delete_call_transcription', - 'http_method': 'DELETE', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.delete_recording_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', - 'operation_id': 'delete_recording', - 'http_method': 'DELETE', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.delete_recording_media_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', - 'operation_id': 'delete_recording_media', - 'http_method': 'DELETE', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.download_call_recording_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', - 'operation_id': 'download_call_recording', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'audio/vnd.wave', - 'audio/mpeg', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_call_recording_endpoint = _Endpoint( - settings={ - 'response_type': (CallRecordingMetadata,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', - 'operation_id': 'get_call_recording', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_call_transcription_endpoint = _Endpoint( - settings={ - 'response_type': (TranscriptionList,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', - 'operation_id': 'get_call_transcription', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_account_call_recordings_endpoint = _Endpoint( - settings={ - 'response_type': ([CallRecordingMetadata],), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/recordings', - 'operation_id': 'list_account_call_recordings', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'to', - '_from', - 'min_start_time', - 'max_start_time', - ], - 'required': [ - 'account_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'to': - (str,), - '_from': - (str,), - 'min_start_time': - (str,), - 'max_start_time': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'to': 'to', - '_from': 'from', - 'min_start_time': 'minStartTime', - 'max_start_time': 'maxStartTime', - }, - 'location_map': { - 'account_id': 'path', - 'to': 'query', - '_from': 'query', - 'min_start_time': 'query', - 'max_start_time': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_call_recordings_endpoint = _Endpoint( - settings={ - 'response_type': ([CallRecordingMetadata],), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings', - 'operation_id': 'list_call_recordings', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - ], - 'required': [ - 'account_id', - 'call_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.transcribe_call_recording_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', - 'operation_id': 'transcribe_call_recording', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'recording_id', - 'transcribe_recording', - ], - 'required': [ - 'account_id', - 'call_id', - 'recording_id', - 'transcribe_recording', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'recording_id': - (str,), - 'transcribe_recording': - (TranscribeRecording,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - 'recording_id': 'recordingId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'recording_id': 'path', - 'transcribe_recording': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.update_call_recording_state_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/calls/{callId}/recording', - 'operation_id': 'update_call_recording_state', - 'http_method': 'PUT', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - 'call_id', - 'update_call_recording', - ], - 'required': [ - 'account_id', - 'call_id', - 'update_call_recording', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'call_id': - (str,), - 'update_call_recording': - (UpdateCallRecording,), - }, - 'attribute_map': { - 'account_id': 'accountId', - 'call_id': 'callId', - }, - 'location_map': { - 'account_id': 'path', - 'call_id': 'path', - 'update_call_recording': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - def delete_call_transcription( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + @validate_arguments + def delete_call_transcription(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501 """Delete Transcription # noqa: E501 Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. # noqa: E501 @@ -749,88 +60,163 @@ def delete_call_transcription( >>> thread = api.delete_call_transcription(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.delete_call_transcription_endpoint.call_with_http_info(**kwargs) - - def delete_recording( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_call_transcription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_call_transcription_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def delete_call_transcription_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Delete Transcription # noqa: E501 + + Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_call_transcription_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_call_transcription" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def delete_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501 """Delete Recording # noqa: E501 Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. # noqa: E501 @@ -840,88 +226,163 @@ def delete_recording( >>> thread = api.delete_recording(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.delete_recording_endpoint.call_with_http_info(**kwargs) - - def delete_recording_media( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def delete_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Delete Recording # noqa: E501 + + Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_recording_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def delete_recording_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501 """Delete Recording Media # noqa: E501 Deletes the specified recording's media. # noqa: E501 @@ -931,88 +392,163 @@ def delete_recording_media( >>> thread = api.delete_recording_media(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.delete_recording_media_endpoint.call_with_http_info(**kwargs) - - def download_call_recording( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_recording_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_recording_media_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def delete_recording_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Delete Recording Media # noqa: E501 + + Deletes the specified recording's media. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_recording_media_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_recording_media" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def download_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> bytearray: # noqa: E501 """Download Recording # noqa: E501 Downloads the specified recording. # noqa: E501 @@ -1022,88 +558,173 @@ def download_call_recording( >>> thread = api.download_call_recording(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: bytearray """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.download_call_recording_endpoint.call_with_http_info(**kwargs) - - def get_call_recording( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the download_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.download_call_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def download_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Download Recording # noqa: E501 + + Downloads the specified recording. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.download_call_recording_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method download_call_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['audio/vnd.wave', 'audio/mpeg', 'application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "bytearray", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> CallRecordingMetadata: # noqa: E501 """Get Call Recording # noqa: E501 Returns metadata for the specified recording. # noqa: E501 @@ -1113,88 +734,173 @@ def get_call_recording( >>> thread = api.get_call_recording(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CallRecordingMetadata - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CallRecordingMetadata """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.get_call_recording_endpoint.call_with_http_info(**kwargs) - - def get_call_transcription( - self, - account_id, - call_id, - recording_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_call_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Call Recording # noqa: E501 + + Returns metadata for the specified recording. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_call_recording_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CallRecordingMetadata, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_call_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "CallRecordingMetadata", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def get_call_transcription(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> TranscriptionList: # noqa: E501 """Get Transcription # noqa: E501 Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. # noqa: E501 @@ -1204,174 +910,365 @@ def get_call_transcription( >>> thread = api.get_call_transcription(account_id, call_id, recording_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - TranscriptionList - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: TranscriptionList """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - return self.get_call_transcription_endpoint.call_with_http_info(**kwargs) - - def list_account_call_recordings( - self, - account_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_call_transcription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_call_transcription_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_call_transcription_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Transcription # noqa: E501 + + Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_call_transcription_with_http_info(account_id, call_id, recording_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(TranscriptionList, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_call_transcription" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "TranscriptionList", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_account_call_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], to : Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, var_from : Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, min_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, max_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).")] = None, **kwargs) -> List[CallRecordingMetadata]: # noqa: E501 """Get Call Recordings # noqa: E501 Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_account_call_recordings(account_id, async_req=True) + >>> thread = api.list_account_call_recordings(account_id, to, var_from, min_start_time, max_start_time, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - - Keyword Args: - to (str): Filter results by the `to` field.. [optional] - _from (str): Filter results by the `from` field.. [optional] - min_start_time (str): Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).. [optional] - max_start_time (str): Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [CallRecordingMetadata] - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param to: Filter results by the `to` field. + :type to: str + :param var_from: Filter results by the `from` field. + :type var_from: str + :param min_start_time: Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + :type min_start_time: str + :param max_start_time: Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). + :type max_start_time: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[CallRecordingMetadata] """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - return self.list_account_call_recordings_endpoint.call_with_http_info(**kwargs) - - def list_call_recordings( - self, - account_id, - call_id, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_account_call_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_account_call_recordings_with_http_info(account_id, to, var_from, min_start_time, max_start_time, **kwargs) # noqa: E501 + + @validate_arguments + def list_account_call_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], to : Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, var_from : Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, min_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, max_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).")] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Get Call Recordings # noqa: E501 + + Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_account_call_recordings_with_http_info(account_id, to, var_from, min_start_time, max_start_time, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param to: Filter results by the `to` field. + :type to: str + :param var_from: Filter results by the `from` field. + :type var_from: str + :param min_start_time: Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + :type min_start_time: str + :param max_start_time: Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). + :type max_start_time: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[CallRecordingMetadata], status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'to', + 'var_from', + 'min_start_time', + 'max_start_time' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_account_call_recordings" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + if _params.get('to') is not None: # noqa: E501 + _query_params.append(('to', _params['to'])) + + if _params.get('var_from') is not None: # noqa: E501 + _query_params.append(('from', _params['var_from'])) + + if _params.get('min_start_time') is not None: # noqa: E501 + _query_params.append(('minStartTime', _params['min_start_time'])) + + if _params.get('max_start_time') is not None: # noqa: E501 + _query_params.append(('maxStartTime', _params['max_start_time'])) + + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "List[CallRecordingMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/recordings', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def list_call_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> List[CallRecordingMetadata]: # noqa: E501 """List Call Recordings # noqa: E501 Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. # noqa: E501 @@ -1381,86 +1278,165 @@ def list_call_recordings( >>> thread = api.list_call_recordings(account_id, call_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [CallRecordingMetadata] - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[CallRecordingMetadata] """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - return self.list_call_recordings_endpoint.call_with_http_info(**kwargs) - - def transcribe_call_recording( - self, - account_id, - call_id, - recording_id, - transcribe_recording, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the list_call_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.list_call_recordings_with_http_info(account_id, call_id, **kwargs) # noqa: E501 + + @validate_arguments + def list_call_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """List Call Recordings # noqa: E501 + + Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_call_recordings_with_http_info(account_id, call_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[CallRecordingMetadata], status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_call_recordings" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "List[CallRecordingMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def transcribe_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], transcribe_recording : TranscribeRecording, **kwargs) -> None: # noqa: E501 """Create Transcription Request # noqa: E501 Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. # noqa: E501 @@ -1470,91 +1446,178 @@ def transcribe_call_recording( >>> thread = api.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - recording_id (str): Programmable Voice API Recording ID - transcribe_recording (TranscribeRecording): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param transcribe_recording: (required) + :type transcribe_recording: TranscribeRecording + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['recording_id'] = \ - recording_id - kwargs['transcribe_recording'] = \ - transcribe_recording - return self.transcribe_call_recording_endpoint.call_with_http_info(**kwargs) - - def update_call_recording_state( - self, - account_id, - call_id, - update_call_recording, - **kwargs - ): + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the transcribe_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, **kwargs) # noqa: E501 + + @validate_arguments + def transcribe_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], transcribe_recording : TranscribeRecording, **kwargs) -> ApiResponse: # noqa: E501 + """Create Transcription Request # noqa: E501 + + Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param recording_id: Programmable Voice API Recording ID. (required) + :type recording_id: str + :param transcribe_recording: (required) + :type transcribe_recording: TranscribeRecording + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'recording_id', + 'transcribe_recording' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method transcribe_call_recording" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + if _params['recording_id']: + _path_params['recordingId'] = _params['recording_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['transcribe_recording'] is not None: + _body_params = _params['transcribe_recording'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_call_recording_state(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call_recording : UpdateCallRecording, **kwargs) -> None: # noqa: E501 """Update Recording # noqa: E501 Pause or resume a recording on an active phone call. # noqa: E501 @@ -1564,78 +1627,164 @@ def update_call_recording_state( >>> thread = api.update_call_recording_state(account_id, call_id, update_call_recording, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - call_id (str): Programmable Voice API Call ID - update_call_recording (UpdateCallRecording): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param update_call_recording: (required) + :type update_call_recording: UpdateCallRecording + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the update_call_recording_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, **kwargs) # noqa: E501 + + @validate_arguments + def update_call_recording_state_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call_recording : UpdateCallRecording, **kwargs) -> ApiResponse: # noqa: E501 + """Update Recording # noqa: E501 + + Pause or resume a recording on an active phone call. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param update_call_recording: (required) + :type update_call_recording: UpdateCallRecording + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - kwargs['call_id'] = \ - call_id - kwargs['update_call_recording'] = \ - update_call_recording - return self.update_call_recording_state_endpoint.call_with_http_info(**kwargs) + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id', + 'call_id', + 'update_call_recording' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_call_recording_state" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + if _params['call_id']: + _path_params['callId'] = _params['call_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['update_call_recording'] is not None: + _body_params = _params['update_call_recording'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/accounts/{accountId}/calls/{callId}/recording', 'PUT', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api/statistics_api.py b/bandwidth/api/statistics_api.py index e6bab392..5766d050 100644 --- a/bandwidth/api/statistics_api.py +++ b/bandwidth/api/statistics_api.py @@ -1,170 +1,205 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + + Bandwidth's Communication APIs + The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.api_client import ApiClient, Endpoint as _Endpoint -from bandwidth.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types +import io +import warnings + +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated + +from pydantic import Field, StrictStr + +from bandwidth.models.account_statistics import AccountStatistics + +from bandwidth.api_client import ApiClient +from bandwidth.api_response import ApiResponse +from bandwidth.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError ) -from bandwidth.model.account_statistics import AccountStatistics -from bandwidth.model.voice_api_error import VoiceApiError class StatisticsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech + Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_statistics_endpoint = _Endpoint( - settings={ - 'response_type': (AccountStatistics,), - 'auth': [ - 'Basic' - ], - 'endpoint_path': '/accounts/{accountId}/statistics', - 'operation_id': 'get_statistics', - 'http_method': 'GET', - 'servers': [ - { - 'url': "https://voice.bandwidth.com/api/v2", - 'description': "Production", - }, - ] - }, - params_map={ - 'all': [ - 'account_id', - ], - 'required': [ - 'account_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - }, - 'attribute_map': { - 'account_id': 'accountId', - }, - 'location_map': { - 'account_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - def get_statistics( - self, - account_id, - **kwargs - ): + @validate_arguments + def get_statistics(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], **kwargs) -> AccountStatistics: # noqa: E501 """Get Account Statistics # noqa: E501 + Returns details about the current state of the account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_statistics(account_id, async_req=True) >>> result = thread.get() - Args: - account_id (str): Your Bandwidth Account ID - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - Returns: - AccountStatistics - If the method is called asynchronously, returns the request - thread. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: AccountStatistics """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the get_statistics_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.get_statistics_with_http_info(account_id, **kwargs) # noqa: E501 + + @validate_arguments + def get_statistics_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], **kwargs) -> ApiResponse: # noqa: E501 + """Get Account Statistics # noqa: E501 + + Returns details about the current state of the account. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_statistics_with_http_info(account_id, async_req=True) + >>> result = thread.get() + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(AccountStatistics, status_code(int), headers(HTTPHeaderDict)) + """ + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[0] + if kwargs.get('_host_index'): + _host_index = int(kwargs.get('_host_index')) + if _host_index < 0 or _host_index >= len(_hosts): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" + % len(_host) + ) + _host = _hosts[_host_index] + _params = locals() + + _all_params = [ + 'account_id' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['account_id'] = \ - account_id - return self.get_statistics_endpoint.call_with_http_info(**kwargs) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params and _key != "_host_index": + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_statistics" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['account_id']: + _path_params['accountId'] = _params['account_id'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['Basic'] # noqa: E501 + + _response_types_map = { + '200': "AccountStatistics", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + + return self.api_client.call_api( + '/accounts/{accountId}/statistics', 'GET', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + _host=_host, + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/bandwidth/api_client.py b/bandwidth/api_client.py index b3ac9f14..5b45d659 100644 --- a/bandwidth/api_client.py +++ b/bandwidth/api_client.py @@ -1,43 +1,35 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import json import atexit +import datetime +from dateutil.parser import parse +import json import mimetypes from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +from urllib.parse import quote -from bandwidth import rest from bandwidth.configuration import Configuration -from bandwidth.exceptions import ApiTypeError, ApiValueError, ApiException -from bandwidth.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types -) +from bandwidth.api_response import ApiResponse +import bandwidth.models +from bandwidth import rest +from bandwidth.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -48,10 +40,6 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to @@ -62,12 +50,24 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration self.pool_threads = pool_threads @@ -77,7 +77,8 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/15.0.0b1/python' + self.user_agent = 'OpenAPI-Generator/15.0.0/python' + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self @@ -115,27 +116,40 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_types_map=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _request_auth=None): config = self.configuration @@ -161,12 +175,6 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] @@ -174,19 +182,17 @@ def __call_api( post_params = self.parameters_to_tuples(post_params, collection_formats) post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) + + # auth setting + self.update_params_for_auth( + header_params, query_params, auth_settings, + resource_path, method, body, + request_auth=_request_auth) # body if body: body = self.sanitize_for_serialization(body) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - # request url if _host is None: url = self.configuration.host + resource_path @@ -194,74 +200,63 @@ def __call_api( # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, + collection_formats) + url += "?" + url_query + try: # perform request and return response response_data = self.request( - method, url, query_params=query_params, headers=header_params, + method, url, + query_params=query_params, + headers=header_params, post_params=post_params, body=body, _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') + if e.body: + e.body = e.body.decode('utf-8') raise e self.last_response = response_data - return_data = response_data - - if not _preload_content: - return (return_data) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None + return_data = None # assuming derialization is not needed + # data needs deserialization or returns HTTP data (deserialized) only + if _preload_content or _return_http_data_only: + response_type = response_types_map.get(str(response_data.status), None) + + if response_type == "bytearray": + response_data.data = response_data.data + else: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type == "bytearray": + return_data = response_data.data + elif response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: - return (return_data) + return return_data else: - return (return_data, response_data.status, - response_data.getheaders()) + return ApiResponse(status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -269,98 +264,104 @@ def sanitize_for_serialization(cls, obj): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = obj.to_dict() - def deserialize(self, response, response_type, _check_type): + return {key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items()} + + def deserialize(self, response, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. :return: deserialized object. """ # handle file downloading # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) + if response_type == "file": + return self.__deserialize_file(response) # fetch data from response object try: - received_data = json.loads(response.data) + data = json.loads(response.data) except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('List['): + sub_kls = re.match(r'List\[(.*)]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(bandwidth.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_types_map=None, auth_settings=None, + async_req=None, _return_http_data_only=None, + collection_formats=None, _preload_content=True, + _request_timeout=None, _host=None, _request_auth=None): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -375,42 +376,26 @@ def call_api( :param post_params dict: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. :param collection_formats: dict of collection formats for path, query, header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single + :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auths: list, optional + :type _request_token: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -422,50 +407,48 @@ def call_api( return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_types_map, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) + _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, query_params, header_params, body, post_params, files, - response_type, + response_types_map, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auths)) + _host, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET(url, + return self.rest_client.get_request(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) elif method == "HEAD": - return self.rest_client.HEAD(url, + return self.rest_client.head_request(url, query_params=query_params, _preload_content=_preload_content, _request_timeout=_request_timeout, headers=headers) elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, + return self.rest_client.options_request(url, query_params=query_params, headers=headers, - post_params=post_params, _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + _request_timeout=_request_timeout) elif method == "POST": - return self.rest_client.POST(url, + return self.rest_client.post_request(url, query_params=query_params, headers=headers, post_params=post_params, @@ -473,7 +456,7 @@ def request(self, method, url, query_params=None, headers=None, _request_timeout=_request_timeout, body=body) elif method == "PUT": - return self.rest_client.PUT(url, + return self.rest_client.put_request(url, query_params=query_params, headers=headers, post_params=post_params, @@ -481,7 +464,7 @@ def request(self, method, url, query_params=None, headers=None, _request_timeout=_request_timeout, body=body) elif method == "PATCH": - return self.rest_client.PATCH(url, + return self.rest_client.patch_request(url, query_params=query_params, headers=headers, post_params=post_params, @@ -489,7 +472,7 @@ def request(self, method, url, query_params=None, headers=None, _request_timeout=_request_timeout, body=body) elif method == "DELETE": - return self.rest_client.DELETE(url, + return self.rest_client.delete_request(url, query_params=query_params, headers=headers, _preload_content=_preload_content, @@ -531,44 +514,65 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v))) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(item) for item in new_params]) - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): + def files_parameters(self, files=None): """Builds form parameters. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param files: File parameters. + :return: Form parameters with files. """ - if files is None: - return [] - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values + + if files: + for k, v in files.items(): + if not v: continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params @@ -581,68 +585,73 @@ def select_header_accept(self, accepts): if not accepts: return - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: return None - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): + resource_path, method, body, + request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) + if request_auth: + self._apply_auth_params(headers, queries, + resource_path, method, body, + request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) + self._apply_auth_params(headers, queries, + resource_path, method, body, + auth_setting) + + def _apply_auth_params(self, headers, queries, + resource_path, method, body, + auth_setting): + """Updates the request parameters based on a single auth_setting - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] + headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] @@ -653,245 +662,95 @@ def _apply_auth_params(self, headers, queries, resource_path, method, body, auth 'Authentication token must be in `query` or `header`' ) + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + :param response: RESTResponse. + :return: file path. """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) - if kwargs['_check_input_type'] is False: - return + with open(path, "wb") as f: + f.write(response.data) - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + return path - return params + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data - api_instance = CallsApi() - api_instance.create_call # this is an instance of the class Endpoint - api_instance.create_call() # this invokes api_instance.create_call.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.create_call.callable or self.callable in this class + def __deserialize_object(self, value): + """Return an original value. + :return: object. """ - return self.callable(self, *args, **kwargs) + return value - def call_with_http_info(self, **kwargs): + def __deserialize_date(self, string): + """Deserializes string to date. + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. - self.__validate_inputs(kwargs) + The string should be in iso8601 datetime format. - params = self.__gather_params(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/bandwidth/api_response.py b/bandwidth/api_response.py new file mode 100644 index 00000000..d81c2ff5 --- /dev/null +++ b/bandwidth/api_response.py @@ -0,0 +1,25 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Any, Dict, Optional +from pydantic import Field, StrictInt, StrictStr + +class ApiResponse: + """ + API response object + """ + + status_code: Optional[StrictInt] = Field(None, description="HTTP status code") + headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") + data: Optional[Any] = Field(None, description="Deserialized data given the data type") + raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + + def __init__(self, + status_code=None, + headers=None, + data=None, + raw_data=None): + self.status_code = status_code + self.headers = headers + self.data = data + self.raw_data = raw_data diff --git a/bandwidth/apis/__init__.py b/bandwidth/apis/__init__.py deleted file mode 100644 index 80e9c676..00000000 --- a/bandwidth/apis/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from bandwidth.api.calls_api import CallsApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from bandwidth.api.calls_api import CallsApi -from bandwidth.api.conferences_api import ConferencesApi -from bandwidth.api.mfa_api import MFAApi -from bandwidth.api.media_api import MediaApi -from bandwidth.api.messages_api import MessagesApi -from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi -from bandwidth.api.recordings_api import RecordingsApi -from bandwidth.api.statistics_api import StatisticsApi diff --git a/bandwidth/configuration.py b/bandwidth/configuration.py index a445f55c..62b17016 100644 --- a/bandwidth/configuration.py +++ b/bandwidth/configuration.py @@ -1,12 +1,16 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import copy @@ -15,10 +19,9 @@ import sys import urllib3 -from http import client as http_client +import http.client as httplib from bandwidth.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', @@ -26,45 +29,19 @@ } class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -75,7 +52,7 @@ class Configuration(object): string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. :Example: @@ -100,10 +77,8 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, @@ -125,7 +100,6 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -145,8 +119,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -185,6 +160,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -197,9 +176,6 @@ def __init__(self, host=None, self.proxy = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ @@ -212,8 +188,17 @@ def __init__(self, host=None, # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -231,13 +216,6 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod def set_default(cls, default): @@ -248,21 +226,31 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -316,15 +304,15 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -405,7 +393,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ + "SDK Package Version: 15.0.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/bandwidth/exceptions.py b/bandwidth/exceptions.py index 0e832196..25ad1ee2 100644 --- a/bandwidth/exceptions.py +++ b/bandwidth/exceptions.py @@ -1,12 +1,16 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 class OpenApiException(Exception): @@ -112,7 +116,7 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ + error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( @@ -123,6 +127,10 @@ def __str__(self): return error_message +class BadRequestException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): diff --git a/bandwidth/model/__init__.py b/bandwidth/model/__init__.py deleted file mode 100644 index 59c50a16..00000000 --- a/bandwidth/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from bandwidth.models import ModelA, ModelB diff --git a/bandwidth/model/account_statistics.py b/bandwidth/model/account_statistics.py deleted file mode 100644 index 10b8e210..00000000 --- a/bandwidth/model/account_statistics.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class AccountStatistics(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'current_call_queue_size': (int,), # noqa: E501 - 'max_call_queue_size': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'current_call_queue_size': 'currentCallQueueSize', # noqa: E501 - 'max_call_queue_size': 'maxCallQueueSize', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountStatistics - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - current_call_queue_size (int): The number of calls currently enqueued.. [optional] # noqa: E501 - max_call_queue_size (int): The maximum size of the queue before outgoing calls start being rejected.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountStatistics - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - current_call_queue_size (int): The number of calls currently enqueued.. [optional] # noqa: E501 - max_call_queue_size (int): The maximum size of the queue before outgoing calls start being rejected.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/answer_callback.py b/bandwidth/model/answer_callback.py deleted file mode 100644 index 3766b3f3..00000000 --- a/bandwidth/model/answer_callback.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class AnswerCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'machine_detection_result': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'machine_detection_result': 'machineDetectionResult', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AnswerCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - machine_detection_result (str, none_type): (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AnswerCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - machine_detection_result (str, none_type): (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/bridge_complete_callback.py b/bandwidth/model/bridge_complete_callback.py deleted file mode 100644 index 9f6a06c2..00000000 --- a/bandwidth/model/bridge_complete_callback.py +++ /dev/null @@ -1,330 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class BridgeCompleteCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'cause': (str,), # noqa: E501 - 'error_message': (str, none_type,), # noqa: E501 - 'error_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'cause': 'cause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BridgeCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BridgeCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/bridge_target_complete_callback.py b/bandwidth/model/bridge_target_complete_callback.py deleted file mode 100644 index 8303a85c..00000000 --- a/bandwidth/model/bridge_target_complete_callback.py +++ /dev/null @@ -1,318 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class BridgeTargetCompleteCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BridgeTargetCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BridgeTargetCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/bxml/__init__.py b/bandwidth/model/bxml/__init__.py deleted file mode 100644 index 4fc2e598..00000000 --- a/bandwidth/model/bxml/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .response import Response -from .bxml import Bxml -from . import verbs diff --git a/bandwidth/model/call_callback.py b/bandwidth/model/call_callback.py deleted file mode 100644 index a872ffda..00000000 --- a/bandwidth/model/call_callback.py +++ /dev/null @@ -1,388 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.diversion import Diversion - from bandwidth.model.transcription import Transcription - globals()['Diversion'] = Diversion - globals()['Transcription'] = Transcription - - -class CallCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'start_time': (str,), # noqa: E501 - 'answer_time': (str,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'cause': (str,), # noqa: E501 - 'error_message': (str,), # noqa: E501 - 'error_id': (str,), # noqa: E501 - 'end_time': (str,), # noqa: E501 - 'digit': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (str,), # noqa: E501 - 'media_url': (str,), # noqa: E501 - 'tag': (str,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'digits': (str,), # noqa: E501 - 'terminating_digit': (str,), # noqa: E501 - 'transcription': (Transcription,), # noqa: E501 - 'diversion': (Diversion,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'cause': 'cause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'digit': 'digit', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'status': 'status', # noqa: E501 - 'digits': 'digits', # noqa: E501 - 'terminating_digit': 'terminatingDigit', # noqa: E501 - 'transcription': 'transcription', # noqa: E501 - 'diversion': 'diversion', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CallCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): [optional] # noqa: E501 - event_time (str): [optional] # noqa: E501 - account_id (str): [optional] # noqa: E501 - application_id (str): [optional] # noqa: E501 - _from (str): [optional] # noqa: E501 - to (str): [optional] # noqa: E501 - direction (str): [optional] # noqa: E501 - call_id (str): [optional] # noqa: E501 - call_url (str): [optional] # noqa: E501 - start_time (str): [optional] # noqa: E501 - answer_time (str): [optional] # noqa: E501 - transfer_caller_id (str): [optional] # noqa: E501 - transfer_to (str): [optional] # noqa: E501 - cause (str): [optional] # noqa: E501 - error_message (str): [optional] # noqa: E501 - error_id (str): [optional] # noqa: E501 - end_time (str): [optional] # noqa: E501 - digit (str): [optional] # noqa: E501 - parent_call_id (str): [optional] # noqa: E501 - recording_id (str): [optional] # noqa: E501 - duration (str): [optional] # noqa: E501 - file_format (str): [optional] # noqa: E501 - media_url (str): [optional] # noqa: E501 - tag (str): [optional] # noqa: E501 - channels (int): [optional] # noqa: E501 - status (str): [optional] # noqa: E501 - digits (str): [optional] # noqa: E501 - terminating_digit (str): [optional] # noqa: E501 - transcription (Transcription): [optional] # noqa: E501 - diversion (Diversion): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CallCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): [optional] # noqa: E501 - event_time (str): [optional] # noqa: E501 - account_id (str): [optional] # noqa: E501 - application_id (str): [optional] # noqa: E501 - _from (str): [optional] # noqa: E501 - to (str): [optional] # noqa: E501 - direction (str): [optional] # noqa: E501 - call_id (str): [optional] # noqa: E501 - call_url (str): [optional] # noqa: E501 - start_time (str): [optional] # noqa: E501 - answer_time (str): [optional] # noqa: E501 - transfer_caller_id (str): [optional] # noqa: E501 - transfer_to (str): [optional] # noqa: E501 - cause (str): [optional] # noqa: E501 - error_message (str): [optional] # noqa: E501 - error_id (str): [optional] # noqa: E501 - end_time (str): [optional] # noqa: E501 - digit (str): [optional] # noqa: E501 - parent_call_id (str): [optional] # noqa: E501 - recording_id (str): [optional] # noqa: E501 - duration (str): [optional] # noqa: E501 - file_format (str): [optional] # noqa: E501 - media_url (str): [optional] # noqa: E501 - tag (str): [optional] # noqa: E501 - channels (int): [optional] # noqa: E501 - status (str): [optional] # noqa: E501 - digits (str): [optional] # noqa: E501 - terminating_digit (str): [optional] # noqa: E501 - transcription (Transcription): [optional] # noqa: E501 - diversion (Diversion): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/call_direction_enum.py b/bandwidth/model/call_direction_enum.py deleted file mode 100644 index 745323a8..00000000 --- a/bandwidth/model/call_direction_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class CallDirectionEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'INBOUND': "inbound", - 'OUTBOUND': "outbound", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """CallDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the call.., must be one of ["inbound", "outbound", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the call.., must be one of ["inbound", "outbound", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """CallDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the call.., must be one of ["inbound", "outbound", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the call.., must be one of ["inbound", "outbound", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/call_recording_metadata.py b/bandwidth/model/call_recording_metadata.py deleted file mode 100644 index a899bcfb..00000000 --- a/bandwidth/model/call_recording_metadata.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - from bandwidth.model.file_format_enum import FileFormatEnum - from bandwidth.model.transcription_metadata import TranscriptionMetadata - globals()['CallDirectionEnum'] = CallDirectionEnum - globals()['FileFormatEnum'] = FileFormatEnum - globals()['TranscriptionMetadata'] = TranscriptionMetadata - - -class CallRecordingMetadata(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'application_id': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - 'transcription': (TranscriptionMetadata,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'application_id': 'applicationId', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'status': 'status', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'transcription': 'transcription', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CallRecordingMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - transcription (TranscriptionMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CallRecordingMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - transcription (TranscriptionMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/call_state.py b/bandwidth/model/call_state.py deleted file mode 100644 index 265cb232..00000000 --- a/bandwidth/model/call_state.py +++ /dev/null @@ -1,338 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class CallState(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'application_id': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'parent_call_id': (str, none_type,), # noqa: E501 - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'state': (str,), # noqa: E501 - 'stir_shaken': ({str: (str,)}, none_type,), # noqa: E501 - 'identity': (str, none_type,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime, none_type,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'end_time': (datetime, none_type,), # noqa: E501 - 'disconnect_cause': (str, none_type,), # noqa: E501 - 'error_message': (str, none_type,), # noqa: E501 - 'error_id': (str, none_type,), # noqa: E501 - 'last_update': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'application_id': 'applicationId', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'state': 'state', # noqa: E501 - 'stir_shaken': 'stirShaken', # noqa: E501 - 'identity': 'identity', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'disconnect_cause': 'disconnectCause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - 'last_update': 'lastUpdate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CallState - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - application_id (str): The application id associated with the call.. [optional] # noqa: E501 - account_id (str): The account id associated with the call.. [optional] # noqa: E501 - call_id (str): The programmable voice API call ID.. [optional] # noqa: E501 - parent_call_id (str, none_type): The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer).. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. [optional] # noqa: E501 - _from (str): The phone number that made the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - state (str): The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - stir_shaken ({str: (str,)}, none_type): For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). [optional] # noqa: E501 - identity (str, none_type): The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): The time this call was placed in queue.. [optional] # noqa: E501 - start_time (datetime, none_type): The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue.. [optional] # noqa: E501 - answer_time (datetime, none_type): Populated once the call has been answered, with the time in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime, none_type): Populated once the call has ended, with the time in ISO 8601 format.. [optional] # noqa: E501 - disconnect_cause (str, none_type): | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [``](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future.. [optional] # noqa: E501 - error_message (str, none_type): Populated only if the call ended with an error, with text explaining the reason.. [optional] # noqa: E501 - error_id (str, none_type): Populated only if the call ended with an error, with a Bandwidth internal id that references the error event.. [optional] # noqa: E501 - last_update (datetime): The last time the call had a state update, in ISO 8601 format.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CallState - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - application_id (str): The application id associated with the call.. [optional] # noqa: E501 - account_id (str): The account id associated with the call.. [optional] # noqa: E501 - call_id (str): The programmable voice API call ID.. [optional] # noqa: E501 - parent_call_id (str, none_type): The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer).. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. [optional] # noqa: E501 - _from (str): The phone number that made the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - state (str): The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - stir_shaken ({str: (str,)}, none_type): For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). [optional] # noqa: E501 - identity (str, none_type): The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): The time this call was placed in queue.. [optional] # noqa: E501 - start_time (datetime, none_type): The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue.. [optional] # noqa: E501 - answer_time (datetime, none_type): Populated once the call has been answered, with the time in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime, none_type): Populated once the call has ended, with the time in ISO 8601 format.. [optional] # noqa: E501 - disconnect_cause (str, none_type): | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [``](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future.. [optional] # noqa: E501 - error_message (str, none_type): Populated only if the call ended with an error, with text explaining the reason.. [optional] # noqa: E501 - error_id (str, none_type): Populated only if the call ended with an error, with a Bandwidth internal id that references the error event.. [optional] # noqa: E501 - last_update (datetime): The last time the call had a state update, in ISO 8601 format.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/call_state_enum.py b/bandwidth/model/call_state_enum.py deleted file mode 100644 index d24bcf92..00000000 --- a/bandwidth/model/call_state_enum.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class CallStateEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'ACTIVE': "active", - 'COMPLETED': "completed", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """CallStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - - Keyword Args: - value (str): The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "active" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """CallStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - - Keyword Args: - value (str): The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "active" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/callback_method_enum.py b/bandwidth/model/callback_method_enum.py deleted file mode 100644 index 2c0157da..00000000 --- a/bandwidth/model/callback_method_enum.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class CallbackMethodEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'GET': "GET", - 'POST': "POST", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """CallbackMethodEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The HTTP method to use to deliver the callback. GET or POST. Default value is POST.. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - - Keyword Args: - value (str): The HTTP method to use to deliver the callback. GET or POST. Default value is POST.. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "POST" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """CallbackMethodEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The HTTP method to use to deliver the callback. GET or POST. Default value is POST.. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - - Keyword Args: - value (str): The HTTP method to use to deliver the callback. GET or POST. Default value is POST.. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "POST" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/code_request.py b/bandwidth/model/code_request.py deleted file mode 100644 index d1060b7d..00000000 --- a/bandwidth/model/code_request.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class CodeRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('to',): { - 'regex': { - 'pattern': r'^\+[1-9]\d{1,14}$', # noqa: E501 - }, - }, - ('_from',): { - 'max_length': 32, - 'regex': { - 'pattern': r'^\+[1-9]\d{1,14}$', # noqa: E501 - }, - }, - ('application_id',): { - 'max_length': 50, - }, - ('message',): { - 'max_length': 2048, - }, - ('digits',): { - 'inclusive_maximum': 8, - 'inclusive_minimum': 4, - }, - ('scope',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'digits': (int,), # noqa: E501 - 'scope': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - 'message': 'message', # noqa: E501 - 'digits': 'digits', # noqa: E501 - 'scope': 'scope', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, to, _from, application_id, message, digits, *args, **kwargs): # noqa: E501 - """CodeRequest - a model defined in OpenAPI - - Args: - to (str): The phone number to send the mfa code to. - _from (str): The application phone number, the sender of the mfa code. - application_id (str): The application unique ID, obtained from Bandwidth. - message (str): The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. - digits (int): The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - scope (str): An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self._from = _from - self.application_id = application_id - self.message = message - self.digits = digits - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, to, _from, application_id, message, digits, *args, **kwargs): # noqa: E501 - """CodeRequest - a model defined in OpenAPI - - Args: - to (str): The phone number to send the mfa code to. - _from (str): The application phone number, the sender of the mfa code. - application_id (str): The application unique ID, obtained from Bandwidth. - message (str): The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. - digits (int): The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - scope (str): An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self._from = _from - self.application_id = application_id - self.message = message - self.digits = digits - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference.py b/bandwidth/model/conference.py deleted file mode 100644 index 5c1cf60f..00000000 --- a/bandwidth/model/conference.py +++ /dev/null @@ -1,300 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.callback_method_enum import CallbackMethodEnum - from bandwidth.model.conference_member import ConferenceMember - globals()['CallbackMethodEnum'] = CallbackMethodEnum - globals()['ConferenceMember'] = ConferenceMember - - -class Conference(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_time': (datetime,), # noqa: E501 - 'completed_time': (datetime, none_type,), # noqa: E501 - 'conference_event_url': (str, none_type,), # noqa: E501 - 'conference_event_method': (CallbackMethodEnum,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'active_members': ([ConferenceMember], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_time': 'createdTime', # noqa: E501 - 'completed_time': 'completedTime', # noqa: E501 - 'conference_event_url': 'conferenceEventUrl', # noqa: E501 - 'conference_event_method': 'conferenceEventMethod', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'active_members': 'activeMembers', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Conference - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The Bandwidth-generated conference ID. [optional] # noqa: E501 - name (str): The name of the conference, as specified by your application. [optional] # noqa: E501 - created_time (datetime): The time the conference was initiated, in ISO 8601 format.. [optional] # noqa: E501 - completed_time (datetime, none_type): The time the conference was terminated, in ISO 8601 format.. [optional] # noqa: E501 - conference_event_url (str, none_type): The URL to send the conference-related events.. [optional] # noqa: E501 - conference_event_method (CallbackMethodEnum): [optional] # noqa: E501 - tag (str, none_type): The custom string attached to the conference that will be sent with callbacks.. [optional] # noqa: E501 - active_members ([ConferenceMember], none_type): A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Conference - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The Bandwidth-generated conference ID. [optional] # noqa: E501 - name (str): The name of the conference, as specified by your application. [optional] # noqa: E501 - created_time (datetime): The time the conference was initiated, in ISO 8601 format.. [optional] # noqa: E501 - completed_time (datetime, none_type): The time the conference was terminated, in ISO 8601 format.. [optional] # noqa: E501 - conference_event_url (str, none_type): The URL to send the conference-related events.. [optional] # noqa: E501 - conference_event_method (CallbackMethodEnum): [optional] # noqa: E501 - tag (str, none_type): The custom string attached to the conference that will be sent with callbacks.. [optional] # noqa: E501 - active_members ([ConferenceMember], none_type): A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_callback.py b/bandwidth/model/conference_callback.py deleted file mode 100644 index 71fadab0..00000000 --- a/bandwidth/model/conference_callback.py +++ /dev/null @@ -1,328 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'tag': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'start_time': (str,), # noqa: E501 - 'end_time': (str,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (str,), # noqa: E501 - 'media_url': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - conference_id (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - event_type (str): [optional] # noqa: E501 - event_time (str): [optional] # noqa: E501 - tag (str): [optional] # noqa: E501 - call_id (str): [optional] # noqa: E501 - to (str): [optional] # noqa: E501 - _from (str): [optional] # noqa: E501 - account_id (str): [optional] # noqa: E501 - recording_id (str): [optional] # noqa: E501 - channels (int): [optional] # noqa: E501 - start_time (str): [optional] # noqa: E501 - end_time (str): [optional] # noqa: E501 - duration (str): [optional] # noqa: E501 - file_format (str): [optional] # noqa: E501 - media_url (str): [optional] # noqa: E501 - status (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - conference_id (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - event_type (str): [optional] # noqa: E501 - event_time (str): [optional] # noqa: E501 - tag (str): [optional] # noqa: E501 - call_id (str): [optional] # noqa: E501 - to (str): [optional] # noqa: E501 - _from (str): [optional] # noqa: E501 - account_id (str): [optional] # noqa: E501 - recording_id (str): [optional] # noqa: E501 - channels (int): [optional] # noqa: E501 - start_time (str): [optional] # noqa: E501 - end_time (str): [optional] # noqa: E501 - duration (str): [optional] # noqa: E501 - file_format (str): [optional] # noqa: E501 - media_url (str): [optional] # noqa: E501 - status (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_completed_callback.py b/bandwidth/model/conference_completed_callback.py deleted file mode 100644 index 33b0e3fa..00000000 --- a/bandwidth/model/conference_completed_callback.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceCompletedCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceCompletedCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceCompletedCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_created_callback.py b/bandwidth/model/conference_created_callback.py deleted file mode 100644 index 305ee0fa..00000000 --- a/bandwidth/model/conference_created_callback.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceCreatedCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceCreatedCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceCreatedCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_member.py b/bandwidth/model/conference_member.py deleted file mode 100644 index f88915be..00000000 --- a/bandwidth/model/conference_member.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceMember(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'call_id': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'member_url': (str,), # noqa: E501 - 'mute': (bool,), # noqa: E501 - 'hold': (bool,), # noqa: E501 - 'call_ids_to_coach': ([str], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'call_id': 'callId', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'member_url': 'memberUrl', # noqa: E501 - 'mute': 'mute', # noqa: E501 - 'hold': 'hold', # noqa: E501 - 'call_ids_to_coach': 'callIdsToCoach', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceMember - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - member_url (str): A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint.. [optional] # noqa: E501 - mute (bool): Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted.. [optional] # noqa: E501 - hold (bool): Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted.. [optional] # noqa: E501 - call_ids_to_coach ([str], none_type): If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceMember - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - member_url (str): A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint.. [optional] # noqa: E501 - mute (bool): Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted.. [optional] # noqa: E501 - hold (bool): Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted.. [optional] # noqa: E501 - call_ids_to_coach ([str], none_type): If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_member_exit_callback.py b/bandwidth/model/conference_member_exit_callback.py deleted file mode 100644 index 66d9b5d6..00000000 --- a/bandwidth/model/conference_member_exit_callback.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceMemberExitCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceMemberExitCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceMemberExitCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_member_join_callback.py b/bandwidth/model/conference_member_join_callback.py deleted file mode 100644 index f3ce9992..00000000 --- a/bandwidth/model/conference_member_join_callback.py +++ /dev/null @@ -1,292 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceMemberJoinCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceMemberJoinCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceMemberJoinCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_recording_available_callback.py b/bandwidth/model/conference_recording_available_callback.py deleted file mode 100644 index b6f19f02..00000000 --- a/bandwidth/model/conference_recording_available_callback.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.file_format_enum import FileFormatEnum - globals()['FileFormatEnum'] = FileFormatEnum - - -class ConferenceRecordingAvailableCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceRecordingAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceRecordingAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_recording_metadata.py b/bandwidth/model/conference_recording_metadata.py deleted file mode 100644 index 15fc7a87..00000000 --- a/bandwidth/model/conference_recording_metadata.py +++ /dev/null @@ -1,310 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.file_format_enum import FileFormatEnum - globals()['FileFormatEnum'] = FileFormatEnum - - -class ConferenceRecordingMetadata(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account_id': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'account_id': 'accountId', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'status': 'status', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceRecordingMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceRecordingMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_redirect_callback.py b/bandwidth/model/conference_redirect_callback.py deleted file mode 100644 index 05bd1f46..00000000 --- a/bandwidth/model/conference_redirect_callback.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceRedirectCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'conference_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'conference_id': 'conferenceId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ConferenceRedirectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ConferenceRedirectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - conference_id (str): The unique, Bandwidth-generated ID of the conference that was recorded. [optional] # noqa: E501 - name (str): The user-specified name of the conference that was recorded. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/conference_state_enum.py b/bandwidth/model/conference_state_enum.py deleted file mode 100644 index e6aa7f6b..00000000 --- a/bandwidth/model/conference_state_enum.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ConferenceStateEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'ACTIVE': "active", - 'COMPLETED': "completed", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ConferenceStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): Setting the conference state to `completed` ends the conference and ejects all members. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - - Keyword Args: - value (str): Setting the conference state to `completed` ends the conference and ejects all members. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "active" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ConferenceStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): Setting the conference state to `completed` ends the conference and ejects all members. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - - Keyword Args: - value (str): Setting the conference state to `completed` ends the conference and ejects all members. if omitted defaults to "active", must be one of ["active", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "active" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/create_call.py b/bandwidth/model/create_call.py deleted file mode 100644 index ae4a0730..00000000 --- a/bandwidth/model/create_call.py +++ /dev/null @@ -1,391 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.callback_method_enum import CallbackMethodEnum - from bandwidth.model.machine_detection_configuration import MachineDetectionConfiguration - globals()['CallbackMethodEnum'] = CallbackMethodEnum - globals()['MachineDetectionConfiguration'] = MachineDetectionConfiguration - - -class CreateCall(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('answer_url',): { - 'max_length': 2048, - }, - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('answer_fallback_url',): { - 'max_length': 2048, - }, - ('fallback_username',): { - 'max_length': 1024, - }, - ('fallback_password',): { - 'max_length': 1024, - }, - ('disconnect_url',): { - 'max_length': 2048, - }, - ('call_timeout',): { - 'inclusive_maximum': 300, - 'inclusive_minimum': 1, - }, - ('callback_timeout',): { - 'inclusive_maximum': 25, - 'inclusive_minimum': 1, - }, - ('priority',): { - 'inclusive_maximum': 5, - 'inclusive_minimum': 1, - }, - ('tag',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - 'answer_url': (str,), # noqa: E501 - 'uui': (str, none_type,), # noqa: E501 - 'answer_method': (CallbackMethodEnum,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'answer_fallback_url': (str, none_type,), # noqa: E501 - 'answer_fallback_method': (CallbackMethodEnum,), # noqa: E501 - 'fallback_username': (str, none_type,), # noqa: E501 - 'fallback_password': (str, none_type,), # noqa: E501 - 'disconnect_url': (str, none_type,), # noqa: E501 - 'disconnect_method': (CallbackMethodEnum,), # noqa: E501 - 'call_timeout': (float, none_type,), # noqa: E501 - 'callback_timeout': (float, none_type,), # noqa: E501 - 'machine_detection': (MachineDetectionConfiguration,), # noqa: E501 - 'priority': (int, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - 'answer_url': 'answerUrl', # noqa: E501 - 'uui': 'uui', # noqa: E501 - 'answer_method': 'answerMethod', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'answer_fallback_url': 'answerFallbackUrl', # noqa: E501 - 'answer_fallback_method': 'answerFallbackMethod', # noqa: E501 - 'fallback_username': 'fallbackUsername', # noqa: E501 - 'fallback_password': 'fallbackPassword', # noqa: E501 - 'disconnect_url': 'disconnectUrl', # noqa: E501 - 'disconnect_method': 'disconnectMethod', # noqa: E501 - 'call_timeout': 'callTimeout', # noqa: E501 - 'callback_timeout': 'callbackTimeout', # noqa: E501 - 'machine_detection': 'machineDetection', # noqa: E501 - 'priority': 'priority', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, to, _from, application_id, answer_url, *args, **kwargs): # noqa: E501 - """CreateCall - a model defined in OpenAPI - - Args: - to (str): The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). - _from (str): A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). - application_id (str): The id of the application associated with the `from` number. - answer_url (str): The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password` - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uui (str, none_type): A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.. [optional] # noqa: E501 - answer_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - answer_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. [optional] # noqa: E501 - answer_fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - disconnect_url (str, none_type): The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.. [optional] # noqa: E501 - disconnect_method (CallbackMethodEnum): [optional] # noqa: E501 - call_timeout (float, none_type): The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300.. [optional] if omitted the server will use the default value of 30 # noqa: E501 - callback_timeout (float, none_type): This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - machine_detection (MachineDetectionConfiguration): [optional] # noqa: E501 - priority (int, none_type): The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.. [optional] if omitted the server will use the default value of 5 # noqa: E501 - tag (str, none_type): A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self._from = _from - self.application_id = application_id - self.answer_url = answer_url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, to, _from, application_id, answer_url, *args, **kwargs): # noqa: E501 - """CreateCall - a model defined in OpenAPI - - Args: - to (str): The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). - _from (str): A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). - application_id (str): The id of the application associated with the `from` number. - answer_url (str): The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password` - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uui (str, none_type): A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.. [optional] # noqa: E501 - answer_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - answer_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. [optional] # noqa: E501 - answer_fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - disconnect_url (str, none_type): The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.. [optional] # noqa: E501 - disconnect_method (CallbackMethodEnum): [optional] # noqa: E501 - call_timeout (float, none_type): The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300.. [optional] if omitted the server will use the default value of 30 # noqa: E501 - callback_timeout (float, none_type): This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - machine_detection (MachineDetectionConfiguration): [optional] # noqa: E501 - priority (int, none_type): The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.. [optional] if omitted the server will use the default value of 5 # noqa: E501 - tag (str, none_type): A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self._from = _from - self.application_id = application_id - self.answer_url = answer_url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/create_call_response.py b/bandwidth/model/create_call_response.py deleted file mode 100644 index 8c26534d..00000000 --- a/bandwidth/model/create_call_response.py +++ /dev/null @@ -1,384 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.callback_method_enum import CallbackMethodEnum - globals()['CallbackMethodEnum'] = CallbackMethodEnum - - -class CreateCallResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('fallback_username',): { - 'max_length': 1024, - }, - ('fallback_password',): { - 'max_length': 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'application_id': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'answer_method': (CallbackMethodEnum,), # noqa: E501 - 'answer_url': (str,), # noqa: E501 - 'disconnect_method': (CallbackMethodEnum,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'call_timeout': (float,), # noqa: E501 - 'callback_timeout': (float,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'answer_fallback_method': (CallbackMethodEnum,), # noqa: E501 - 'answer_fallback_url': (str, none_type,), # noqa: E501 - 'disconnect_url': (str, none_type,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'fallback_username': (str, none_type,), # noqa: E501 - 'fallback_password': (str, none_type,), # noqa: E501 - 'priority': (float, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'application_id': 'applicationId', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'answer_method': 'answerMethod', # noqa: E501 - 'answer_url': 'answerUrl', # noqa: E501 - 'disconnect_method': 'disconnectMethod', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'call_timeout': 'callTimeout', # noqa: E501 - 'callback_timeout': 'callbackTimeout', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'answer_fallback_method': 'answerFallbackMethod', # noqa: E501 - 'answer_fallback_url': 'answerFallbackUrl', # noqa: E501 - 'disconnect_url': 'disconnectUrl', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'fallback_username': 'fallbackUsername', # noqa: E501 - 'fallback_password': 'fallbackPassword', # noqa: E501 - 'priority': 'priority', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, application_id, account_id, call_id, to, _from, call_url, answer_method, answer_url, disconnect_method, *args, **kwargs): # noqa: E501 - """CreateCallResponse - a model defined in OpenAPI - - Args: - application_id (str): The id of the application associated with the `from` number. - account_id (str): The bandwidth account ID associated with the call - call_id (str): Programmable Voice API Call ID - to (str): Recipient of the outgoing call - _from (str): Phone number that created the outbound call - call_url (str): The URL to update call state - answer_method (CallbackMethodEnum): - answer_url (str): URL to deliver the `answer` event webhook. - disconnect_method (CallbackMethodEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enqueued_time (datetime, none_type): Time the call was accepted into the queue. [optional] # noqa: E501 - call_timeout (float): The timeout (in seconds) for the callee to answer the call after it starts ringing.. [optional] # noqa: E501 - callback_timeout (float): This is the timeout (in seconds) to use when delivering webhooks for the call.. [optional] # noqa: E501 - tag (str, none_type): Custom tag value. [optional] # noqa: E501 - answer_fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - answer_fallback_url (str, none_type): Fallback URL to deliver the `answer` event webhook.. [optional] # noqa: E501 - disconnect_url (str, none_type): URL to deliver the `disconnect` event webhook.. [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - priority (float, none_type): The priority of this call over other calls from your account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.application_id = application_id - self.account_id = account_id - self.call_id = call_id - self.to = to - self._from = _from - self.call_url = call_url - self.answer_method = answer_method - self.answer_url = answer_url - self.disconnect_method = disconnect_method - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, application_id, account_id, call_id, to, _from, call_url, answer_method, answer_url, disconnect_method, *args, **kwargs): # noqa: E501 - """CreateCallResponse - a model defined in OpenAPI - - Args: - application_id (str): The id of the application associated with the `from` number. - account_id (str): The bandwidth account ID associated with the call - call_id (str): Programmable Voice API Call ID - to (str): Recipient of the outgoing call - _from (str): Phone number that created the outbound call - call_url (str): The URL to update call state - answer_method (CallbackMethodEnum): - answer_url (str): URL to deliver the `answer` event webhook. - disconnect_method (CallbackMethodEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enqueued_time (datetime, none_type): Time the call was accepted into the queue. [optional] # noqa: E501 - call_timeout (float): The timeout (in seconds) for the callee to answer the call after it starts ringing.. [optional] # noqa: E501 - callback_timeout (float): This is the timeout (in seconds) to use when delivering webhooks for the call.. [optional] # noqa: E501 - tag (str, none_type): Custom tag value. [optional] # noqa: E501 - answer_fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - answer_fallback_url (str, none_type): Fallback URL to deliver the `answer` event webhook.. [optional] # noqa: E501 - disconnect_url (str, none_type): URL to deliver the `disconnect` event webhook.. [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - priority (float, none_type): The priority of this call over other calls from your account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.application_id = application_id - self.account_id = account_id - self.call_id = call_id - self.to = to - self._from = _from - self.call_url = call_url - self.answer_method = answer_method - self.answer_url = answer_url - self.disconnect_method = disconnect_method - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/create_lookup_response.py b/bandwidth/model/create_lookup_response.py deleted file mode 100644 index 638b29e8..00000000 --- a/bandwidth/model/create_lookup_response.py +++ /dev/null @@ -1,274 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.lookup_status_enum import LookupStatusEnum - globals()['LookupStatusEnum'] = LookupStatusEnum - - -class CreateLookupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'request_id': (str,), # noqa: E501 - 'status': (LookupStatusEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'request_id': 'requestId', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CreateLookupResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - request_id (str): The phone number lookup request ID from Bandwidth.. [optional] # noqa: E501 - status (LookupStatusEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CreateLookupResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - request_id (str): The phone number lookup request ID from Bandwidth.. [optional] # noqa: E501 - status (LookupStatusEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/create_message_request_error.py b/bandwidth/model/create_message_request_error.py deleted file mode 100644 index d9c91c79..00000000 --- a/bandwidth/model/create_message_request_error.py +++ /dev/null @@ -1,286 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.field_error import FieldError - globals()['FieldError'] = FieldError - - -class CreateMessageRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'field_errors': ([FieldError],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'description': 'description', # noqa: E501 - 'field_errors': 'fieldErrors', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, description, *args, **kwargs): # noqa: E501 - """CreateMessageRequestError - a model defined in OpenAPI - - Args: - type (str): - description (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_errors ([FieldError]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.description = description - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, description, *args, **kwargs): # noqa: E501 - """CreateMessageRequestError - a model defined in OpenAPI - - Args: - type (str): - description (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_errors ([FieldError]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.description = description - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/deferred_result.py b/bandwidth/model/deferred_result.py deleted file mode 100644 index 5e5e4f56..00000000 --- a/bandwidth/model/deferred_result.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class DeferredResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'result': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'set_or_expired': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'result': 'result', # noqa: E501 - 'set_or_expired': 'setOrExpired', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DeferredResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - result ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - set_or_expired (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DeferredResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - result ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - set_or_expired (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/disconenct_callback.py b/bandwidth/model/disconenct_callback.py deleted file mode 100644 index bf42b3ff..00000000 --- a/bandwidth/model/disconenct_callback.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class DisconenctCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'cause': (str,), # noqa: E501 - 'error_message': (str, none_type,), # noqa: E501 - 'error_id': (str, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'cause': 'cause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DisconenctCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DisconenctCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/diversion.py b/bandwidth/model/diversion.py deleted file mode 100644 index 0897347d..00000000 --- a/bandwidth/model/diversion.py +++ /dev/null @@ -1,288 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class Diversion(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'reason': (str,), # noqa: E501 - 'privacy': (str,), # noqa: E501 - 'screen': (str,), # noqa: E501 - 'counter': (str,), # noqa: E501 - 'limit': (str,), # noqa: E501 - 'unknown': (str,), # noqa: E501 - 'orig_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'reason': 'reason', # noqa: E501 - 'privacy': 'privacy', # noqa: E501 - 'screen': 'screen', # noqa: E501 - 'counter': 'counter', # noqa: E501 - 'limit': 'limit', # noqa: E501 - 'unknown': 'unknown', # noqa: E501 - 'orig_to': 'origTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Diversion - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - reason (str): The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away.. [optional] # noqa: E501 - privacy (str): off or full. [optional] # noqa: E501 - screen (str): No if the number was provided by the user, yes if the number was provided by the network. [optional] # noqa: E501 - counter (str): The number of diversions that have occurred. [optional] # noqa: E501 - limit (str): The maximum number of diversions allowed for this session. [optional] # noqa: E501 - unknown (str): The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys.. [optional] # noqa: E501 - orig_to (str): Always present. Indicates the last telephone number that the call was diverted from.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Diversion - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - reason (str): The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away.. [optional] # noqa: E501 - privacy (str): off or full. [optional] # noqa: E501 - screen (str): No if the number was provided by the user, yes if the number was provided by the network. [optional] # noqa: E501 - counter (str): The number of diversions that have occurred. [optional] # noqa: E501 - limit (str): The maximum number of diversions allowed for this session. [optional] # noqa: E501 - unknown (str): The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys.. [optional] # noqa: E501 - orig_to (str): Always present. Indicates the last telephone number that the call was diverted from.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/dtmf_callback.py b/bandwidth/model/dtmf_callback.py deleted file mode 100644 index 58032264..00000000 --- a/bandwidth/model/dtmf_callback.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class DtmfCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'digit': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'digit': 'digit', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """DtmfCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - digit (str): The digit collected in the call.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """DtmfCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - digit (str): The digit collected in the call.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/field_error.py b/bandwidth/model/field_error.py deleted file mode 100644 index 6782cc73..00000000 --- a/bandwidth/model/field_error.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class FieldError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'field_name': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'field_name': 'fieldName', # noqa: E501 - 'description': 'description', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FieldError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_name (str): The name of the field that contains the error. [optional] # noqa: E501 - description (str): The error associated with the field. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FieldError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_name (str): The name of the field that contains the error. [optional] # noqa: E501 - description (str): The error associated with the field. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/file_format_enum.py b/bandwidth/model/file_format_enum.py deleted file mode 100644 index d5d1d139..00000000 --- a/bandwidth/model/file_format_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class FileFormatEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'MP3': "mp3", - 'WAV': "wav", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """FileFormatEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The format that the recording is stored in., must be one of ["mp3", "wav", ] # noqa: E501 - - Keyword Args: - value (str): The format that the recording is stored in., must be one of ["mp3", "wav", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """FileFormatEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The format that the recording is stored in., must be one of ["mp3", "wav", ] # noqa: E501 - - Keyword Args: - value (str): The format that the recording is stored in., must be one of ["mp3", "wav", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/gather_callback.py b/bandwidth/model/gather_callback.py deleted file mode 100644 index 2a6c9cf8..00000000 --- a/bandwidth/model/gather_callback.py +++ /dev/null @@ -1,338 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class GatherCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'digits': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'terminating_digit': (str,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'digits': 'digits', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'terminating_digit': 'terminatingDigit', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """GatherCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - digits (str): (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - terminating_digit (str): (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """GatherCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - digits (str): (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - terminating_digit (str): (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/initiate_callback.py b/bandwidth/model/initiate_callback.py deleted file mode 100644 index 38d06071..00000000 --- a/bandwidth/model/initiate_callback.py +++ /dev/null @@ -1,318 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - from bandwidth.model.diversion import Diversion - from bandwidth.model.stir_shaken import StirShaken - globals()['CallDirectionEnum'] = CallDirectionEnum - globals()['Diversion'] = Diversion - globals()['StirShaken'] = StirShaken - - -class InitiateCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'diversion': (Diversion,), # noqa: E501 - 'stir_shaken': (StirShaken,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'diversion': 'diversion', # noqa: E501 - 'stir_shaken': 'stirShaken', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InitiateCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - diversion (Diversion): [optional] # noqa: E501 - stir_shaken (StirShaken): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """InitiateCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - diversion (Diversion): [optional] # noqa: E501 - stir_shaken (StirShaken): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/list_message_direction_enum.py b/bandwidth/model/list_message_direction_enum.py deleted file mode 100644 index 8edbd6c2..00000000 --- a/bandwidth/model/list_message_direction_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class ListMessageDirectionEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'INBOUND': "INBOUND", - 'OUTBOUND': "OUTBOUND", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ListMessageDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the message. One of INBOUND OUTBOUND.., must be one of ["INBOUND", "OUTBOUND", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the message. One of INBOUND OUTBOUND.., must be one of ["INBOUND", "OUTBOUND", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ListMessageDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the message. One of INBOUND OUTBOUND.., must be one of ["INBOUND", "OUTBOUND", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the message. One of INBOUND OUTBOUND.., must be one of ["INBOUND", "OUTBOUND", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/list_message_item.py b/bandwidth/model/list_message_item.py deleted file mode 100644 index abb0b594..00000000 --- a/bandwidth/model/list_message_item.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum - from bandwidth.model.message_status_enum import MessageStatusEnum - from bandwidth.model.message_type_enum import MessageTypeEnum - globals()['ListMessageDirectionEnum'] = ListMessageDirectionEnum - globals()['MessageStatusEnum'] = MessageStatusEnum - globals()['MessageTypeEnum'] = MessageTypeEnum - - -class ListMessageItem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'message_id': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'source_tn': (str,), # noqa: E501 - 'destination_tn': (str,), # noqa: E501 - 'message_status': (MessageStatusEnum,), # noqa: E501 - 'message_direction': (ListMessageDirectionEnum,), # noqa: E501 - 'message_type': (MessageTypeEnum,), # noqa: E501 - 'segment_count': (int,), # noqa: E501 - 'error_code': (int,), # noqa: E501 - 'receive_time': (str,), # noqa: E501 - 'carrier_name': (str, none_type,), # noqa: E501 - 'message_size': (int, none_type,), # noqa: E501 - 'message_length': (int,), # noqa: E501 - 'attachment_count': (int, none_type,), # noqa: E501 - 'recipient_count': (int, none_type,), # noqa: E501 - 'campaign_class': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'message_id': 'messageId', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'source_tn': 'sourceTn', # noqa: E501 - 'destination_tn': 'destinationTn', # noqa: E501 - 'message_status': 'messageStatus', # noqa: E501 - 'message_direction': 'messageDirection', # noqa: E501 - 'message_type': 'messageType', # noqa: E501 - 'segment_count': 'segmentCount', # noqa: E501 - 'error_code': 'errorCode', # noqa: E501 - 'receive_time': 'receiveTime', # noqa: E501 - 'carrier_name': 'carrierName', # noqa: E501 - 'message_size': 'messageSize', # noqa: E501 - 'message_length': 'messageLength', # noqa: E501 - 'attachment_count': 'attachmentCount', # noqa: E501 - 'recipient_count': 'recipientCount', # noqa: E501 - 'campaign_class': 'campaignClass', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ListMessageItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message_id (str): The message id. [optional] # noqa: E501 - account_id (str): The account id associated with this message.. [optional] # noqa: E501 - source_tn (str): The source phone number of the message.. [optional] # noqa: E501 - destination_tn (str): The recipient phone number of the message.. [optional] # noqa: E501 - message_status (MessageStatusEnum): [optional] # noqa: E501 - message_direction (ListMessageDirectionEnum): [optional] # noqa: E501 - message_type (MessageTypeEnum): [optional] # noqa: E501 - segment_count (int): The number of segments the message was sent as.. [optional] # noqa: E501 - error_code (int): The numeric error code of the message.. [optional] # noqa: E501 - receive_time (str): The ISO 8601 datetime of the message.. [optional] # noqa: E501 - carrier_name (str, none_type): The name of the carrier. Not currently supported for MMS coming soon.. [optional] # noqa: E501 - message_size (int, none_type): The size of the message including message content and headers.. [optional] # noqa: E501 - message_length (int): The length of the message content.. [optional] # noqa: E501 - attachment_count (int, none_type): The number of attachments the message has.. [optional] # noqa: E501 - recipient_count (int, none_type): The number of recipients the message has.. [optional] # noqa: E501 - campaign_class (str, none_type): The campaign class of the message if it has one.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ListMessageItem - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message_id (str): The message id. [optional] # noqa: E501 - account_id (str): The account id associated with this message.. [optional] # noqa: E501 - source_tn (str): The source phone number of the message.. [optional] # noqa: E501 - destination_tn (str): The recipient phone number of the message.. [optional] # noqa: E501 - message_status (MessageStatusEnum): [optional] # noqa: E501 - message_direction (ListMessageDirectionEnum): [optional] # noqa: E501 - message_type (MessageTypeEnum): [optional] # noqa: E501 - segment_count (int): The number of segments the message was sent as.. [optional] # noqa: E501 - error_code (int): The numeric error code of the message.. [optional] # noqa: E501 - receive_time (str): The ISO 8601 datetime of the message.. [optional] # noqa: E501 - carrier_name (str, none_type): The name of the carrier. Not currently supported for MMS coming soon.. [optional] # noqa: E501 - message_size (int, none_type): The size of the message including message content and headers.. [optional] # noqa: E501 - message_length (int): The length of the message content.. [optional] # noqa: E501 - attachment_count (int, none_type): The number of attachments the message has.. [optional] # noqa: E501 - recipient_count (int, none_type): The number of recipients the message has.. [optional] # noqa: E501 - campaign_class (str, none_type): The campaign class of the message if it has one.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/lookup_request.py b/bandwidth/model/lookup_request.py deleted file mode 100644 index f76e96af..00000000 --- a/bandwidth/model/lookup_request.py +++ /dev/null @@ -1,270 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class LookupRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'tns': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'tns': 'tns', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, tns, *args, **kwargs): # noqa: E501 - """LookupRequest - a model defined in OpenAPI - - Args: - tns ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.tns = tns - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, tns, *args, **kwargs): # noqa: E501 - """LookupRequest - a model defined in OpenAPI - - Args: - tns ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.tns = tns - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/lookup_result.py b/bandwidth/model/lookup_result.py deleted file mode 100644 index 9120d444..00000000 --- a/bandwidth/model/lookup_result.py +++ /dev/null @@ -1,296 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class LookupResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'response_code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'e_164_format': (str,), # noqa: E501 - 'formatted': (str,), # noqa: E501 - 'country': (str,), # noqa: E501 - 'line_type': (str,), # noqa: E501 - 'line_provider': (str,), # noqa: E501 - 'mobile_country_code': (str,), # noqa: E501 - 'mobile_network_code': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'response_code': 'Response Code', # noqa: E501 - 'message': 'Message', # noqa: E501 - 'e_164_format': 'E.164 Format', # noqa: E501 - 'formatted': 'Formatted', # noqa: E501 - 'country': 'Country', # noqa: E501 - 'line_type': 'Line Type', # noqa: E501 - 'line_provider': 'Line Provider', # noqa: E501 - 'mobile_country_code': 'Mobile Country Code', # noqa: E501 - 'mobile_network_code': 'Mobile Network Code', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """LookupResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - response_code (int): Our vendor's response code.. [optional] # noqa: E501 - message (str): Message associated with the response code.. [optional] # noqa: E501 - e_164_format (str): The telephone number in E.164 format.. [optional] # noqa: E501 - formatted (str): The formatted version of the telephone number.. [optional] # noqa: E501 - country (str): The country of the telephone number.. [optional] # noqa: E501 - line_type (str): The line type of the telephone number.. [optional] # noqa: E501 - line_provider (str): The messaging service provider of the telephone number.. [optional] # noqa: E501 - mobile_country_code (str): The first half of the Home Network Identity (HNI).. [optional] # noqa: E501 - mobile_network_code (str): The second half of the HNI.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """LookupResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - response_code (int): Our vendor's response code.. [optional] # noqa: E501 - message (str): Message associated with the response code.. [optional] # noqa: E501 - e_164_format (str): The telephone number in E.164 format.. [optional] # noqa: E501 - formatted (str): The formatted version of the telephone number.. [optional] # noqa: E501 - country (str): The country of the telephone number.. [optional] # noqa: E501 - line_type (str): The line type of the telephone number.. [optional] # noqa: E501 - line_provider (str): The messaging service provider of the telephone number.. [optional] # noqa: E501 - mobile_country_code (str): The first half of the Home Network Identity (HNI).. [optional] # noqa: E501 - mobile_network_code (str): The second half of the HNI.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/lookup_status.py b/bandwidth/model/lookup_status.py deleted file mode 100644 index f305bf0d..00000000 --- a/bandwidth/model/lookup_status.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.lookup_result import LookupResult - from bandwidth.model.lookup_status_enum import LookupStatusEnum - globals()['LookupResult'] = LookupResult - globals()['LookupStatusEnum'] = LookupStatusEnum - - -class LookupStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'request_id': (str,), # noqa: E501 - 'status': (LookupStatusEnum,), # noqa: E501 - 'result': ([LookupResult],), # noqa: E501 - 'failed_telephone_numbers': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'request_id': 'requestId', # noqa: E501 - 'status': 'status', # noqa: E501 - 'result': 'result', # noqa: E501 - 'failed_telephone_numbers': 'failedTelephoneNumbers', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """LookupStatus - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - request_id (str): The requestId.. [optional] # noqa: E501 - status (LookupStatusEnum): [optional] # noqa: E501 - result ([LookupResult]): The carrier information results for the specified telephone number.. [optional] # noqa: E501 - failed_telephone_numbers ([str]): The telephone numbers whose lookup failed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """LookupStatus - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - request_id (str): The requestId.. [optional] # noqa: E501 - status (LookupStatusEnum): [optional] # noqa: E501 - result ([LookupResult]): The carrier information results for the specified telephone number.. [optional] # noqa: E501 - failed_telephone_numbers ([str]): The telephone numbers whose lookup failed.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/lookup_status_enum.py b/bandwidth/model/lookup_status_enum.py deleted file mode 100644 index 6495da91..00000000 --- a/bandwidth/model/lookup_status_enum.py +++ /dev/null @@ -1,293 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class LookupStatusEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'IN_PROGRESS': "IN_PROGRESS", - 'COMPLETE': "COMPLETE", - 'PARTIAL_COMPLETE': "PARTIAL_COMPLETE", - 'FAILED': "FAILED", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LookupStatusEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).., must be one of ["IN_PROGRESS", "COMPLETE", "PARTIAL_COMPLETE", "FAILED", ] # noqa: E501 - - Keyword Args: - value (str): The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).., must be one of ["IN_PROGRESS", "COMPLETE", "PARTIAL_COMPLETE", "FAILED", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LookupStatusEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).., must be one of ["IN_PROGRESS", "COMPLETE", "PARTIAL_COMPLETE", "FAILED", ] # noqa: E501 - - Keyword Args: - value (str): The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).., must be one of ["IN_PROGRESS", "COMPLETE", "PARTIAL_COMPLETE", "FAILED", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/lookup_status_result_inner.py b/bandwidth/model/lookup_status_result_inner.py deleted file mode 100644 index b53c93fd..00000000 --- a/bandwidth/model/lookup_status_result_inner.py +++ /dev/null @@ -1,296 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class LookupStatusResultInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'response_code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'e_164_format': (str,), # noqa: E501 - 'formatted': (str,), # noqa: E501 - 'country': (str,), # noqa: E501 - 'line_type': (str,), # noqa: E501 - 'line_provider': (str,), # noqa: E501 - 'mobile_country_code': (str,), # noqa: E501 - 'mobile_network_code': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'response_code': 'Response Code', # noqa: E501 - 'message': 'Message', # noqa: E501 - 'e_164_format': 'E.164 Format', # noqa: E501 - 'formatted': 'Formatted', # noqa: E501 - 'country': 'Country', # noqa: E501 - 'line_type': 'Line Type', # noqa: E501 - 'line_provider': 'Line Provider', # noqa: E501 - 'mobile_country_code': 'Mobile Country Code', # noqa: E501 - 'mobile_network_code': 'Mobile Network Code', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """LookupStatusResultInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - response_code (int): Our vendor's response code.. [optional] # noqa: E501 - message (str): Message associated with the response code.. [optional] # noqa: E501 - e_164_format (str): The telephone number in E.164 format.. [optional] # noqa: E501 - formatted (str): The formatted version of the telephone number.. [optional] # noqa: E501 - country (str): The country of the telephone number.. [optional] # noqa: E501 - line_type (str): The line type of the telephone number.. [optional] # noqa: E501 - line_provider (str): The messaging service provider of the telephone number.. [optional] # noqa: E501 - mobile_country_code (str): The first half of the Home Network Identity (HNI).. [optional] # noqa: E501 - mobile_network_code (str): The second half of the HNI.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """LookupStatusResultInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - response_code (int): Our vendor's response code.. [optional] # noqa: E501 - message (str): Message associated with the response code.. [optional] # noqa: E501 - e_164_format (str): The telephone number in E.164 format.. [optional] # noqa: E501 - formatted (str): The formatted version of the telephone number.. [optional] # noqa: E501 - country (str): The country of the telephone number.. [optional] # noqa: E501 - line_type (str): The line type of the telephone number.. [optional] # noqa: E501 - line_provider (str): The messaging service provider of the telephone number.. [optional] # noqa: E501 - mobile_country_code (str): The first half of the Home Network Identity (HNI).. [optional] # noqa: E501 - mobile_network_code (str): The second half of the HNI.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/machine_detection_complete_callback.py b/bandwidth/model/machine_detection_complete_callback.py deleted file mode 100644 index 541ee149..00000000 --- a/bandwidth/model/machine_detection_complete_callback.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class MachineDetectionCompleteCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'machine_detection_result': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'machine_detection_result': 'machineDetectionResult', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MachineDetectionCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - machine_detection_result (str, none_type): (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MachineDetectionCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - machine_detection_result (str, none_type): (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/machine_detection_configuration.py b/bandwidth/model/machine_detection_configuration.py deleted file mode 100644 index 5a6bb396..00000000 --- a/bandwidth/model/machine_detection_configuration.py +++ /dev/null @@ -1,346 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.callback_method_enum import CallbackMethodEnum - from bandwidth.model.machine_detection_mode_enum import MachineDetectionModeEnum - globals()['CallbackMethodEnum'] = CallbackMethodEnum - globals()['MachineDetectionModeEnum'] = MachineDetectionModeEnum - - -class MachineDetectionConfiguration(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('callback_url',): { - 'max_length': 2048, - }, - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('fallback_url',): { - 'max_length': 2048, - }, - ('fallback_username',): { - 'max_length': 1024, - }, - ('fallback_password',): { - 'max_length': 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'mode': (MachineDetectionModeEnum,), # noqa: E501 - 'detection_timeout': (float, none_type,), # noqa: E501 - 'silence_timeout': (float, none_type,), # noqa: E501 - 'speech_threshold': (float, none_type,), # noqa: E501 - 'speech_end_threshold': (float, none_type,), # noqa: E501 - 'machine_speech_end_threshold': (float, none_type,), # noqa: E501 - 'delay_result': (bool, none_type,), # noqa: E501 - 'callback_url': (str, none_type,), # noqa: E501 - 'callback_method': (CallbackMethodEnum,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'fallback_url': (str, none_type,), # noqa: E501 - 'fallback_method': (CallbackMethodEnum,), # noqa: E501 - 'fallback_username': (str, none_type,), # noqa: E501 - 'fallback_password': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'mode': 'mode', # noqa: E501 - 'detection_timeout': 'detectionTimeout', # noqa: E501 - 'silence_timeout': 'silenceTimeout', # noqa: E501 - 'speech_threshold': 'speechThreshold', # noqa: E501 - 'speech_end_threshold': 'speechEndThreshold', # noqa: E501 - 'machine_speech_end_threshold': 'machineSpeechEndThreshold', # noqa: E501 - 'delay_result': 'delayResult', # noqa: E501 - 'callback_url': 'callbackUrl', # noqa: E501 - 'callback_method': 'callbackMethod', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'fallback_url': 'fallbackUrl', # noqa: E501 - 'fallback_method': 'fallbackMethod', # noqa: E501 - 'fallback_username': 'fallbackUsername', # noqa: E501 - 'fallback_password': 'fallbackPassword', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MachineDetectionConfiguration - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mode (MachineDetectionModeEnum): [optional] # noqa: E501 - detection_timeout (float, none_type): The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - silence_timeout (float, none_type): If no speech is detected in this period, a callback with a 'silence' result is sent.. [optional] if omitted the server will use the default value of 10 # noqa: E501 - speech_threshold (float, none_type): When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.. [optional] if omitted the server will use the default value of 10 # noqa: E501 - speech_end_threshold (float, none_type): Amount of silence (in seconds) before assuming the callee has finished speaking.. [optional] if omitted the server will use the default value of 5 # noqa: E501 - machine_speech_end_threshold (float, none_type): When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.. [optional] # noqa: E501 - delay_result (bool, none_type): If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.. [optional] if omitted the server will use the default value of False # noqa: E501 - callback_url (str, none_type): The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.. [optional] # noqa: E501 - callback_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - fallback_url (str, none_type): A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond. [optional] # noqa: E501 - fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MachineDetectionConfiguration - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mode (MachineDetectionModeEnum): [optional] # noqa: E501 - detection_timeout (float, none_type): The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - silence_timeout (float, none_type): If no speech is detected in this period, a callback with a 'silence' result is sent.. [optional] if omitted the server will use the default value of 10 # noqa: E501 - speech_threshold (float, none_type): When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.. [optional] if omitted the server will use the default value of 10 # noqa: E501 - speech_end_threshold (float, none_type): Amount of silence (in seconds) before assuming the callee has finished speaking.. [optional] if omitted the server will use the default value of 5 # noqa: E501 - machine_speech_end_threshold (float, none_type): When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.. [optional] # noqa: E501 - delay_result (bool, none_type): If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.. [optional] if omitted the server will use the default value of False # noqa: E501 - callback_url (str, none_type): The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.. [optional] # noqa: E501 - callback_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - fallback_url (str, none_type): A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond. [optional] # noqa: E501 - fallback_method (CallbackMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/machine_detection_mode_enum.py b/bandwidth/model/machine_detection_mode_enum.py deleted file mode 100644 index d5886bc8..00000000 --- a/bandwidth/model/machine_detection_mode_enum.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MachineDetectionModeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'SYNC': "sync", - 'ASYNC': "async", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """MachineDetectionModeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result.. if omitted defaults to "async", must be one of ["sync", "async", ] # noqa: E501 - - Keyword Args: - value (str): The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result.. if omitted defaults to "async", must be one of ["sync", "async", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "async" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """MachineDetectionModeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result.. if omitted defaults to "async", must be one of ["sync", "async", ] # noqa: E501 - - Keyword Args: - value (str): The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result.. if omitted defaults to "async", must be one of ["sync", "async", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "async" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/media.py b/bandwidth/model/media.py deleted file mode 100644 index 8697481d..00000000 --- a/bandwidth/model/media.py +++ /dev/null @@ -1,272 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class Media(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'content': (str,), # noqa: E501 - 'content_length': (int,), # noqa: E501 - 'media_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'content': 'content', # noqa: E501 - 'content_length': 'contentLength', # noqa: E501 - 'media_name': 'mediaName', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Media - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): [optional] # noqa: E501 - content_length (int): [optional] # noqa: E501 - media_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Media - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): [optional] # noqa: E501 - content_length (int): [optional] # noqa: E501 - media_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/message.py b/bandwidth/model/message.py deleted file mode 100644 index ee6cf16b..00000000 --- a/bandwidth/model/message.py +++ /dev/null @@ -1,320 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.message_direction_enum import MessageDirectionEnum - from bandwidth.model.priority_enum import PriorityEnum - globals()['MessageDirectionEnum'] = MessageDirectionEnum - globals()['PriorityEnum'] = PriorityEnum - - -class Message(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('to',): { - }, - ('media',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'id': (str,), # noqa: E501 - 'owner': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - 'time': (str,), # noqa: E501 - 'segment_count': (int,), # noqa: E501 - 'direction': (MessageDirectionEnum,), # noqa: E501 - 'to': ([str],), # noqa: E501 - '_from': (str,), # noqa: E501 - 'media': ([str],), # noqa: E501 - 'text': (str,), # noqa: E501 - 'tag': (str,), # noqa: E501 - 'priority': (PriorityEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'owner': 'owner', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - 'time': 'time', # noqa: E501 - 'segment_count': 'segmentCount', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'media': 'media', # noqa: E501 - 'text': 'text', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'priority': 'priority', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Message - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The id of the message.. [optional] # noqa: E501 - owner (str): The Bandwidth phone number associated with the message.. [optional] # noqa: E501 - application_id (str): The application ID associated with the message.. [optional] # noqa: E501 - time (str): The datetime stamp of the message in ISO 8601. [optional] # noqa: E501 - segment_count (int): The number of segments the original message from the user is broken into before sending over to carrier networks.. [optional] # noqa: E501 - direction (MessageDirectionEnum): [optional] # noqa: E501 - to ([str]): The phone number recipients of the message.. [optional] # noqa: E501 - _from (str): The phone number the message was sent from.. [optional] # noqa: E501 - media ([str]): The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name.. [optional] # noqa: E501 - text (str): The contents of the message.. [optional] # noqa: E501 - tag (str): The custom string set by the user.. [optional] # noqa: E501 - priority (PriorityEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Message - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The id of the message.. [optional] # noqa: E501 - owner (str): The Bandwidth phone number associated with the message.. [optional] # noqa: E501 - application_id (str): The application ID associated with the message.. [optional] # noqa: E501 - time (str): The datetime stamp of the message in ISO 8601. [optional] # noqa: E501 - segment_count (int): The number of segments the original message from the user is broken into before sending over to carrier networks.. [optional] # noqa: E501 - direction (MessageDirectionEnum): [optional] # noqa: E501 - to ([str]): The phone number recipients of the message.. [optional] # noqa: E501 - _from (str): The phone number the message was sent from.. [optional] # noqa: E501 - media ([str]): The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name.. [optional] # noqa: E501 - text (str): The contents of the message.. [optional] # noqa: E501 - tag (str): The custom string set by the user.. [optional] # noqa: E501 - priority (PriorityEnum): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/message_direction_enum.py b/bandwidth/model/message_direction_enum.py deleted file mode 100644 index 55c0ea7d..00000000 --- a/bandwidth/model/message_direction_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MessageDirectionEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'IN': "in", - 'OUT': "out", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """MessageDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the message. One of in out.., must be one of ["in", "out", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the message. One of in out.., must be one of ["in", "out", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """MessageDirectionEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The direction of the message. One of in out.., must be one of ["in", "out", ] # noqa: E501 - - Keyword Args: - value (str): The direction of the message. One of in out.., must be one of ["in", "out", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/message_request.py b/bandwidth/model/message_request.py deleted file mode 100644 index 10cd83a7..00000000 --- a/bandwidth/model/message_request.py +++ /dev/null @@ -1,313 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.priority_enum import PriorityEnum - globals()['PriorityEnum'] = PriorityEnum - - -class MessageRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('to',): { - }, - ('text',): { - 'max_length': 2048, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'application_id': (str,), # noqa: E501 - 'to': ([str],), # noqa: E501 - '_from': (str,), # noqa: E501 - 'text': (str,), # noqa: E501 - 'media': ([str],), # noqa: E501 - 'tag': (str,), # noqa: E501 - 'priority': (PriorityEnum,), # noqa: E501 - 'expiration': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'application_id': 'applicationId', # noqa: E501 - 'to': 'to', # noqa: E501 - '_from': 'from', # noqa: E501 - 'text': 'text', # noqa: E501 - 'media': 'media', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'priority': 'priority', # noqa: E501 - 'expiration': 'expiration', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, application_id, to, _from, *args, **kwargs): # noqa: E501 - """MessageRequest - a model defined in OpenAPI - - Args: - application_id (str): The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. - to ([str]): The phone number(s) the message should be sent to in E164 format. - _from (str): One of your telephone numbers the message should come from in E164 format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - text (str): The contents of the text message. Must be 2048 characters or less.. [optional] # noqa: E501 - media ([str]): A list of URLs to include as media attachments as part of the message.. [optional] # noqa: E501 - tag (str): A custom string that will be included in callback events of the message. Max 1024 characters.. [optional] # noqa: E501 - priority (PriorityEnum): [optional] # noqa: E501 - expiration (str): A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.application_id = application_id - self.to = to - self._from = _from - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, application_id, to, _from, *args, **kwargs): # noqa: E501 - """MessageRequest - a model defined in OpenAPI - - Args: - application_id (str): The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. - to ([str]): The phone number(s) the message should be sent to in E164 format. - _from (str): One of your telephone numbers the message should come from in E164 format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - text (str): The contents of the text message. Must be 2048 characters or less.. [optional] # noqa: E501 - media ([str]): A list of URLs to include as media attachments as part of the message.. [optional] # noqa: E501 - tag (str): A custom string that will be included in callback events of the message. Max 1024 characters.. [optional] # noqa: E501 - priority (PriorityEnum): [optional] # noqa: E501 - expiration (str): A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.application_id = application_id - self.to = to - self._from = _from - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/message_status_enum.py b/bandwidth/model/message_status_enum.py deleted file mode 100644 index ae1a3bf4..00000000 --- a/bandwidth/model/message_status_enum.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MessageStatusEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'RECEIVED': "RECEIVED", - 'QUEUED': "QUEUED", - 'SENDING': "SENDING", - 'SENT': "SENT", - 'FAILED': "FAILED", - 'DELIVERED': "DELIVERED", - 'ACCEPTED': "ACCEPTED", - 'UNDELIVERED': "UNDELIVERED", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """MessageStatusEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.., must be one of ["RECEIVED", "QUEUED", "SENDING", "SENT", "FAILED", "DELIVERED", "ACCEPTED", "UNDELIVERED", ] # noqa: E501 - - Keyword Args: - value (str): The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.., must be one of ["RECEIVED", "QUEUED", "SENDING", "SENT", "FAILED", "DELIVERED", "ACCEPTED", "UNDELIVERED", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """MessageStatusEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.., must be one of ["RECEIVED", "QUEUED", "SENDING", "SENT", "FAILED", "DELIVERED", "ACCEPTED", "UNDELIVERED", ] # noqa: E501 - - Keyword Args: - value (str): The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.., must be one of ["RECEIVED", "QUEUED", "SENDING", "SENT", "FAILED", "DELIVERED", "ACCEPTED", "UNDELIVERED", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/message_type_enum.py b/bandwidth/model/message_type_enum.py deleted file mode 100644 index b079b1c6..00000000 --- a/bandwidth/model/message_type_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MessageTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'SMS': "sms", - 'MMS': "mms", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """MessageTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The type of message. Either SMS or MMS.., must be one of ["sms", "mms", ] # noqa: E501 - - Keyword Args: - value (str): The type of message. Either SMS or MMS.., must be one of ["sms", "mms", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """MessageTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The type of message. Either SMS or MMS.., must be one of ["sms", "mms", ] # noqa: E501 - - Keyword Args: - value (str): The type of message. Either SMS or MMS.., must be one of ["sms", "mms", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/messages_list.py b/bandwidth/model/messages_list.py deleted file mode 100644 index bc402f76..00000000 --- a/bandwidth/model/messages_list.py +++ /dev/null @@ -1,280 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.list_message_item import ListMessageItem - from bandwidth.model.page_info import PageInfo - globals()['ListMessageItem'] = ListMessageItem - globals()['PageInfo'] = PageInfo - - -class MessagesList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'total_count': (int,), # noqa: E501 - 'page_info': (PageInfo,), # noqa: E501 - 'messages': ([ListMessageItem],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'total_count': 'totalCount', # noqa: E501 - 'page_info': 'pageInfo', # noqa: E501 - 'messages': 'messages', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MessagesList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - total_count (int): Total number of messages matched by the search.. [optional] # noqa: E501 - page_info (PageInfo): [optional] # noqa: E501 - messages ([ListMessageItem]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MessagesList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - total_count (int): Total number of messages matched by the search.. [optional] # noqa: E501 - page_info (PageInfo): [optional] # noqa: E501 - messages ([ListMessageItem]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/messaging_code_response.py b/bandwidth/model/messaging_code_response.py deleted file mode 100644 index 6c8be7e0..00000000 --- a/bandwidth/model/messaging_code_response.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MessagingCodeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'message_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'message_id': 'messageId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MessagingCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message_id (str): Messaging API Message ID.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MessagingCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message_id (str): Messaging API Message ID.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/messaging_request_error.py b/bandwidth/model/messaging_request_error.py deleted file mode 100644 index 5e93cdbe..00000000 --- a/bandwidth/model/messaging_request_error.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MessagingRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'description': 'description', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, description, *args, **kwargs): # noqa: E501 - """MessagingRequestError - a model defined in OpenAPI - - Args: - type (str): - description (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.description = description - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, description, *args, **kwargs): # noqa: E501 - """MessagingRequestError - a model defined in OpenAPI - - Args: - type (str): - description (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.description = description - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/mfa_forbidden_request_error.py b/bandwidth/model/mfa_forbidden_request_error.py deleted file mode 100644 index 3ae78245..00000000 --- a/bandwidth/model/mfa_forbidden_request_error.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MfaForbiddenRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MfaForbiddenRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): The message containing the reason behind the request being forbidden.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MfaForbiddenRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): The message containing the reason behind the request being forbidden.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/mfa_request_error.py b/bandwidth/model/mfa_request_error.py deleted file mode 100644 index 15140e01..00000000 --- a/bandwidth/model/mfa_request_error.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MfaRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'error': (str,), # noqa: E501 - 'request_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'error': 'error', # noqa: E501 - 'request_id': 'requestId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MfaRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error (str): A message describing the error with your request.. [optional] # noqa: E501 - request_id (str): The associated requestId from AWS.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MfaRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error (str): A message describing the error with your request.. [optional] # noqa: E501 - request_id (str): The associated requestId from AWS.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/mfa_unauthorized_request_error.py b/bandwidth/model/mfa_unauthorized_request_error.py deleted file mode 100644 index 1687509f..00000000 --- a/bandwidth/model/mfa_unauthorized_request_error.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class MfaUnauthorizedRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MfaUnauthorizedRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): Unauthorized. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MfaUnauthorizedRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): Unauthorized. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/page_info.py b/bandwidth/model/page_info.py deleted file mode 100644 index b84e4380..00000000 --- a/bandwidth/model/page_info.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class PageInfo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'prev_page': (str,), # noqa: E501 - 'next_page': (str,), # noqa: E501 - 'prev_page_token': (str,), # noqa: E501 - 'next_page_token': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'prev_page': 'prevPage', # noqa: E501 - 'next_page': 'nextPage', # noqa: E501 - 'prev_page_token': 'prevPageToken', # noqa: E501 - 'next_page_token': 'nextPageToken', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PageInfo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - prev_page (str): The link to the previous page for pagination.. [optional] # noqa: E501 - next_page (str): The link to the next page for pagination.. [optional] # noqa: E501 - prev_page_token (str): The isolated pagination token for the previous page.. [optional] # noqa: E501 - next_page_token (str): The isolated pagination token for the next page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PageInfo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - prev_page (str): The link to the previous page for pagination.. [optional] # noqa: E501 - next_page (str): The link to the next page for pagination.. [optional] # noqa: E501 - prev_page_token (str): The isolated pagination token for the previous page.. [optional] # noqa: E501 - next_page_token (str): The isolated pagination token for the next page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/priority_enum.py b/bandwidth/model/priority_enum.py deleted file mode 100644 index 1b327dc6..00000000 --- a/bandwidth/model/priority_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class PriorityEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'DEFAULT': "default", - 'HIGH': "high", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """PriorityEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The priority specified by the user.., must be one of ["default", "high", ] # noqa: E501 - - Keyword Args: - value (str): The priority specified by the user.., must be one of ["default", "high", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """PriorityEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The priority specified by the user.., must be one of ["default", "high", ] # noqa: E501 - - Keyword Args: - value (str): The priority specified by the user.., must be one of ["default", "high", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/recording_available_callback.py b/bandwidth/model/recording_available_callback.py deleted file mode 100644 index 763958bf..00000000 --- a/bandwidth/model/recording_available_callback.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - from bandwidth.model.file_format_enum import FileFormatEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - globals()['FileFormatEnum'] = FileFormatEnum - - -class RecordingAvailableCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'channels': (str,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'status': 'status', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """RecordingAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - channels (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """RecordingAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - channels (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/recording_complete_callback.py b/bandwidth/model/recording_complete_callback.py deleted file mode 100644 index c9c343ce..00000000 --- a/bandwidth/model/recording_complete_callback.py +++ /dev/null @@ -1,356 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - from bandwidth.model.file_format_enum import FileFormatEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - globals()['FileFormatEnum'] = FileFormatEnum - - -class RecordingCompleteCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'channels': (int,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'channels': 'channels', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """RecordingCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """RecordingCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - channels (int): Always `1` for conference recordings; multi-channel recordings are not supported on conferences.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/recording_state_enum.py b/bandwidth/model/recording_state_enum.py deleted file mode 100644 index 9d2fa7a4..00000000 --- a/bandwidth/model/recording_state_enum.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class RecordingStateEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'PAUSED': "paused", - 'RECORDING': "recording", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """RecordingStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording., must be one of ["paused", "recording", ] # noqa: E501 - - Keyword Args: - value (str): The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording., must be one of ["paused", "recording", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """RecordingStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording., must be one of ["paused", "recording", ] # noqa: E501 - - Keyword Args: - value (str): The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording., must be one of ["paused", "recording", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/redirect_callback.py b/bandwidth/model/redirect_callback.py deleted file mode 100644 index 623bcd39..00000000 --- a/bandwidth/model/redirect_callback.py +++ /dev/null @@ -1,330 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class RedirectCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """RedirectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """RedirectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/redirect_method_enum.py b/bandwidth/model/redirect_method_enum.py deleted file mode 100644 index 79dc4c78..00000000 --- a/bandwidth/model/redirect_method_enum.py +++ /dev/null @@ -1,284 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class RedirectMethodEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'GET': "GET", - 'POST': "POST", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """RedirectMethodEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - - Keyword Args: - value (str): The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "POST" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """RedirectMethodEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - - Keyword Args: - value (str): The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. if omitted defaults to "POST", must be one of ["GET", "POST", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "POST" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/bandwidth/model/stir_shaken.py b/bandwidth/model/stir_shaken.py deleted file mode 100644 index 6d317c48..00000000 --- a/bandwidth/model/stir_shaken.py +++ /dev/null @@ -1,272 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class StirShaken(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'verstat': (str,), # noqa: E501 - 'attestation_indicator': (str,), # noqa: E501 - 'originating_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'verstat': 'verstat', # noqa: E501 - 'attestation_indicator': 'attestationIndicator', # noqa: E501 - 'originating_id': 'originatingId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StirShaken - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - verstat (str): (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed.. [optional] # noqa: E501 - attestation_indicator (str): (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway).. [optional] # noqa: E501 - originating_id (str): (optional) A unique origination identifier.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StirShaken - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - verstat (str): (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed.. [optional] # noqa: E501 - attestation_indicator (str): (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway).. [optional] # noqa: E501 - originating_id (str): (optional) A unique origination identifier.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/tag.py b/bandwidth/model/tag.py deleted file mode 100644 index fd8ae00b..00000000 --- a/bandwidth/model/tag.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class Tag(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'key': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'key': 'key', # noqa: E501 - 'value': 'value', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - value (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - value (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/tn_lookup_request_error.py b/bandwidth/model/tn_lookup_request_error.py deleted file mode 100644 index 59fdc4c3..00000000 --- a/bandwidth/model/tn_lookup_request_error.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class TnLookupRequestError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TnLookupRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): A description of what validation error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TnLookupRequestError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): A description of what validation error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transcribe_recording.py b/bandwidth/model/transcribe_recording.py deleted file mode 100644 index e1734c47..00000000 --- a/bandwidth/model/transcribe_recording.py +++ /dev/null @@ -1,300 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.callback_method_enum import CallbackMethodEnum - globals()['CallbackMethodEnum'] = CallbackMethodEnum - - -class TranscribeRecording(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('callback_timeout',): { - 'inclusive_maximum': 25, - 'inclusive_minimum': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'callback_url': (str,), # noqa: E501 - 'callback_method': (CallbackMethodEnum,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'callback_timeout': (float, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'callback_url': 'callbackUrl', # noqa: E501 - 'callback_method': 'callbackMethod', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'callback_timeout': 'callbackTimeout', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TranscribeRecording - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization.. [optional] # noqa: E501 - callback_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - callback_timeout (float, none_type): This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TranscribeRecording - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization.. [optional] # noqa: E501 - callback_method (CallbackMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - callback_timeout (float, none_type): This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25.. [optional] if omitted the server will use the default value of 15 # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transcription.py b/bandwidth/model/transcription.py deleted file mode 100644 index d3b6af75..00000000 --- a/bandwidth/model/transcription.py +++ /dev/null @@ -1,268 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class Transcription(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'text': (str,), # noqa: E501 - 'confidence': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'text': 'text', # noqa: E501 - 'confidence': 'confidence', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Transcription - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - text (str): The transcribed text. [optional] # noqa: E501 - confidence (float): The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Transcription - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - text (str): The transcribed text. [optional] # noqa: E501 - confidence (float): The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transcription_available_callback.py b/bandwidth/model/transcription_available_callback.py deleted file mode 100644 index e4293b59..00000000 --- a/bandwidth/model/transcription_available_callback.py +++ /dev/null @@ -1,354 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - from bandwidth.model.file_format_enum import FileFormatEnum - from bandwidth.model.transcription import Transcription - globals()['CallDirectionEnum'] = CallDirectionEnum - globals()['FileFormatEnum'] = FileFormatEnum - globals()['Transcription'] = Transcription - - -class TranscriptionAvailableCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'media_url': (str, none_type,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'recording_id': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'duration': (str,), # noqa: E501 - 'file_format': (FileFormatEnum,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transcription': (Transcription,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'media_url': 'mediaUrl', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'recording_id': 'recordingId', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'duration': 'duration', # noqa: E501 - 'file_format': 'fileFormat', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transcription': 'transcription', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TranscriptionAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transcription (Transcription): [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TranscriptionAvailableCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - media_url (str, none_type): The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - recording_id (str): The unique ID of this recording. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - duration (str): The duration of the recording in ISO-8601 format. [optional] # noqa: E501 - file_format (FileFormatEnum): [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transcription (Transcription): [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transcription_list.py b/bandwidth/model/transcription_list.py deleted file mode 100644 index 0f13ff50..00000000 --- a/bandwidth/model/transcription_list.py +++ /dev/null @@ -1,270 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.transcription import Transcription - globals()['Transcription'] = Transcription - - -class TranscriptionList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'transcripts': ([Transcription],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'transcripts': 'transcripts', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TranscriptionList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - transcripts ([Transcription]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TranscriptionList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - transcripts ([Transcription]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transcription_metadata.py b/bandwidth/model/transcription_metadata.py deleted file mode 100644 index 57c3d9b7..00000000 --- a/bandwidth/model/transcription_metadata.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class TranscriptionMetadata(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'completed_time': (str,), # noqa: E501 - 'url': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'status': 'status', # noqa: E501 - 'completed_time': 'completedTime', # noqa: E501 - 'url': 'url', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TranscriptionMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The unique transcription ID. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - completed_time (str): The time that the transcription was completed. [optional] # noqa: E501 - url (str): The URL of the [transcription](#operation/getCallTranscription). [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TranscriptionMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The unique transcription ID. [optional] # noqa: E501 - status (str): The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.. [optional] # noqa: E501 - completed_time (str): The time that the transcription was completed. [optional] # noqa: E501 - url (str): The URL of the [transcription](#operation/getCallTranscription). [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transfer_answer_callback.py b/bandwidth/model/transfer_answer_callback.py deleted file mode 100644 index 4ce270ee..00000000 --- a/bandwidth/model/transfer_answer_callback.py +++ /dev/null @@ -1,326 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class TransferAnswerCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TransferAnswerCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TransferAnswerCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transfer_complete_callback.py b/bandwidth/model/transfer_complete_callback.py deleted file mode 100644 index bed22812..00000000 --- a/bandwidth/model/transfer_complete_callback.py +++ /dev/null @@ -1,338 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class TransferCompleteCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'cause': (str,), # noqa: E501 - 'error_message': (str, none_type,), # noqa: E501 - 'error_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'cause': 'cause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TransferCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TransferCompleteCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/transfer_disconnect_callback.py b/bandwidth/model/transfer_disconnect_callback.py deleted file mode 100644 index c58f6844..00000000 --- a/bandwidth/model/transfer_disconnect_callback.py +++ /dev/null @@ -1,346 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_direction_enum import CallDirectionEnum - globals()['CallDirectionEnum'] = CallDirectionEnum - - -class TransferDisconnectCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_type': (str,), # noqa: E501 - 'event_time': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'application_id': (str,), # noqa: E501 - '_from': (str,), # noqa: E501 - 'to': (str,), # noqa: E501 - 'direction': (CallDirectionEnum,), # noqa: E501 - 'call_id': (str,), # noqa: E501 - 'call_url': (str,), # noqa: E501 - 'parent_call_id': (str,), # noqa: E501 - 'enqueued_time': (datetime, none_type,), # noqa: E501 - 'start_time': (datetime,), # noqa: E501 - 'answer_time': (datetime, none_type,), # noqa: E501 - 'end_time': (datetime,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - 'transfer_caller_id': (str,), # noqa: E501 - 'transfer_to': (str,), # noqa: E501 - 'cause': (str,), # noqa: E501 - 'error_message': (str, none_type,), # noqa: E501 - 'error_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'event_type': 'eventType', # noqa: E501 - 'event_time': 'eventTime', # noqa: E501 - 'account_id': 'accountId', # noqa: E501 - 'application_id': 'applicationId', # noqa: E501 - '_from': 'from', # noqa: E501 - 'to': 'to', # noqa: E501 - 'direction': 'direction', # noqa: E501 - 'call_id': 'callId', # noqa: E501 - 'call_url': 'callUrl', # noqa: E501 - 'parent_call_id': 'parentCallId', # noqa: E501 - 'enqueued_time': 'enqueuedTime', # noqa: E501 - 'start_time': 'startTime', # noqa: E501 - 'answer_time': 'answerTime', # noqa: E501 - 'end_time': 'endTime', # noqa: E501 - 'tag': 'tag', # noqa: E501 - 'transfer_caller_id': 'transferCallerId', # noqa: E501 - 'transfer_to': 'transferTo', # noqa: E501 - 'cause': 'cause', # noqa: E501 - 'error_message': 'errorMessage', # noqa: E501 - 'error_id': 'errorId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TransferDisconnectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TransferDisconnectCallback - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_type (str): The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.. [optional] # noqa: E501 - event_time (str): The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.. [optional] # noqa: E501 - account_id (str): The user account associated with the call.. [optional] # noqa: E501 - application_id (str): The id of the application associated with the call.. [optional] # noqa: E501 - _from (str): The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.. [optional] # noqa: E501 - to (str): The phone number that received the call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - direction (CallDirectionEnum): [optional] # noqa: E501 - call_id (str): The call id associated with the event.. [optional] # noqa: E501 - call_url (str): The URL of the call associated with the event.. [optional] # noqa: E501 - parent_call_id (str): (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.. [optional] # noqa: E501 - enqueued_time (datetime, none_type): (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.. [optional] # noqa: E501 - start_time (datetime): Time the call was started, in ISO 8601 format.. [optional] # noqa: E501 - answer_time (datetime, none_type): Time the call was answered, in ISO 8601 format.. [optional] # noqa: E501 - end_time (datetime): The time that the recording ended in ISO-8601 format. [optional] # noqa: E501 - tag (str, none_type): (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.. [optional] # noqa: E501 - transfer_caller_id (str): The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.. [optional] # noqa: E501 - transfer_to (str): The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).. [optional] # noqa: E501 - cause (str): Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.. [optional] # noqa: E501 - error_message (str, none_type): Text explaining the reason that caused the call to fail in case of errors.. [optional] # noqa: E501 - error_id (str, none_type): Bandwidth's internal id that references the error event.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/update_call.py b/bandwidth/model/update_call.py deleted file mode 100644 index 41dd1dcb..00000000 --- a/bandwidth/model/update_call.py +++ /dev/null @@ -1,322 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.call_state_enum import CallStateEnum - from bandwidth.model.redirect_method_enum import RedirectMethodEnum - globals()['CallStateEnum'] = CallStateEnum - globals()['RedirectMethodEnum'] = RedirectMethodEnum - - -class UpdateCall(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('fallback_username',): { - 'max_length': 1024, - }, - ('fallback_password',): { - 'max_length': 1024, - }, - ('tag',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'state': (CallStateEnum,), # noqa: E501 - 'redirect_url': (str, none_type,), # noqa: E501 - 'redirect_method': (RedirectMethodEnum,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'redirect_fallback_url': (str, none_type,), # noqa: E501 - 'redirect_fallback_method': (RedirectMethodEnum,), # noqa: E501 - 'fallback_username': (str, none_type,), # noqa: E501 - 'fallback_password': (str, none_type,), # noqa: E501 - 'tag': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'state': 'state', # noqa: E501 - 'redirect_url': 'redirectUrl', # noqa: E501 - 'redirect_method': 'redirectMethod', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'redirect_fallback_url': 'redirectFallbackUrl', # noqa: E501 - 'redirect_fallback_method': 'redirectFallbackMethod', # noqa: E501 - 'fallback_username': 'fallbackUsername', # noqa: E501 - 'fallback_password': 'fallbackPassword', # noqa: E501 - 'tag': 'tag', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UpdateCall - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - state (CallStateEnum): [optional] # noqa: E501 - redirect_url (str, none_type): The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - redirect_method (RedirectMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - redirect_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. [optional] # noqa: E501 - redirect_fallback_method (RedirectMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - tag (str, none_type): A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UpdateCall - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - state (CallStateEnum): [optional] # noqa: E501 - redirect_url (str, none_type): The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - redirect_method (RedirectMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - redirect_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. [optional] # noqa: E501 - redirect_fallback_method (RedirectMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - tag (str, none_type): A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/update_call_recording.py b/bandwidth/model/update_call_recording.py deleted file mode 100644 index 655b2283..00000000 --- a/bandwidth/model/update_call_recording.py +++ /dev/null @@ -1,276 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.recording_state_enum import RecordingStateEnum - globals()['RecordingStateEnum'] = RecordingStateEnum - - -class UpdateCallRecording(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'state': (RecordingStateEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'state': 'state', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, state, *args, **kwargs): # noqa: E501 - """UpdateCallRecording - a model defined in OpenAPI - - Args: - state (RecordingStateEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, state, *args, **kwargs): # noqa: E501 - """UpdateCallRecording - a model defined in OpenAPI - - Args: - state (RecordingStateEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/update_conference.py b/bandwidth/model/update_conference.py deleted file mode 100644 index 68b2c2dc..00000000 --- a/bandwidth/model/update_conference.py +++ /dev/null @@ -1,316 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - -def lazy_import(): - from bandwidth.model.conference_state_enum import ConferenceStateEnum - from bandwidth.model.redirect_method_enum import RedirectMethodEnum - globals()['ConferenceStateEnum'] = ConferenceStateEnum - globals()['RedirectMethodEnum'] = RedirectMethodEnum - - -class UpdateConference(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('username',): { - 'max_length': 1024, - }, - ('password',): { - 'max_length': 1024, - }, - ('fallback_username',): { - 'max_length': 1024, - }, - ('fallback_password',): { - 'max_length': 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'status': (ConferenceStateEnum,), # noqa: E501 - 'redirect_url': (str, none_type,), # noqa: E501 - 'redirect_method': (RedirectMethodEnum,), # noqa: E501 - 'username': (str, none_type,), # noqa: E501 - 'password': (str, none_type,), # noqa: E501 - 'redirect_fallback_url': (str, none_type,), # noqa: E501 - 'redirect_fallback_method': (RedirectMethodEnum,), # noqa: E501 - 'fallback_username': (str, none_type,), # noqa: E501 - 'fallback_password': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'status': 'status', # noqa: E501 - 'redirect_url': 'redirectUrl', # noqa: E501 - 'redirect_method': 'redirectMethod', # noqa: E501 - 'username': 'username', # noqa: E501 - 'password': 'password', # noqa: E501 - 'redirect_fallback_url': 'redirectFallbackUrl', # noqa: E501 - 'redirect_fallback_method': 'redirectFallbackMethod', # noqa: E501 - 'fallback_username': 'fallbackUsername', # noqa: E501 - 'fallback_password': 'fallbackPassword', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UpdateConference - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - status (ConferenceStateEnum): [optional] # noqa: E501 - redirect_url (str, none_type): The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. [optional] # noqa: E501 - redirect_method (RedirectMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - redirect_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - redirect_fallback_method (RedirectMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UpdateConference - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - status (ConferenceStateEnum): [optional] # noqa: E501 - redirect_url (str, none_type): The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. [optional] # noqa: E501 - redirect_method (RedirectMethodEnum): [optional] # noqa: E501 - username (str, none_type): Basic auth username.. [optional] # noqa: E501 - password (str, none_type): Basic auth password.. [optional] # noqa: E501 - redirect_fallback_url (str, none_type): A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`.. [optional] # noqa: E501 - redirect_fallback_method (RedirectMethodEnum): [optional] # noqa: E501 - fallback_username (str, none_type): Basic auth username.. [optional] # noqa: E501 - fallback_password (str, none_type): Basic auth password.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/update_conference_member.py b/bandwidth/model/update_conference_member.py deleted file mode 100644 index b495a683..00000000 --- a/bandwidth/model/update_conference_member.py +++ /dev/null @@ -1,272 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class UpdateConferenceMember(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'mute': (bool,), # noqa: E501 - 'hold': (bool,), # noqa: E501 - 'call_ids_to_coach': ([str], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'mute': 'mute', # noqa: E501 - 'hold': 'hold', # noqa: E501 - 'call_ids_to_coach': 'callIdsToCoach', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UpdateConferenceMember - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mute (bool): Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted.. [optional] # noqa: E501 - hold (bool): Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted.. [optional] # noqa: E501 - call_ids_to_coach ([str], none_type): If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UpdateConferenceMember - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mute (bool): Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted.. [optional] # noqa: E501 - hold (bool): Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted.. [optional] # noqa: E501 - call_ids_to_coach ([str], none_type): If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/verify_code_request.py b/bandwidth/model/verify_code_request.py deleted file mode 100644 index f545bb94..00000000 --- a/bandwidth/model/verify_code_request.py +++ /dev/null @@ -1,299 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class VerifyCodeRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('to',): { - 'regex': { - 'pattern': r'^\+[1-9]\d{1,14}$', # noqa: E501 - }, - }, - ('expiration_time_in_minutes',): { - 'inclusive_maximum': 15, - 'inclusive_minimum': 1, - }, - ('code',): { - 'max_length': 8, - 'min_length': 4, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'to': (str,), # noqa: E501 - 'expiration_time_in_minutes': (float,), # noqa: E501 - 'code': (str,), # noqa: E501 - 'scope': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'to': 'to', # noqa: E501 - 'expiration_time_in_minutes': 'expirationTimeInMinutes', # noqa: E501 - 'code': 'code', # noqa: E501 - 'scope': 'scope', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, to, expiration_time_in_minutes, code, *args, **kwargs): # noqa: E501 - """VerifyCodeRequest - a model defined in OpenAPI - - Args: - to (str): The phone number to send the mfa code to. - expiration_time_in_minutes (float): The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. - code (str): The generated mfa code to check if valid. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - scope (str): An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self.expiration_time_in_minutes = expiration_time_in_minutes - self.code = code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, to, expiration_time_in_minutes, code, *args, **kwargs): # noqa: E501 - """VerifyCodeRequest - a model defined in OpenAPI - - Args: - to (str): The phone number to send the mfa code to. - expiration_time_in_minutes (float): The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. - code (str): The generated mfa code to check if valid. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - scope (str): An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.to = to - self.expiration_time_in_minutes = expiration_time_in_minutes - self.code = code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/verify_code_response.py b/bandwidth/model/verify_code_response.py deleted file mode 100644 index 7bdf2a28..00000000 --- a/bandwidth/model/verify_code_response.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class VerifyCodeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'valid': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'valid': 'valid', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """VerifyCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - valid (bool): Whether or not the supplied code is valid.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """VerifyCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - valid (bool): Whether or not the supplied code is valid.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/voice_api_error.py b/bandwidth/model/voice_api_error.py deleted file mode 100644 index 60db4a01..00000000 --- a/bandwidth/model/voice_api_error.py +++ /dev/null @@ -1,272 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class VoiceApiError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'type': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'description': 'description', # noqa: E501 - 'id': 'id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """VoiceApiError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """VoiceApiError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model/voice_code_response.py b/bandwidth/model/voice_code_response.py deleted file mode 100644 index bcac5e84..00000000 --- a/bandwidth/model/voice_code_response.py +++ /dev/null @@ -1,264 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from bandwidth.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from bandwidth.exceptions import ApiAttributeError - - - -class VoiceCodeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'call_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'call_id': 'callId', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """VoiceCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - call_id (str): Programmable Voice API Call ID.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """VoiceCodeResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - call_id (str): Programmable Voice API Call ID.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/bandwidth/model_utils.py b/bandwidth/model_utils.py deleted file mode 100644 index afcb49b8..00000000 --- a/bandwidth/model_utils.py +++ /dev/null @@ -1,2059 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from bandwidth.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - item[0], model_to_dict( - item[1], serialize=serialize)) if hasattr( - item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - elif isinstance(v, dict): - res.append(dict(map( - extract_item, - v.items() - ))) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res - elif isinstance(value, dict): - result[attr] = dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index c2d49faf..18c7b0a3 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -1,90 +1,105 @@ +# coding: utf-8 + # flake8: noqa +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from bandwidth.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) -from bandwidth.model.account_statistics import AccountStatistics -from bandwidth.model.answer_callback import AnswerCallback -from bandwidth.model.bridge_complete_callback import BridgeCompleteCallback -from bandwidth.model.bridge_target_complete_callback import BridgeTargetCompleteCallback -from bandwidth.model.call_direction_enum import CallDirectionEnum -from bandwidth.model.call_recording_metadata import CallRecordingMetadata -from bandwidth.model.call_state import CallState -from bandwidth.model.call_state_enum import CallStateEnum -from bandwidth.model.callback_method_enum import CallbackMethodEnum -from bandwidth.model.code_request import CodeRequest -from bandwidth.model.conference import Conference -from bandwidth.model.conference_completed_callback import ConferenceCompletedCallback -from bandwidth.model.conference_created_callback import ConferenceCreatedCallback -from bandwidth.model.conference_member import ConferenceMember -from bandwidth.model.conference_member_exit_callback import ConferenceMemberExitCallback -from bandwidth.model.conference_member_join_callback import ConferenceMemberJoinCallback -from bandwidth.model.conference_recording_available_callback import ConferenceRecordingAvailableCallback -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata -from bandwidth.model.conference_redirect_callback import ConferenceRedirectCallback -from bandwidth.model.conference_state_enum import ConferenceStateEnum -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.create_lookup_response import CreateLookupResponse -from bandwidth.model.create_message_request_error import CreateMessageRequestError -from bandwidth.model.deferred_result import DeferredResult -from bandwidth.model.disconenct_callback import DisconenctCallback -from bandwidth.model.diversion import Diversion -from bandwidth.model.dtmf_callback import DtmfCallback -from bandwidth.model.field_error import FieldError -from bandwidth.model.file_format_enum import FileFormatEnum -from bandwidth.model.gather_callback import GatherCallback -from bandwidth.model.initiate_callback import InitiateCallback -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum -from bandwidth.model.list_message_item import ListMessageItem -from bandwidth.model.lookup_request import LookupRequest -from bandwidth.model.lookup_result import LookupResult -from bandwidth.model.lookup_status import LookupStatus -from bandwidth.model.lookup_status_enum import LookupStatusEnum -from bandwidth.model.machine_detection_complete_callback import MachineDetectionCompleteCallback -from bandwidth.model.machine_detection_configuration import MachineDetectionConfiguration -from bandwidth.model.machine_detection_mode_enum import MachineDetectionModeEnum -from bandwidth.model.media import Media -from bandwidth.model.message import Message -from bandwidth.model.message_direction_enum import MessageDirectionEnum -from bandwidth.model.message_request import MessageRequest -from bandwidth.model.message_status_enum import MessageStatusEnum -from bandwidth.model.message_type_enum import MessageTypeEnum -from bandwidth.model.messages_list import MessagesList -from bandwidth.model.messaging_code_response import MessagingCodeResponse -from bandwidth.model.messaging_request_error import MessagingRequestError -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError -from bandwidth.model.mfa_request_error import MfaRequestError -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError -from bandwidth.model.page_info import PageInfo -from bandwidth.model.priority_enum import PriorityEnum -from bandwidth.model.recording_available_callback import RecordingAvailableCallback -from bandwidth.model.recording_complete_callback import RecordingCompleteCallback -from bandwidth.model.recording_state_enum import RecordingStateEnum -from bandwidth.model.redirect_callback import RedirectCallback -from bandwidth.model.redirect_method_enum import RedirectMethodEnum -from bandwidth.model.stir_shaken import StirShaken -from bandwidth.model.tag import Tag -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError -from bandwidth.model.transcribe_recording import TranscribeRecording -from bandwidth.model.transcription import Transcription -from bandwidth.model.transcription_available_callback import TranscriptionAvailableCallback -from bandwidth.model.transcription_list import TranscriptionList -from bandwidth.model.transcription_metadata import TranscriptionMetadata -from bandwidth.model.transfer_answer_callback import TransferAnswerCallback -from bandwidth.model.transfer_complete_callback import TransferCompleteCallback -from bandwidth.model.transfer_disconnect_callback import TransferDisconnectCallback -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.update_call_recording import UpdateCallRecording -from bandwidth.model.update_conference import UpdateConference -from bandwidth.model.update_conference_member import UpdateConferenceMember -from bandwidth.model.verify_code_request import VerifyCodeRequest -from bandwidth.model.verify_code_response import VerifyCodeResponse -from bandwidth.model.voice_api_error import VoiceApiError -from bandwidth.model.voice_code_response import VoiceCodeResponse +# import models into model package +from bandwidth.models.account_statistics import AccountStatistics +from bandwidth.models.answer_callback import AnswerCallback +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.conference import Conference +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback +from bandwidth.models.conference_member import ConferenceMember +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback +from bandwidth.models.conference_state_enum import ConferenceStateEnum +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.create_message_request_error import CreateMessageRequestError +from bandwidth.models.deferred_result import DeferredResult +from bandwidth.models.disconnect_callback import DisconnectCallback +from bandwidth.models.diversion import Diversion +from bandwidth.models.dtmf_callback import DtmfCallback +from bandwidth.models.field_error import FieldError +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.gather_callback import GatherCallback +from bandwidth.models.inbound_message_callback import InboundMessageCallback +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage +from bandwidth.models.initiate_callback import InitiateCallback +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.list_message_item import ListMessageItem +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.models.lookup_result import LookupResult +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.models.lookup_status_enum import LookupStatusEnum +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum +from bandwidth.models.machine_detection_result import MachineDetectionResult +from bandwidth.models.media import Media +from bandwidth.models.message import Message +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.message_failed_callback import MessageFailedCallback +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage +from bandwidth.models.message_request import MessageRequest +from bandwidth.models.message_sending_callback import MessageSendingCallback +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.messages_list import MessagesList +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.models.messaging_request_error import MessagingRequestError +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError +from bandwidth.models.mfa_request_error import MfaRequestError +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError +from bandwidth.models.page_info import PageInfo +from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.recording_available_callback import RecordingAvailableCallback +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback +from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.redirect_callback import RedirectCallback +from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.stir_shaken import StirShaken +from bandwidth.models.tag import Tag +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError +from bandwidth.models.transcribe_recording import TranscribeRecording +from bandwidth.models.transcription import Transcription +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback +from bandwidth.models.transcription_list import TranscriptionList +from bandwidth.models.transcription_metadata import TranscriptionMetadata +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback +from bandwidth.models.update_call import UpdateCall +from bandwidth.models.update_call_recording import UpdateCallRecording +from bandwidth.models.update_conference import UpdateConference +from bandwidth.models.update_conference_member import UpdateConferenceMember +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse +from bandwidth.models.voice_api_error import VoiceApiError +from bandwidth.models.voice_code_response import VoiceCodeResponse diff --git a/bandwidth/models/account_statistics.py b/bandwidth/models/account_statistics.py new file mode 100644 index 00000000..e1e5c3f7 --- /dev/null +++ b/bandwidth/models/account_statistics.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt + +class AccountStatistics(BaseModel): + """ + AccountStatistics + """ + current_call_queue_size: Optional[StrictInt] = Field(None, alias="currentCallQueueSize", description="The number of calls currently enqueued.") + max_call_queue_size: Optional[StrictInt] = Field(None, alias="maxCallQueueSize", description="The maximum size of the queue before outgoing calls start being rejected.") + additional_properties: Dict[str, Any] = {} + __properties = ["currentCallQueueSize", "maxCallQueueSize"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> AccountStatistics: + """Create an instance of AccountStatistics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> AccountStatistics: + """Create an instance of AccountStatistics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return AccountStatistics.parse_obj(obj) + + _obj = AccountStatistics.parse_obj({ + "current_call_queue_size": obj.get("currentCallQueueSize"), + "max_call_queue_size": obj.get("maxCallQueueSize") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/answer_callback.py b/bandwidth/models/answer_callback.py new file mode 100644 index 00000000..9aa0fb21 --- /dev/null +++ b/bandwidth/models/answer_callback.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.machine_detection_result import MachineDetectionResult + +class AnswerCallback(BaseModel): + """ + The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + machine_detection_result: Optional[MachineDetectionResult] = Field(None, alias="machineDetectionResult") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> AnswerCallback: + """Create an instance of AnswerCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of machine_detection_result + if self.machine_detection_result: + _dict['machineDetectionResult'] = self.machine_detection_result.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if machine_detection_result (nullable) is None + # and __fields_set__ contains the field + if self.machine_detection_result is None and "machine_detection_result" in self.__fields_set__: + _dict['machineDetectionResult'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> AnswerCallback: + """Create an instance of AnswerCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return AnswerCallback.parse_obj(obj) + + _obj = AnswerCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "machine_detection_result": MachineDetectionResult.from_dict(obj.get("machineDetectionResult")) if obj.get("machineDetectionResult") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/bridge_complete_callback.py b/bandwidth/models/bridge_complete_callback.py new file mode 100644 index 00000000..e81022c8 --- /dev/null +++ b/bandwidth/models/bridge_complete_callback.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class BridgeCompleteCallback(BaseModel): + """ + If the target call leaves the , then this callback is sent to the bridgeCompleteUrl, and the BXML returned in it is executed on the call. If this webhook is sent, the Bridge Target Complete webhook is NOT sent. This callback is also sent if any problem occurs that prevents the calls to be bridged. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") + error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.") + error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "cause", "errorMessage", "errorId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BridgeCompleteCallback: + """Create an instance of BridgeCompleteCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if error_message (nullable) is None + # and __fields_set__ contains the field + if self.error_message is None and "error_message" in self.__fields_set__: + _dict['errorMessage'] = None + + # set to None if error_id (nullable) is None + # and __fields_set__ contains the field + if self.error_id is None and "error_id" in self.__fields_set__: + _dict['errorId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BridgeCompleteCallback: + """Create an instance of BridgeCompleteCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BridgeCompleteCallback.parse_obj(obj) + + _obj = BridgeCompleteCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "cause": obj.get("cause"), + "error_message": obj.get("errorMessage"), + "error_id": obj.get("errorId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/bridge_target_complete_callback.py b/bandwidth/models/bridge_target_complete_callback.py new file mode 100644 index 00000000..7e384d95 --- /dev/null +++ b/bandwidth/models/bridge_target_complete_callback.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class BridgeTargetCompleteCallback(BaseModel): + """ + If the originating call leaves the , then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BridgeTargetCompleteCallback: + """Create an instance of BridgeTargetCompleteCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BridgeTargetCompleteCallback: + """Create an instance of BridgeTargetCompleteCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BridgeTargetCompleteCallback.parse_obj(obj) + + _obj = BridgeTargetCompleteCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/bxml/__init__.py b/bandwidth/models/bxml/__init__.py new file mode 100644 index 00000000..32a84c4c --- /dev/null +++ b/bandwidth/models/bxml/__init__.py @@ -0,0 +1,6 @@ +from .bxml import Bxml +from .response import Response +from .root import Root +from .terminal_verb import TerminalVerb +from .verb import Verb +from .verbs import * diff --git a/bandwidth/model/bxml/bxml.py b/bandwidth/models/bxml/bxml.py similarity index 100% rename from bandwidth/model/bxml/bxml.py rename to bandwidth/models/bxml/bxml.py diff --git a/bandwidth/model/bxml/response.py b/bandwidth/models/bxml/response.py similarity index 100% rename from bandwidth/model/bxml/response.py rename to bandwidth/models/bxml/response.py diff --git a/bandwidth/model/bxml/root.py b/bandwidth/models/bxml/root.py similarity index 97% rename from bandwidth/model/bxml/root.py rename to bandwidth/models/bxml/root.py index dd5e46ed..441b218d 100644 --- a/bandwidth/model/bxml/root.py +++ b/bandwidth/models/bxml/root.py @@ -8,7 +8,7 @@ from typing import List import xml.etree.ElementTree as ET -from bandwidth.model.bxml.verb import Verb +from bandwidth.models.bxml.verb import Verb class Root: diff --git a/bandwidth/model/bxml/terminal_verb.py b/bandwidth/models/bxml/terminal_verb.py similarity index 100% rename from bandwidth/model/bxml/terminal_verb.py rename to bandwidth/models/bxml/terminal_verb.py diff --git a/bandwidth/model/bxml/verb.py b/bandwidth/models/bxml/verb.py similarity index 100% rename from bandwidth/model/bxml/verb.py rename to bandwidth/models/bxml/verb.py diff --git a/bandwidth/model/bxml/verbs/__init__.py b/bandwidth/models/bxml/verbs/__init__.py similarity index 94% rename from bandwidth/model/bxml/verbs/__init__.py rename to bandwidth/models/bxml/verbs/__init__.py index 7bf837ea..1a4c87c6 100644 --- a/bandwidth/model/bxml/verbs/__init__.py +++ b/bandwidth/models/bxml/verbs/__init__.py @@ -8,6 +8,7 @@ from .play_audio import PlayAudio from .record import Record from .redirect import Redirect +from .resume_recording import ResumeRecording from .ring import Ring from .send_dtmf import SendDtmf from .sip_uri import SipUri diff --git a/bandwidth/model/bxml/verbs/bridge.py b/bandwidth/models/bxml/verbs/bridge.py similarity index 100% rename from bandwidth/model/bxml/verbs/bridge.py rename to bandwidth/models/bxml/verbs/bridge.py diff --git a/bandwidth/model/bxml/verbs/conference.py b/bandwidth/models/bxml/verbs/conference.py similarity index 100% rename from bandwidth/model/bxml/verbs/conference.py rename to bandwidth/models/bxml/verbs/conference.py diff --git a/bandwidth/model/bxml/verbs/forward.py b/bandwidth/models/bxml/verbs/forward.py similarity index 100% rename from bandwidth/model/bxml/verbs/forward.py rename to bandwidth/models/bxml/verbs/forward.py diff --git a/bandwidth/model/bxml/verbs/gather.py b/bandwidth/models/bxml/verbs/gather.py similarity index 100% rename from bandwidth/model/bxml/verbs/gather.py rename to bandwidth/models/bxml/verbs/gather.py diff --git a/bandwidth/model/bxml/verbs/hangup.py b/bandwidth/models/bxml/verbs/hangup.py similarity index 100% rename from bandwidth/model/bxml/verbs/hangup.py rename to bandwidth/models/bxml/verbs/hangup.py diff --git a/bandwidth/model/bxml/verbs/pause.py b/bandwidth/models/bxml/verbs/pause.py similarity index 100% rename from bandwidth/model/bxml/verbs/pause.py rename to bandwidth/models/bxml/verbs/pause.py diff --git a/bandwidth/model/bxml/verbs/pause_recording.py b/bandwidth/models/bxml/verbs/pause_recording.py similarity index 100% rename from bandwidth/model/bxml/verbs/pause_recording.py rename to bandwidth/models/bxml/verbs/pause_recording.py diff --git a/bandwidth/model/bxml/verbs/phone_number.py b/bandwidth/models/bxml/verbs/phone_number.py similarity index 100% rename from bandwidth/model/bxml/verbs/phone_number.py rename to bandwidth/models/bxml/verbs/phone_number.py diff --git a/bandwidth/model/bxml/verbs/play_audio.py b/bandwidth/models/bxml/verbs/play_audio.py similarity index 100% rename from bandwidth/model/bxml/verbs/play_audio.py rename to bandwidth/models/bxml/verbs/play_audio.py diff --git a/bandwidth/model/bxml/verbs/record.py b/bandwidth/models/bxml/verbs/record.py similarity index 100% rename from bandwidth/model/bxml/verbs/record.py rename to bandwidth/models/bxml/verbs/record.py diff --git a/bandwidth/model/bxml/verbs/redirect.py b/bandwidth/models/bxml/verbs/redirect.py similarity index 100% rename from bandwidth/model/bxml/verbs/redirect.py rename to bandwidth/models/bxml/verbs/redirect.py diff --git a/bandwidth/model/bxml/verbs/resume_recording.py b/bandwidth/models/bxml/verbs/resume_recording.py similarity index 100% rename from bandwidth/model/bxml/verbs/resume_recording.py rename to bandwidth/models/bxml/verbs/resume_recording.py diff --git a/bandwidth/model/bxml/verbs/ring.py b/bandwidth/models/bxml/verbs/ring.py similarity index 100% rename from bandwidth/model/bxml/verbs/ring.py rename to bandwidth/models/bxml/verbs/ring.py diff --git a/bandwidth/model/bxml/verbs/send_dtmf.py b/bandwidth/models/bxml/verbs/send_dtmf.py similarity index 100% rename from bandwidth/model/bxml/verbs/send_dtmf.py rename to bandwidth/models/bxml/verbs/send_dtmf.py diff --git a/bandwidth/model/bxml/verbs/sip_uri.py b/bandwidth/models/bxml/verbs/sip_uri.py similarity index 100% rename from bandwidth/model/bxml/verbs/sip_uri.py rename to bandwidth/models/bxml/verbs/sip_uri.py diff --git a/bandwidth/model/bxml/verbs/speak_sentence.py b/bandwidth/models/bxml/verbs/speak_sentence.py similarity index 100% rename from bandwidth/model/bxml/verbs/speak_sentence.py rename to bandwidth/models/bxml/verbs/speak_sentence.py diff --git a/bandwidth/model/bxml/verbs/start_gather.py b/bandwidth/models/bxml/verbs/start_gather.py similarity index 100% rename from bandwidth/model/bxml/verbs/start_gather.py rename to bandwidth/models/bxml/verbs/start_gather.py diff --git a/bandwidth/model/bxml/verbs/start_recording.py b/bandwidth/models/bxml/verbs/start_recording.py similarity index 100% rename from bandwidth/model/bxml/verbs/start_recording.py rename to bandwidth/models/bxml/verbs/start_recording.py diff --git a/bandwidth/model/bxml/verbs/start_stream.py b/bandwidth/models/bxml/verbs/start_stream.py similarity index 100% rename from bandwidth/model/bxml/verbs/start_stream.py rename to bandwidth/models/bxml/verbs/start_stream.py diff --git a/bandwidth/model/bxml/verbs/stop_gather.py b/bandwidth/models/bxml/verbs/stop_gather.py similarity index 100% rename from bandwidth/model/bxml/verbs/stop_gather.py rename to bandwidth/models/bxml/verbs/stop_gather.py diff --git a/bandwidth/model/bxml/verbs/stop_recording.py b/bandwidth/models/bxml/verbs/stop_recording.py similarity index 100% rename from bandwidth/model/bxml/verbs/stop_recording.py rename to bandwidth/models/bxml/verbs/stop_recording.py diff --git a/bandwidth/model/bxml/verbs/stop_stream.py b/bandwidth/models/bxml/verbs/stop_stream.py similarity index 100% rename from bandwidth/model/bxml/verbs/stop_stream.py rename to bandwidth/models/bxml/verbs/stop_stream.py diff --git a/bandwidth/model/bxml/verbs/stream_param.py b/bandwidth/models/bxml/verbs/stream_param.py similarity index 100% rename from bandwidth/model/bxml/verbs/stream_param.py rename to bandwidth/models/bxml/verbs/stream_param.py diff --git a/bandwidth/model/bxml/verbs/tag.py b/bandwidth/models/bxml/verbs/tag.py similarity index 100% rename from bandwidth/model/bxml/verbs/tag.py rename to bandwidth/models/bxml/verbs/tag.py diff --git a/bandwidth/model/bxml/verbs/transfer.py b/bandwidth/models/bxml/verbs/transfer.py similarity index 100% rename from bandwidth/model/bxml/verbs/transfer.py rename to bandwidth/models/bxml/verbs/transfer.py diff --git a/bandwidth/models/call_direction_enum.py b/bandwidth/models/call_direction_enum.py new file mode 100644 index 00000000..dd817342 --- /dev/null +++ b/bandwidth/models/call_direction_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class CallDirectionEnum(str, Enum): + """ + The direction of the call. + """ + + """ + allowed enum values + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + @classmethod + def from_json(cls, json_str: str) -> CallDirectionEnum: + """Create an instance of CallDirectionEnum from a JSON string""" + return CallDirectionEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/call_recording_metadata.py b/bandwidth/models/call_recording_metadata.py new file mode 100644 index 00000000..c97f4fa6 --- /dev/null +++ b/bandwidth/models/call_recording_metadata.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.transcription_metadata import TranscriptionMetadata + +class CallRecordingMetadata(BaseModel): + """ + CallRecordingMetadata + """ + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + direction: Optional[CallDirectionEnum] = None + channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + transcription: Optional[TranscriptionMetadata] = None + additional_properties: Dict[str, Any] = {} + __properties = ["applicationId", "accountId", "callId", "parentCallId", "recordingId", "to", "from", "transferCallerId", "transferTo", "duration", "direction", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "transcription"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CallRecordingMetadata: + """Create an instance of CallRecordingMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of transcription + if self.transcription: + _dict['transcription'] = self.transcription.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + # set to None if transcription (nullable) is None + # and __fields_set__ contains the field + if self.transcription is None and "transcription" in self.__fields_set__: + _dict['transcription'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CallRecordingMetadata: + """Create an instance of CallRecordingMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CallRecordingMetadata.parse_obj(obj) + + _obj = CallRecordingMetadata.parse_obj({ + "application_id": obj.get("applicationId"), + "account_id": obj.get("accountId"), + "call_id": obj.get("callId"), + "parent_call_id": obj.get("parentCallId"), + "recording_id": obj.get("recordingId"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo"), + "duration": obj.get("duration"), + "direction": obj.get("direction"), + "channels": obj.get("channels"), + "start_time": obj.get("startTime"), + "end_time": obj.get("endTime"), + "file_format": obj.get("fileFormat"), + "status": obj.get("status"), + "media_url": obj.get("mediaUrl"), + "transcription": TranscriptionMetadata.from_dict(obj.get("transcription")) if obj.get("transcription") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/call_state.py b/bandwidth/models/call_state.py new file mode 100644 index 00000000..1f5e525a --- /dev/null +++ b/bandwidth/models/call_state.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class CallState(BaseModel): + """ + CallState + """ + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The application id associated with the call.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The account id associated with the call.") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The programmable voice API call ID.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer).") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The phone number that made the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + state: Optional[StrictStr] = Field(None, description="The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values.") + stir_shaken: Optional[Dict[str, StrictStr]] = Field(None, alias="stirShaken", description="For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken).") + identity: Optional[StrictStr] = Field(None, description="The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="The time this call was placed in queue.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Populated once the call has been answered, with the time in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="Populated once the call has ended, with the time in ISO 8601 format.") + disconnect_cause: Optional[StrictStr] = Field(None, alias="disconnectCause", description="| Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [``](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future.") + error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Populated only if the call ended with an error, with text explaining the reason.") + error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Populated only if the call ended with an error, with a Bandwidth internal id that references the error event.") + last_update: Optional[datetime] = Field(None, alias="lastUpdate", description="The last time the call had a state update, in ISO 8601 format.") + additional_properties: Dict[str, Any] = {} + __properties = ["applicationId", "accountId", "callId", "parentCallId", "to", "from", "direction", "state", "stirShaken", "identity", "enqueuedTime", "startTime", "answerTime", "endTime", "disconnectCause", "errorMessage", "errorId", "lastUpdate"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CallState: + """Create an instance of CallState from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if parent_call_id (nullable) is None + # and __fields_set__ contains the field + if self.parent_call_id is None and "parent_call_id" in self.__fields_set__: + _dict['parentCallId'] = None + + # set to None if stir_shaken (nullable) is None + # and __fields_set__ contains the field + if self.stir_shaken is None and "stir_shaken" in self.__fields_set__: + _dict['stirShaken'] = None + + # set to None if identity (nullable) is None + # and __fields_set__ contains the field + if self.identity is None and "identity" in self.__fields_set__: + _dict['identity'] = None + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if start_time (nullable) is None + # and __fields_set__ contains the field + if self.start_time is None and "start_time" in self.__fields_set__: + _dict['startTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if end_time (nullable) is None + # and __fields_set__ contains the field + if self.end_time is None and "end_time" in self.__fields_set__: + _dict['endTime'] = None + + # set to None if disconnect_cause (nullable) is None + # and __fields_set__ contains the field + if self.disconnect_cause is None and "disconnect_cause" in self.__fields_set__: + _dict['disconnectCause'] = None + + # set to None if error_message (nullable) is None + # and __fields_set__ contains the field + if self.error_message is None and "error_message" in self.__fields_set__: + _dict['errorMessage'] = None + + # set to None if error_id (nullable) is None + # and __fields_set__ contains the field + if self.error_id is None and "error_id" in self.__fields_set__: + _dict['errorId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CallState: + """Create an instance of CallState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CallState.parse_obj(obj) + + _obj = CallState.parse_obj({ + "application_id": obj.get("applicationId"), + "account_id": obj.get("accountId"), + "call_id": obj.get("callId"), + "parent_call_id": obj.get("parentCallId"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "direction": obj.get("direction"), + "state": obj.get("state"), + "stir_shaken": obj.get("stirShaken"), + "identity": obj.get("identity"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "end_time": obj.get("endTime"), + "disconnect_cause": obj.get("disconnectCause"), + "error_message": obj.get("errorMessage"), + "error_id": obj.get("errorId"), + "last_update": obj.get("lastUpdate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/call_state_enum.py b/bandwidth/models/call_state_enum.py new file mode 100644 index 00000000..d0c56dd5 --- /dev/null +++ b/bandwidth/models/call_state_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class CallStateEnum(str, Enum): + """ + The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + COMPLETED = 'completed' + + @classmethod + def from_json(cls, json_str: str) -> CallStateEnum: + """Create an instance of CallStateEnum from a JSON string""" + return CallStateEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/callback_method_enum.py b/bandwidth/models/callback_method_enum.py new file mode 100644 index 00000000..d5cba1d5 --- /dev/null +++ b/bandwidth/models/callback_method_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class CallbackMethodEnum(str, Enum): + """ + The HTTP method to use to deliver the callback. GET or POST. Default value is POST. + """ + + """ + allowed enum values + """ + GET = 'GET' + POST = 'POST' + + @classmethod + def from_json(cls, json_str: str) -> CallbackMethodEnum: + """Create an instance of CallbackMethodEnum from a JSON string""" + return CallbackMethodEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/code_request.py b/bandwidth/models/code_request.py new file mode 100644 index 00000000..7f714908 --- /dev/null +++ b/bandwidth/models/code_request.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, conint, constr, validator + +class CodeRequest(BaseModel): + """ + CodeRequest + """ + to: constr(strict=True) = Field(..., description="The phone number to send the mfa code to.") + var_from: constr(strict=True, max_length=32) = Field(..., alias="from", description="The application phone number, the sender of the mfa code.") + application_id: constr(strict=True, max_length=50) = Field(..., alias="applicationId", description="The application unique ID, obtained from Bandwidth.") + scope: Optional[constr(strict=True, max_length=25)] = Field(None, description="An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".") + message: constr(strict=True, max_length=2048) = Field(..., description="The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server.") + digits: conint(strict=True, le=8, ge=4) = Field(..., description="The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively.") + additional_properties: Dict[str, Any] = {} + __properties = ["to", "from", "applicationId", "scope", "message", "digits"] + + @validator('to') + def to_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^\+[1-9]\d{1,14}$", value): + raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/") + return value + + @validator('var_from') + def var_from_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^\+[1-9]\d{1,14}$", value): + raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/") + return value + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CodeRequest: + """Create an instance of CodeRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CodeRequest: + """Create an instance of CodeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CodeRequest.parse_obj(obj) + + _obj = CodeRequest.parse_obj({ + "to": obj.get("to"), + "var_from": obj.get("from"), + "application_id": obj.get("applicationId"), + "scope": obj.get("scope"), + "message": obj.get("message"), + "digits": obj.get("digits") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference.py b/bandwidth/models/conference.py new file mode 100644 index 00000000..13dde518 --- /dev/null +++ b/bandwidth/models/conference.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.conference_member import ConferenceMember + +class Conference(BaseModel): + """ + Conference + """ + id: Optional[StrictStr] = Field(None, description="The Bandwidth-generated conference ID.") + name: Optional[StrictStr] = Field(None, description="The name of the conference, as specified by your application.") + created_time: Optional[datetime] = Field(None, alias="createdTime", description="The time the conference was initiated, in ISO 8601 format.") + completed_time: Optional[datetime] = Field(None, alias="completedTime", description="The time the conference was terminated, in ISO 8601 format.") + conference_event_url: Optional[StrictStr] = Field(None, alias="conferenceEventUrl", description="The URL to send the conference-related events.") + conference_event_method: Optional[CallbackMethodEnum] = Field(None, alias="conferenceEventMethod") + tag: Optional[StrictStr] = Field(None, description="The custom string attached to the conference that will be sent with callbacks.") + active_members: Optional[conlist(ConferenceMember)] = Field(None, alias="activeMembers", description="A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences).") + additional_properties: Dict[str, Any] = {} + __properties = ["id", "name", "createdTime", "completedTime", "conferenceEventUrl", "conferenceEventMethod", "tag", "activeMembers"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Conference: + """Create an instance of Conference from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in active_members (list) + _items = [] + if self.active_members: + for _item in self.active_members: + if _item: + _items.append(_item.to_dict()) + _dict['activeMembers'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if completed_time (nullable) is None + # and __fields_set__ contains the field + if self.completed_time is None and "completed_time" in self.__fields_set__: + _dict['completedTime'] = None + + # set to None if conference_event_url (nullable) is None + # and __fields_set__ contains the field + if self.conference_event_url is None and "conference_event_url" in self.__fields_set__: + _dict['conferenceEventUrl'] = None + + # set to None if conference_event_method (nullable) is None + # and __fields_set__ contains the field + if self.conference_event_method is None and "conference_event_method" in self.__fields_set__: + _dict['conferenceEventMethod'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if active_members (nullable) is None + # and __fields_set__ contains the field + if self.active_members is None and "active_members" in self.__fields_set__: + _dict['activeMembers'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Conference: + """Create an instance of Conference from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Conference.parse_obj(obj) + + _obj = Conference.parse_obj({ + "id": obj.get("id"), + "name": obj.get("name"), + "created_time": obj.get("createdTime"), + "completed_time": obj.get("completedTime"), + "conference_event_url": obj.get("conferenceEventUrl"), + "conference_event_method": obj.get("conferenceEventMethod"), + "tag": obj.get("tag"), + "active_members": [ConferenceMember.from_dict(_item) for _item in obj.get("activeMembers")] if obj.get("activeMembers") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_completed_callback.py b/bandwidth/models/conference_completed_callback.py new file mode 100644 index 00000000..6a9e09c3 --- /dev/null +++ b/bandwidth/models/conference_completed_callback.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class ConferenceCompletedCallback(BaseModel): + """ + The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceCompletedCallback: + """Create an instance of ConferenceCompletedCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceCompletedCallback: + """Create an instance of ConferenceCompletedCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceCompletedCallback.parse_obj(obj) + + _obj = ConferenceCompletedCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_created_callback.py b/bandwidth/models/conference_created_callback.py new file mode 100644 index 00000000..0484f5ac --- /dev/null +++ b/bandwidth/models/conference_created_callback.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class ConferenceCreatedCallback(BaseModel): + """ + The Conference Created event is fired whenever a new conference that specified a callbackUrl is created. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceCreatedCallback: + """Create an instance of ConferenceCreatedCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceCreatedCallback: + """Create an instance of ConferenceCreatedCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceCreatedCallback.parse_obj(obj) + + _obj = ConferenceCreatedCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_member.py b/bandwidth/models/conference_member.py new file mode 100644 index 00000000..bc7a494a --- /dev/null +++ b/bandwidth/models/conference_member.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist + +class ConferenceMember(BaseModel): + """ + ConferenceMember + """ + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + member_url: Optional[StrictStr] = Field(None, alias="memberUrl", description="A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint.") + mute: Optional[StrictBool] = Field(None, description="Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted.") + hold: Optional[StrictBool] = Field(None, description="Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted.") + call_ids_to_coach: Optional[conlist(StrictStr)] = Field(None, alias="callIdsToCoach", description="If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.") + additional_properties: Dict[str, Any] = {} + __properties = ["callId", "conferenceId", "memberUrl", "mute", "hold", "callIdsToCoach"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceMember: + """Create an instance of ConferenceMember from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if call_ids_to_coach (nullable) is None + # and __fields_set__ contains the field + if self.call_ids_to_coach is None and "call_ids_to_coach" in self.__fields_set__: + _dict['callIdsToCoach'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceMember: + """Create an instance of ConferenceMember from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceMember.parse_obj(obj) + + _obj = ConferenceMember.parse_obj({ + "call_id": obj.get("callId"), + "conference_id": obj.get("conferenceId"), + "member_url": obj.get("memberUrl"), + "mute": obj.get("mute"), + "hold": obj.get("hold"), + "call_ids_to_coach": obj.get("callIdsToCoach") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_member_exit_callback.py b/bandwidth/models/conference_member_exit_callback.py new file mode 100644 index 00000000..574a2299 --- /dev/null +++ b/bandwidth/models/conference_member_exit_callback.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class ConferenceMemberExitCallback(BaseModel): + """ + The Conference Member Exit event is fired whenever a caller exits a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "from", "to", "callId", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceMemberExitCallback: + """Create an instance of ConferenceMemberExitCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceMemberExitCallback: + """Create an instance of ConferenceMemberExitCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceMemberExitCallback.parse_obj(obj) + + _obj = ConferenceMemberExitCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "call_id": obj.get("callId"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_member_join_callback.py b/bandwidth/models/conference_member_join_callback.py new file mode 100644 index 00000000..a661501e --- /dev/null +++ b/bandwidth/models/conference_member_join_callback.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class ConferenceMemberJoinCallback(BaseModel): + """ + The Conference Member Join event is fired whenever a caller joins a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "from", "to", "callId", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceMemberJoinCallback: + """Create an instance of ConferenceMemberJoinCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceMemberJoinCallback: + """Create an instance of ConferenceMemberJoinCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceMemberJoinCallback.parse_obj(obj) + + _obj = ConferenceMemberJoinCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "call_id": obj.get("callId"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_recording_available_callback.py b/bandwidth/models/conference_recording_available_callback.py new file mode 100644 index 00000000..9cee981d --- /dev/null +++ b/bandwidth/models/conference_recording_available_callback.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.file_format_enum import FileFormatEnum + +class ConferenceRecordingAvailableCallback(BaseModel): + """ + The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "accountId", "recordingId", "channels", "startTime", "endTime", "duration", "fileFormat", "mediaUrl", "tag", "status"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceRecordingAvailableCallback: + """Create an instance of ConferenceRecordingAvailableCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceRecordingAvailableCallback: + """Create an instance of ConferenceRecordingAvailableCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceRecordingAvailableCallback.parse_obj(obj) + + _obj = ConferenceRecordingAvailableCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "account_id": obj.get("accountId"), + "recording_id": obj.get("recordingId"), + "channels": obj.get("channels"), + "start_time": obj.get("startTime"), + "end_time": obj.get("endTime"), + "duration": obj.get("duration"), + "file_format": obj.get("fileFormat"), + "media_url": obj.get("mediaUrl"), + "tag": obj.get("tag"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_recording_metadata.py b/bandwidth/models/conference_recording_metadata.py new file mode 100644 index 00000000..7debbe6f --- /dev/null +++ b/bandwidth/models/conference_recording_metadata.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.file_format_enum import FileFormatEnum + +class ConferenceRecordingMetadata(BaseModel): + """ + ConferenceRecordingMetadata + """ + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + additional_properties: Dict[str, Any] = {} + __properties = ["accountId", "conferenceId", "name", "recordingId", "duration", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceRecordingMetadata: + """Create an instance of ConferenceRecordingMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceRecordingMetadata: + """Create an instance of ConferenceRecordingMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceRecordingMetadata.parse_obj(obj) + + _obj = ConferenceRecordingMetadata.parse_obj({ + "account_id": obj.get("accountId"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "recording_id": obj.get("recordingId"), + "duration": obj.get("duration"), + "channels": obj.get("channels"), + "start_time": obj.get("startTime"), + "end_time": obj.get("endTime"), + "file_format": obj.get("fileFormat"), + "status": obj.get("status"), + "media_url": obj.get("mediaUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_redirect_callback.py b/bandwidth/models/conference_redirect_callback.py new file mode 100644 index 00000000..cb8d04c1 --- /dev/null +++ b/bandwidth/models/conference_redirect_callback.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class ConferenceRedirectCallback(BaseModel): + """ + The Conference Redirect event is fired whenever an existing conference is modified via a POST request made to the /conferences/{conferenceId} endpoint. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded") + name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ConferenceRedirectCallback: + """Create an instance of ConferenceRedirectCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ConferenceRedirectCallback: + """Create an instance of ConferenceRedirectCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ConferenceRedirectCallback.parse_obj(obj) + + _obj = ConferenceRedirectCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "conference_id": obj.get("conferenceId"), + "name": obj.get("name"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/conference_state_enum.py b/bandwidth/models/conference_state_enum.py new file mode 100644 index 00000000..fb212608 --- /dev/null +++ b/bandwidth/models/conference_state_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class ConferenceStateEnum(str, Enum): + """ + Setting the conference state to `completed` ends the conference and ejects all members. + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + COMPLETED = 'completed' + + @classmethod + def from_json(cls, json_str: str) -> ConferenceStateEnum: + """Create an instance of ConferenceStateEnum from a JSON string""" + return ConferenceStateEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/create_call.py b/bandwidth/models/create_call.py new file mode 100644 index 00000000..239b6a18 --- /dev/null +++ b/bandwidth/models/create_call.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictStr, confloat, conint, constr +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration + +class CreateCall(BaseModel): + """ + CreateCall + """ + to: StrictStr = Field(..., description="The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).") + var_from: StrictStr = Field(..., alias="from", description="A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`).") + display_name: Optional[constr(strict=True, max_length=256)] = Field(None, alias="displayName", description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines.") + uui: Optional[StrictStr] = Field(None, description="A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.") + application_id: StrictStr = Field(..., alias="applicationId", description="The id of the application associated with the `from` number.") + answer_url: constr(strict=True, max_length=2048) = Field(..., alias="answerUrl", description="The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password`.") + answer_method: Optional[CallbackMethodEnum] = Field(None, alias="answerMethod") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + answer_fallback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="answerFallbackUrl", description="A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`.") + answer_fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="answerFallbackMethod") + fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.") + fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.") + disconnect_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="disconnectUrl", description="The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.") + disconnect_method: Optional[CallbackMethodEnum] = Field(None, alias="disconnectMethod") + call_timeout: Optional[Union[confloat(le=300, ge=1, strict=True), conint(le=300, ge=1, strict=True)]] = Field(30, alias="callTimeout", description="The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300.") + callback_timeout: Optional[Union[confloat(le=25, ge=1, strict=True), conint(le=25, ge=1, strict=True)]] = Field(15, alias="callbackTimeout", description="This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.") + machine_detection: Optional[MachineDetectionConfiguration] = Field(None, alias="machineDetection") + priority: Optional[conint(strict=True, le=5, ge=1)] = Field(5, description="The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.") + tag: Optional[constr(strict=True, max_length=256)] = Field(None, description="A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.") + additional_properties: Dict[str, Any] = {} + __properties = ["to", "from", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CreateCall: + """Create an instance of CreateCall from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of machine_detection + if self.machine_detection: + _dict['machineDetection'] = self.machine_detection.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if display_name (nullable) is None + # and __fields_set__ contains the field + if self.display_name is None and "display_name" in self.__fields_set__: + _dict['displayName'] = None + + # set to None if uui (nullable) is None + # and __fields_set__ contains the field + if self.uui is None and "uui" in self.__fields_set__: + _dict['uui'] = None + + # set to None if answer_method (nullable) is None + # and __fields_set__ contains the field + if self.answer_method is None and "answer_method" in self.__fields_set__: + _dict['answerMethod'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if answer_fallback_url (nullable) is None + # and __fields_set__ contains the field + if self.answer_fallback_url is None and "answer_fallback_url" in self.__fields_set__: + _dict['answerFallbackUrl'] = None + + # set to None if answer_fallback_method (nullable) is None + # and __fields_set__ contains the field + if self.answer_fallback_method is None and "answer_fallback_method" in self.__fields_set__: + _dict['answerFallbackMethod'] = None + + # set to None if fallback_username (nullable) is None + # and __fields_set__ contains the field + if self.fallback_username is None and "fallback_username" in self.__fields_set__: + _dict['fallbackUsername'] = None + + # set to None if fallback_password (nullable) is None + # and __fields_set__ contains the field + if self.fallback_password is None and "fallback_password" in self.__fields_set__: + _dict['fallbackPassword'] = None + + # set to None if disconnect_url (nullable) is None + # and __fields_set__ contains the field + if self.disconnect_url is None and "disconnect_url" in self.__fields_set__: + _dict['disconnectUrl'] = None + + # set to None if disconnect_method (nullable) is None + # and __fields_set__ contains the field + if self.disconnect_method is None and "disconnect_method" in self.__fields_set__: + _dict['disconnectMethod'] = None + + # set to None if call_timeout (nullable) is None + # and __fields_set__ contains the field + if self.call_timeout is None and "call_timeout" in self.__fields_set__: + _dict['callTimeout'] = None + + # set to None if callback_timeout (nullable) is None + # and __fields_set__ contains the field + if self.callback_timeout is None and "callback_timeout" in self.__fields_set__: + _dict['callbackTimeout'] = None + + # set to None if priority (nullable) is None + # and __fields_set__ contains the field + if self.priority is None and "priority" in self.__fields_set__: + _dict['priority'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CreateCall: + """Create an instance of CreateCall from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CreateCall.parse_obj(obj) + + _obj = CreateCall.parse_obj({ + "to": obj.get("to"), + "var_from": obj.get("from"), + "display_name": obj.get("displayName"), + "uui": obj.get("uui"), + "application_id": obj.get("applicationId"), + "answer_url": obj.get("answerUrl"), + "answer_method": obj.get("answerMethod"), + "username": obj.get("username"), + "password": obj.get("password"), + "answer_fallback_url": obj.get("answerFallbackUrl"), + "answer_fallback_method": obj.get("answerFallbackMethod"), + "fallback_username": obj.get("fallbackUsername"), + "fallback_password": obj.get("fallbackPassword"), + "disconnect_url": obj.get("disconnectUrl"), + "disconnect_method": obj.get("disconnectMethod"), + "call_timeout": obj.get("callTimeout") if obj.get("callTimeout") is not None else 30, + "callback_timeout": obj.get("callbackTimeout") if obj.get("callbackTimeout") is not None else 15, + "machine_detection": MachineDetectionConfiguration.from_dict(obj.get("machineDetection")) if obj.get("machineDetection") is not None else None, + "priority": obj.get("priority") if obj.get("priority") is not None else 5, + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_call_response.py b/bandwidth/models/create_call_response.py new file mode 100644 index 00000000..fc0b097a --- /dev/null +++ b/bandwidth/models/create_call_response.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from bandwidth.models.callback_method_enum import CallbackMethodEnum + +class CreateCallResponse(BaseModel): + """ + CreateCallResponse + """ + application_id: StrictStr = Field(..., alias="applicationId", description="The id of the application associated with the `from` number.") + account_id: StrictStr = Field(..., alias="accountId", description="The bandwidth account ID associated with the call.") + call_id: StrictStr = Field(..., alias="callId", description="Programmable Voice API Call ID.") + to: StrictStr = Field(..., description="Recipient of the outgoing call.") + var_from: StrictStr = Field(..., alias="from", description="Phone number that created the outbound call.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="The time at which the call was accepted into the queue.") + call_url: StrictStr = Field(..., alias="callUrl", description="The URL to update this call's state.") + call_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="callTimeout", description="The timeout (in seconds) for the callee to answer the call after it starts ringing.") + callback_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="callbackTimeout", description="This is the timeout (in seconds) to use when delivering webhooks for the call.") + tag: Optional[StrictStr] = Field(None, description="Custom tag value.") + answer_method: Optional[CallbackMethodEnum] = Field(..., alias="answerMethod") + answer_url: StrictStr = Field(..., alias="answerUrl", description="URL to deliver the `answer` event webhook.") + answer_fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="answerFallbackMethod") + answer_fallback_url: Optional[StrictStr] = Field(None, alias="answerFallbackUrl", description="Fallback URL to deliver the `answer` event webhook.") + disconnect_method: Optional[CallbackMethodEnum] = Field(..., alias="disconnectMethod") + disconnect_url: Optional[StrictStr] = Field(None, alias="disconnectUrl", description="URL to deliver the `disconnect` event webhook.") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.") + fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.") + priority: Optional[StrictInt] = Field(None, description="The priority of this call over other calls from your account.") + additional_properties: Dict[str, Any] = {} + __properties = ["applicationId", "accountId", "callId", "to", "from", "enqueuedTime", "callUrl", "callTimeout", "callbackTimeout", "tag", "answerMethod", "answerUrl", "answerFallbackMethod", "answerFallbackUrl", "disconnectMethod", "disconnectUrl", "username", "password", "fallbackUsername", "fallbackPassword", "priority"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CreateCallResponse: + """Create an instance of CreateCallResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if answer_method (nullable) is None + # and __fields_set__ contains the field + if self.answer_method is None and "answer_method" in self.__fields_set__: + _dict['answerMethod'] = None + + # set to None if answer_fallback_method (nullable) is None + # and __fields_set__ contains the field + if self.answer_fallback_method is None and "answer_fallback_method" in self.__fields_set__: + _dict['answerFallbackMethod'] = None + + # set to None if answer_fallback_url (nullable) is None + # and __fields_set__ contains the field + if self.answer_fallback_url is None and "answer_fallback_url" in self.__fields_set__: + _dict['answerFallbackUrl'] = None + + # set to None if disconnect_method (nullable) is None + # and __fields_set__ contains the field + if self.disconnect_method is None and "disconnect_method" in self.__fields_set__: + _dict['disconnectMethod'] = None + + # set to None if disconnect_url (nullable) is None + # and __fields_set__ contains the field + if self.disconnect_url is None and "disconnect_url" in self.__fields_set__: + _dict['disconnectUrl'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if fallback_username (nullable) is None + # and __fields_set__ contains the field + if self.fallback_username is None and "fallback_username" in self.__fields_set__: + _dict['fallbackUsername'] = None + + # set to None if fallback_password (nullable) is None + # and __fields_set__ contains the field + if self.fallback_password is None and "fallback_password" in self.__fields_set__: + _dict['fallbackPassword'] = None + + # set to None if priority (nullable) is None + # and __fields_set__ contains the field + if self.priority is None and "priority" in self.__fields_set__: + _dict['priority'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CreateCallResponse: + """Create an instance of CreateCallResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CreateCallResponse.parse_obj(obj) + + _obj = CreateCallResponse.parse_obj({ + "application_id": obj.get("applicationId"), + "account_id": obj.get("accountId"), + "call_id": obj.get("callId"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "enqueued_time": obj.get("enqueuedTime"), + "call_url": obj.get("callUrl"), + "call_timeout": obj.get("callTimeout"), + "callback_timeout": obj.get("callbackTimeout"), + "tag": obj.get("tag"), + "answer_method": obj.get("answerMethod"), + "answer_url": obj.get("answerUrl"), + "answer_fallback_method": obj.get("answerFallbackMethod"), + "answer_fallback_url": obj.get("answerFallbackUrl"), + "disconnect_method": obj.get("disconnectMethod"), + "disconnect_url": obj.get("disconnectUrl"), + "username": obj.get("username"), + "password": obj.get("password"), + "fallback_username": obj.get("fallbackUsername"), + "fallback_password": obj.get("fallbackPassword"), + "priority": obj.get("priority") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_lookup_response.py b/bandwidth/models/create_lookup_response.py new file mode 100644 index 00000000..d025c1fa --- /dev/null +++ b/bandwidth/models/create_lookup_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.lookup_status_enum import LookupStatusEnum + +class CreateLookupResponse(BaseModel): + """ + The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED). + """ + request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The phone number lookup request ID from Bandwidth.") + status: Optional[LookupStatusEnum] = None + additional_properties: Dict[str, Any] = {} + __properties = ["requestId", "status"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CreateLookupResponse: + """Create an instance of CreateLookupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CreateLookupResponse: + """Create an instance of CreateLookupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CreateLookupResponse.parse_obj(obj) + + _obj = CreateLookupResponse.parse_obj({ + "request_id": obj.get("requestId"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/create_message_request_error.py b/bandwidth/models/create_message_request_error.py new file mode 100644 index 00000000..ef0ec458 --- /dev/null +++ b/bandwidth/models/create_message_request_error.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist +from bandwidth.models.field_error import FieldError + +class CreateMessageRequestError(BaseModel): + """ + CreateMessageRequestError + """ + type: StrictStr = Field(...) + description: StrictStr = Field(...) + field_errors: Optional[conlist(FieldError)] = Field(None, alias="fieldErrors") + additional_properties: Dict[str, Any] = {} + __properties = ["type", "description", "fieldErrors"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CreateMessageRequestError: + """Create an instance of CreateMessageRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in field_errors (list) + _items = [] + if self.field_errors: + for _item in self.field_errors: + if _item: + _items.append(_item.to_dict()) + _dict['fieldErrors'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CreateMessageRequestError: + """Create an instance of CreateMessageRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return CreateMessageRequestError.parse_obj(obj) + + _obj = CreateMessageRequestError.parse_obj({ + "type": obj.get("type"), + "description": obj.get("description"), + "field_errors": [FieldError.from_dict(_item) for _item in obj.get("fieldErrors")] if obj.get("fieldErrors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/deferred_result.py b/bandwidth/models/deferred_result.py new file mode 100644 index 00000000..fb79b545 --- /dev/null +++ b/bandwidth/models/deferred_result.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictBool + +class DeferredResult(BaseModel): + """ + DeferredResult + """ + result: Optional[Dict[str, Any]] = None + set_or_expired: Optional[StrictBool] = Field(None, alias="setOrExpired") + additional_properties: Dict[str, Any] = {} + __properties = ["result", "setOrExpired"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> DeferredResult: + """Create an instance of DeferredResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> DeferredResult: + """Create an instance of DeferredResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return DeferredResult.parse_obj(obj) + + _obj = DeferredResult.parse_obj({ + "result": obj.get("result"), + "set_or_expired": obj.get("setOrExpired") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/disconnect_callback.py b/bandwidth/models/disconnect_callback.py new file mode 100644 index 00000000..2d2fce0d --- /dev/null +++ b/bandwidth/models/disconnect_callback.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class DisconnectCallback(BaseModel): + """ + The Disconnect event is fired when a call ends, for any reason. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + direction: Optional[CallDirectionEnum] = None + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") + error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.") + error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "callUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "cause", "errorMessage", "errorId", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> DisconnectCallback: + """Create an instance of DisconnectCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if error_message (nullable) is None + # and __fields_set__ contains the field + if self.error_message is None and "error_message" in self.__fields_set__: + _dict['errorMessage'] = None + + # set to None if error_id (nullable) is None + # and __fields_set__ contains the field + if self.error_id is None and "error_id" in self.__fields_set__: + _dict['errorId'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> DisconnectCallback: + """Create an instance of DisconnectCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return DisconnectCallback.parse_obj(obj) + + _obj = DisconnectCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "call_id": obj.get("callId"), + "direction": obj.get("direction"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "end_time": obj.get("endTime"), + "cause": obj.get("cause"), + "error_message": obj.get("errorMessage"), + "error_id": obj.get("errorId"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/diversion.py b/bandwidth/models/diversion.py new file mode 100644 index 00000000..b5ebfbb2 --- /dev/null +++ b/bandwidth/models/diversion.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class Diversion(BaseModel): + """ + Diversion + """ + reason: Optional[StrictStr] = Field(None, description="The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away.") + privacy: Optional[StrictStr] = Field(None, description="off or full") + screen: Optional[StrictStr] = Field(None, description="No if the number was provided by the user, yes if the number was provided by the network") + counter: Optional[StrictStr] = Field(None, description="The number of diversions that have occurred") + limit: Optional[StrictStr] = Field(None, description="The maximum number of diversions allowed for this session") + unknown: Optional[StrictStr] = Field(None, description="The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys.") + orig_to: Optional[StrictStr] = Field(None, alias="origTo", description="Always present. Indicates the last telephone number that the call was diverted from.") + additional_properties: Dict[str, Any] = {} + __properties = ["reason", "privacy", "screen", "counter", "limit", "unknown", "origTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Diversion: + """Create an instance of Diversion from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Diversion: + """Create an instance of Diversion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Diversion.parse_obj(obj) + + _obj = Diversion.parse_obj({ + "reason": obj.get("reason"), + "privacy": obj.get("privacy"), + "screen": obj.get("screen"), + "counter": obj.get("counter"), + "limit": obj.get("limit"), + "unknown": obj.get("unknown"), + "orig_to": obj.get("origTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/dtmf_callback.py b/bandwidth/models/dtmf_callback.py new file mode 100644 index 00000000..674f2bde --- /dev/null +++ b/bandwidth/models/dtmf_callback.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class DtmfCallback(BaseModel): + """ + The DTMF event is sent for every digit detected after a verb is executed. You may not respond to this event with BXML. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + direction: Optional[CallDirectionEnum] = None + digit: Optional[StrictStr] = Field(None, description="The digit collected in the call.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "digit", "callUrl", "enqueuedTime", "startTime", "answerTime", "parentCallId", "transferCallerId", "transferTo", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> DtmfCallback: + """Create an instance of DtmfCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> DtmfCallback: + """Create an instance of DtmfCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return DtmfCallback.parse_obj(obj) + + _obj = DtmfCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "call_id": obj.get("callId"), + "direction": obj.get("direction"), + "digit": obj.get("digit"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "parent_call_id": obj.get("parentCallId"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/field_error.py b/bandwidth/models/field_error.py new file mode 100644 index 00000000..203fa03d --- /dev/null +++ b/bandwidth/models/field_error.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class FieldError(BaseModel): + """ + FieldError + """ + field_name: Optional[StrictStr] = Field(None, alias="fieldName", description="The name of the field that contains the error") + description: Optional[StrictStr] = Field(None, description="The error associated with the field") + additional_properties: Dict[str, Any] = {} + __properties = ["fieldName", "description"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> FieldError: + """Create an instance of FieldError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> FieldError: + """Create an instance of FieldError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return FieldError.parse_obj(obj) + + _obj = FieldError.parse_obj({ + "field_name": obj.get("fieldName"), + "description": obj.get("description") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/file_format_enum.py b/bandwidth/models/file_format_enum.py new file mode 100644 index 00000000..ab2e801b --- /dev/null +++ b/bandwidth/models/file_format_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class FileFormatEnum(str, Enum): + """ + The format that the recording is stored in. + """ + + """ + allowed enum values + """ + MP3 = 'mp3' + WAV = 'wav' + + @classmethod + def from_json(cls, json_str: str) -> FileFormatEnum: + """Create an instance of FileFormatEnum from a JSON string""" + return FileFormatEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/gather_callback.py b/bandwidth/models/gather_callback.py new file mode 100644 index 00000000..e0feb0d4 --- /dev/null +++ b/bandwidth/models/gather_callback.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class GatherCallback(BaseModel): + """ + The gather event is sent after a verb is executed. Its purpose is to report the gathered digits to the calling application. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + digits: Optional[StrictStr] = Field(None, description="(optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + terminating_digit: Optional[StrictStr] = Field(None, alias="terminatingDigit", description="(optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "digits", "callUrl", "enqueuedTime", "startTime", "answerTime", "parentCallId", "terminatingDigit", "transferCallerId", "transferTo", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> GatherCallback: + """Create an instance of GatherCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> GatherCallback: + """Create an instance of GatherCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return GatherCallback.parse_obj(obj) + + _obj = GatherCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "digits": obj.get("digits"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "parent_call_id": obj.get("parentCallId"), + "terminating_digit": obj.get("terminatingDigit"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/inbound_message_callback.py b/bandwidth/models/inbound_message_callback.py new file mode 100644 index 00000000..4d60dadf --- /dev/null +++ b/bandwidth/models/inbound_message_callback.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage + +class InboundMessageCallback(BaseModel): + """ + Inbound Message Callback + """ + time: datetime = Field(...) + type: StrictStr = Field(...) + to: StrictStr = Field(...) + description: StrictStr = Field(...) + message: InboundMessageCallbackMessage = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["time", "type", "to", "description", "message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> InboundMessageCallback: + """Create an instance of InboundMessageCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of message + if self.message: + _dict['message'] = self.message.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> InboundMessageCallback: + """Create an instance of InboundMessageCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return InboundMessageCallback.parse_obj(obj) + + _obj = InboundMessageCallback.parse_obj({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": InboundMessageCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/inbound_message_callback_message.py b/bandwidth/models/inbound_message_callback_message.py new file mode 100644 index 00000000..accb6480 --- /dev/null +++ b/bandwidth/models/inbound_message_callback_message.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum + +class InboundMessageCallbackMessage(BaseModel): + """ + Inbound Message Callback Message Schema + """ + id: StrictStr = Field(...) + owner: StrictStr = Field(...) + application_id: StrictStr = Field(..., alias="applicationId") + time: datetime = Field(...) + segment_count: StrictInt = Field(..., alias="segmentCount") + direction: MessageDirectionEnum = Field(...) + to: conlist(StrictStr, unique_items=True) = Field(...) + var_from: StrictStr = Field(..., alias="from") + text: StrictStr = Field(...) + tag: Optional[StrictStr] = None + media: Optional[conlist(StrictStr)] = None + priority: Optional[PriorityEnum] = None + additional_properties: Dict[str, Any] = {} + __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> InboundMessageCallbackMessage: + """Create an instance of InboundMessageCallbackMessage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> InboundMessageCallbackMessage: + """Create an instance of InboundMessageCallbackMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return InboundMessageCallbackMessage.parse_obj(obj) + + _obj = InboundMessageCallbackMessage.parse_obj({ + "id": obj.get("id"), + "owner": obj.get("owner"), + "application_id": obj.get("applicationId"), + "time": obj.get("time"), + "segment_count": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "media": obj.get("media"), + "priority": obj.get("priority") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/initiate_callback.py b/bandwidth/models/initiate_callback.py new file mode 100644 index 00000000..955eab7b --- /dev/null +++ b/bandwidth/models/initiate_callback.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.diversion import Diversion +from bandwidth.models.stir_shaken import StirShaken + +class InitiateCallback(BaseModel): + """ + The Initiate event is fired when an inbound call is received for a Telephone Number on your Account. It is sent to the URL specified in the application associated with the location (sip-peer) that the called telephone number belongs to. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + diversion: Optional[Diversion] = None + stir_shaken: Optional[StirShaken] = Field(None, alias="stirShaken") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "startTime", "diversion", "stirShaken"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> InitiateCallback: + """Create an instance of InitiateCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of diversion + if self.diversion: + _dict['diversion'] = self.diversion.to_dict() + # override the default output from pydantic by calling `to_dict()` of stir_shaken + if self.stir_shaken: + _dict['stirShaken'] = self.stir_shaken.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> InitiateCallback: + """Create an instance of InitiateCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return InitiateCallback.parse_obj(obj) + + _obj = InitiateCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "start_time": obj.get("startTime"), + "diversion": Diversion.from_dict(obj.get("diversion")) if obj.get("diversion") is not None else None, + "stir_shaken": StirShaken.from_dict(obj.get("stirShaken")) if obj.get("stirShaken") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/list_message_direction_enum.py b/bandwidth/models/list_message_direction_enum.py new file mode 100644 index 00000000..f4942d91 --- /dev/null +++ b/bandwidth/models/list_message_direction_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class ListMessageDirectionEnum(str, Enum): + """ + The direction of the message. One of INBOUND OUTBOUND. + """ + + """ + allowed enum values + """ + INBOUND = 'INBOUND' + OUTBOUND = 'OUTBOUND' + + @classmethod + def from_json(cls, json_str: str) -> ListMessageDirectionEnum: + """Create an instance of ListMessageDirectionEnum from a JSON string""" + return ListMessageDirectionEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/list_message_item.py b/bandwidth/models/list_message_item.py new file mode 100644 index 00000000..b87372d5 --- /dev/null +++ b/bandwidth/models/list_message_item.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum + +class ListMessageItem(BaseModel): + """ + ListMessageItem + """ + message_id: Optional[StrictStr] = Field(None, alias="messageId", description="The message id") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The account id associated with this message.") + source_tn: Optional[StrictStr] = Field(None, alias="sourceTn", description="The source phone number of the message.") + destination_tn: Optional[StrictStr] = Field(None, alias="destinationTn", description="The recipient phone number of the message.") + message_status: Optional[MessageStatusEnum] = Field(None, alias="messageStatus") + message_direction: Optional[ListMessageDirectionEnum] = Field(None, alias="messageDirection") + message_type: Optional[MessageTypeEnum] = Field(None, alias="messageType") + segment_count: Optional[StrictInt] = Field(None, alias="segmentCount", description="The number of segments the message was sent as.") + error_code: Optional[StrictInt] = Field(None, alias="errorCode", description="The numeric error code of the message.") + receive_time: Optional[datetime] = Field(None, alias="receiveTime", description="The ISO 8601 datetime of the message.") + carrier_name: Optional[StrictStr] = Field(None, alias="carrierName", description="The name of the carrier. Not currently supported for MMS coming soon.") + message_size: Optional[StrictInt] = Field(None, alias="messageSize", description="The size of the message including message content and headers.") + message_length: Optional[StrictInt] = Field(None, alias="messageLength", description="The length of the message content.") + attachment_count: Optional[StrictInt] = Field(None, alias="attachmentCount", description="The number of attachments the message has.") + recipient_count: Optional[StrictInt] = Field(None, alias="recipientCount", description="The number of recipients the message has.") + campaign_class: Optional[StrictStr] = Field(None, alias="campaignClass", description="The campaign class of the message if it has one.") + campaign_id: Optional[StrictStr] = Field(None, alias="campaignId", description="The campaign ID of the message if it has one.") + additional_properties: Dict[str, Any] = {} + __properties = ["messageId", "accountId", "sourceTn", "destinationTn", "messageStatus", "messageDirection", "messageType", "segmentCount", "errorCode", "receiveTime", "carrierName", "messageSize", "messageLength", "attachmentCount", "recipientCount", "campaignClass", "campaignId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ListMessageItem: + """Create an instance of ListMessageItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if carrier_name (nullable) is None + # and __fields_set__ contains the field + if self.carrier_name is None and "carrier_name" in self.__fields_set__: + _dict['carrierName'] = None + + # set to None if message_size (nullable) is None + # and __fields_set__ contains the field + if self.message_size is None and "message_size" in self.__fields_set__: + _dict['messageSize'] = None + + # set to None if attachment_count (nullable) is None + # and __fields_set__ contains the field + if self.attachment_count is None and "attachment_count" in self.__fields_set__: + _dict['attachmentCount'] = None + + # set to None if recipient_count (nullable) is None + # and __fields_set__ contains the field + if self.recipient_count is None and "recipient_count" in self.__fields_set__: + _dict['recipientCount'] = None + + # set to None if campaign_class (nullable) is None + # and __fields_set__ contains the field + if self.campaign_class is None and "campaign_class" in self.__fields_set__: + _dict['campaignClass'] = None + + # set to None if campaign_id (nullable) is None + # and __fields_set__ contains the field + if self.campaign_id is None and "campaign_id" in self.__fields_set__: + _dict['campaignId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ListMessageItem: + """Create an instance of ListMessageItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ListMessageItem.parse_obj(obj) + + _obj = ListMessageItem.parse_obj({ + "message_id": obj.get("messageId"), + "account_id": obj.get("accountId"), + "source_tn": obj.get("sourceTn"), + "destination_tn": obj.get("destinationTn"), + "message_status": obj.get("messageStatus"), + "message_direction": obj.get("messageDirection"), + "message_type": obj.get("messageType"), + "segment_count": obj.get("segmentCount"), + "error_code": obj.get("errorCode"), + "receive_time": obj.get("receiveTime"), + "carrier_name": obj.get("carrierName"), + "message_size": obj.get("messageSize"), + "message_length": obj.get("messageLength"), + "attachment_count": obj.get("attachmentCount"), + "recipient_count": obj.get("recipientCount"), + "campaign_class": obj.get("campaignClass"), + "campaign_id": obj.get("campaignId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/lookup_request.py b/bandwidth/models/lookup_request.py new file mode 100644 index 00000000..8c3ae281 --- /dev/null +++ b/bandwidth/models/lookup_request.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List +from pydantic import BaseModel, Field, StrictStr, conlist + +class LookupRequest(BaseModel): + """ + Create phone number lookup request. + """ + tns: conlist(StrictStr) = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["tns"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> LookupRequest: + """Create an instance of LookupRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> LookupRequest: + """Create an instance of LookupRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return LookupRequest.parse_obj(obj) + + _obj = LookupRequest.parse_obj({ + "tns": obj.get("tns") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/lookup_result.py b/bandwidth/models/lookup_result.py new file mode 100644 index 00000000..08046563 --- /dev/null +++ b/bandwidth/models/lookup_result.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr + +class LookupResult(BaseModel): + """ + Carrier information results for the specified telephone number. + """ + response_code: Optional[StrictInt] = Field(None, alias="Response Code", description="Our vendor's response code.") + message: Optional[StrictStr] = Field(None, alias="Message", description="Message associated with the response code.") + e_164_format: Optional[StrictStr] = Field(None, alias="E.164 Format", description="The telephone number in E.164 format.") + formatted: Optional[StrictStr] = Field(None, alias="Formatted", description="The formatted version of the telephone number.") + country: Optional[StrictStr] = Field(None, alias="Country", description="The country of the telephone number.") + line_type: Optional[StrictStr] = Field(None, alias="Line Type", description="The line type of the telephone number.") + line_provider: Optional[StrictStr] = Field(None, alias="Line Provider", description="The messaging service provider of the telephone number.") + mobile_country_code: Optional[StrictStr] = Field(None, alias="Mobile Country Code", description="The first half of the Home Network Identity (HNI).") + mobile_network_code: Optional[StrictStr] = Field(None, alias="Mobile Network Code", description="The second half of the HNI.") + additional_properties: Dict[str, Any] = {} + __properties = ["Response Code", "Message", "E.164 Format", "Formatted", "Country", "Line Type", "Line Provider", "Mobile Country Code", "Mobile Network Code"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> LookupResult: + """Create an instance of LookupResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> LookupResult: + """Create an instance of LookupResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return LookupResult.parse_obj(obj) + + _obj = LookupResult.parse_obj({ + "response_code": obj.get("Response Code"), + "message": obj.get("Message"), + "e_164_format": obj.get("E.164 Format"), + "formatted": obj.get("Formatted"), + "country": obj.get("Country"), + "line_type": obj.get("Line Type"), + "line_provider": obj.get("Line Provider"), + "mobile_country_code": obj.get("Mobile Country Code"), + "mobile_network_code": obj.get("Mobile Network Code") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/lookup_status.py b/bandwidth/models/lookup_status.py new file mode 100644 index 00000000..6b15872e --- /dev/null +++ b/bandwidth/models/lookup_status.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist +from bandwidth.models.lookup_result import LookupResult +from bandwidth.models.lookup_status_enum import LookupStatusEnum + +class LookupStatus(BaseModel): + """ + If requestId exists, the result for that request is returned. See the Examples for details on the various responses that you can receive. Generally, if you see a Response Code of 0 in a result for a TN, information will be available for it. Any other Response Code will indicate no information was available for the TN. + """ + request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The requestId.") + status: Optional[LookupStatusEnum] = None + result: Optional[conlist(LookupResult)] = Field(None, description="The carrier information results for the specified telephone number.") + failed_telephone_numbers: Optional[conlist(StrictStr)] = Field(None, alias="failedTelephoneNumbers", description="The telephone numbers whose lookup failed.") + additional_properties: Dict[str, Any] = {} + __properties = ["requestId", "status", "result", "failedTelephoneNumbers"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> LookupStatus: + """Create an instance of LookupStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in result (list) + _items = [] + if self.result: + for _item in self.result: + if _item: + _items.append(_item.to_dict()) + _dict['result'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> LookupStatus: + """Create an instance of LookupStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return LookupStatus.parse_obj(obj) + + _obj = LookupStatus.parse_obj({ + "request_id": obj.get("requestId"), + "status": obj.get("status"), + "result": [LookupResult.from_dict(_item) for _item in obj.get("result")] if obj.get("result") is not None else None, + "failed_telephone_numbers": obj.get("failedTelephoneNumbers") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/lookup_status_enum.py b/bandwidth/models/lookup_status_enum.py new file mode 100644 index 00000000..2de98f4c --- /dev/null +++ b/bandwidth/models/lookup_status_enum.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class LookupStatusEnum(str, Enum): + """ + The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED). + """ + + """ + allowed enum values + """ + IN_PROGRESS = 'IN_PROGRESS' + COMPLETE = 'COMPLETE' + PARTIAL_COMPLETE = 'PARTIAL_COMPLETE' + FAILED = 'FAILED' + + @classmethod + def from_json(cls, json_str: str) -> LookupStatusEnum: + """Create an instance of LookupStatusEnum from a JSON string""" + return LookupStatusEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/machine_detection_complete_callback.py b/bandwidth/models/machine_detection_complete_callback.py new file mode 100644 index 00000000..fe95ff99 --- /dev/null +++ b/bandwidth/models/machine_detection_complete_callback.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.machine_detection_result import MachineDetectionResult + +class MachineDetectionCompleteCallback(BaseModel): + """ + This event is sent to the url informed when requesting a machine detection operation. It contains the machine detection operation result, which can be: human, answering-machine, silence, timeout, error. This event is not sent when sync answering machine detection mode is chosen. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + machine_detection_result: Optional[MachineDetectionResult] = Field(None, alias="machineDetectionResult") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MachineDetectionCompleteCallback: + """Create an instance of MachineDetectionCompleteCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of machine_detection_result + if self.machine_detection_result: + _dict['machineDetectionResult'] = self.machine_detection_result.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if machine_detection_result (nullable) is None + # and __fields_set__ contains the field + if self.machine_detection_result is None and "machine_detection_result" in self.__fields_set__: + _dict['machineDetectionResult'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MachineDetectionCompleteCallback: + """Create an instance of MachineDetectionCompleteCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MachineDetectionCompleteCallback.parse_obj(obj) + + _obj = MachineDetectionCompleteCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "machine_detection_result": MachineDetectionResult.from_dict(obj.get("machineDetectionResult")) if obj.get("machineDetectionResult") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/machine_detection_configuration.py b/bandwidth/models/machine_detection_configuration.py new file mode 100644 index 00000000..6019fa1c --- /dev/null +++ b/bandwidth/models/machine_detection_configuration.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, constr +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum + +class MachineDetectionConfiguration(BaseModel): + """ + The machine detection request used to perform machine detection on the call. + """ + mode: Optional[MachineDetectionModeEnum] = None + detection_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(15, alias="detectionTimeout", description="The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent.") + silence_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(10, alias="silenceTimeout", description="If no speech is detected in this period, a callback with a 'silence' result is sent.") + speech_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(10, alias="speechThreshold", description="When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.") + speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(5, alias="speechEndThreshold", description="Amount of silence (in seconds) before assuming the callee has finished speaking.") + machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="machineSpeechEndThreshold", description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.") + delay_result: Optional[StrictBool] = Field(False, alias="delayResult", description="If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.") + callback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="callbackUrl", description="The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.") + callback_method: Optional[CallbackMethodEnum] = Field(None, alias="callbackMethod") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + fallback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="fallbackUrl", description="A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond") + fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="fallbackMethod") + fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.") + fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.") + additional_properties: Dict[str, Any] = {} + __properties = ["mode", "detectionTimeout", "silenceTimeout", "speechThreshold", "speechEndThreshold", "machineSpeechEndThreshold", "delayResult", "callbackUrl", "callbackMethod", "username", "password", "fallbackUrl", "fallbackMethod", "fallbackUsername", "fallbackPassword"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MachineDetectionConfiguration: + """Create an instance of MachineDetectionConfiguration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if detection_timeout (nullable) is None + # and __fields_set__ contains the field + if self.detection_timeout is None and "detection_timeout" in self.__fields_set__: + _dict['detectionTimeout'] = None + + # set to None if silence_timeout (nullable) is None + # and __fields_set__ contains the field + if self.silence_timeout is None and "silence_timeout" in self.__fields_set__: + _dict['silenceTimeout'] = None + + # set to None if speech_threshold (nullable) is None + # and __fields_set__ contains the field + if self.speech_threshold is None and "speech_threshold" in self.__fields_set__: + _dict['speechThreshold'] = None + + # set to None if speech_end_threshold (nullable) is None + # and __fields_set__ contains the field + if self.speech_end_threshold is None and "speech_end_threshold" in self.__fields_set__: + _dict['speechEndThreshold'] = None + + # set to None if machine_speech_end_threshold (nullable) is None + # and __fields_set__ contains the field + if self.machine_speech_end_threshold is None and "machine_speech_end_threshold" in self.__fields_set__: + _dict['machineSpeechEndThreshold'] = None + + # set to None if delay_result (nullable) is None + # and __fields_set__ contains the field + if self.delay_result is None and "delay_result" in self.__fields_set__: + _dict['delayResult'] = None + + # set to None if callback_url (nullable) is None + # and __fields_set__ contains the field + if self.callback_url is None and "callback_url" in self.__fields_set__: + _dict['callbackUrl'] = None + + # set to None if callback_method (nullable) is None + # and __fields_set__ contains the field + if self.callback_method is None and "callback_method" in self.__fields_set__: + _dict['callbackMethod'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if fallback_url (nullable) is None + # and __fields_set__ contains the field + if self.fallback_url is None and "fallback_url" in self.__fields_set__: + _dict['fallbackUrl'] = None + + # set to None if fallback_method (nullable) is None + # and __fields_set__ contains the field + if self.fallback_method is None and "fallback_method" in self.__fields_set__: + _dict['fallbackMethod'] = None + + # set to None if fallback_username (nullable) is None + # and __fields_set__ contains the field + if self.fallback_username is None and "fallback_username" in self.__fields_set__: + _dict['fallbackUsername'] = None + + # set to None if fallback_password (nullable) is None + # and __fields_set__ contains the field + if self.fallback_password is None and "fallback_password" in self.__fields_set__: + _dict['fallbackPassword'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MachineDetectionConfiguration: + """Create an instance of MachineDetectionConfiguration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MachineDetectionConfiguration.parse_obj(obj) + + _obj = MachineDetectionConfiguration.parse_obj({ + "mode": obj.get("mode"), + "detection_timeout": obj.get("detectionTimeout") if obj.get("detectionTimeout") is not None else 15, + "silence_timeout": obj.get("silenceTimeout") if obj.get("silenceTimeout") is not None else 10, + "speech_threshold": obj.get("speechThreshold") if obj.get("speechThreshold") is not None else 10, + "speech_end_threshold": obj.get("speechEndThreshold") if obj.get("speechEndThreshold") is not None else 5, + "machine_speech_end_threshold": obj.get("machineSpeechEndThreshold"), + "delay_result": obj.get("delayResult") if obj.get("delayResult") is not None else False, + "callback_url": obj.get("callbackUrl"), + "callback_method": obj.get("callbackMethod"), + "username": obj.get("username"), + "password": obj.get("password"), + "fallback_url": obj.get("fallbackUrl"), + "fallback_method": obj.get("fallbackMethod"), + "fallback_username": obj.get("fallbackUsername"), + "fallback_password": obj.get("fallbackPassword") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/machine_detection_mode_enum.py b/bandwidth/models/machine_detection_mode_enum.py new file mode 100644 index 00000000..c203e900 --- /dev/null +++ b/bandwidth/models/machine_detection_mode_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class MachineDetectionModeEnum(str, Enum): + """ + The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result. + """ + + """ + allowed enum values + """ + SYNC = 'sync' + ASYNC = 'async' + + @classmethod + def from_json(cls, json_str: str) -> MachineDetectionModeEnum: + """Create an instance of MachineDetectionModeEnum from a JSON string""" + return MachineDetectionModeEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/machine_detection_result.py b/bandwidth/models/machine_detection_result.py new file mode 100644 index 00000000..8b659c89 --- /dev/null +++ b/bandwidth/models/machine_detection_result.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class MachineDetectionResult(BaseModel): + """ + (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete + """ + value: Optional[StrictStr] = Field(None, description="Possible values are answering-machine, human, silence, timeout, or error.") + duration: Optional[StrictStr] = Field(None, description="The amount of time it took to determine the result.") + additional_properties: Dict[str, Any] = {} + __properties = ["value", "duration"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MachineDetectionResult: + """Create an instance of MachineDetectionResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MachineDetectionResult: + """Create an instance of MachineDetectionResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MachineDetectionResult.parse_obj(obj) + + _obj = MachineDetectionResult.parse_obj({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/media.py b/bandwidth/models/media.py new file mode 100644 index 00000000..b05a12a9 --- /dev/null +++ b/bandwidth/models/media.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr + +class Media(BaseModel): + """ + Media + """ + content: Optional[StrictStr] = None + content_length: Optional[StrictInt] = Field(None, alias="contentLength") + media_name: Optional[StrictStr] = Field(None, alias="mediaName") + additional_properties: Dict[str, Any] = {} + __properties = ["content", "contentLength", "mediaName"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Media: + """Create an instance of Media from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Media: + """Create an instance of Media from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Media.parse_obj(obj) + + _obj = Media.parse_obj({ + "content": obj.get("content"), + "content_length": obj.get("contentLength"), + "media_name": obj.get("mediaName") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message.py b/bandwidth/models/message.py new file mode 100644 index 00000000..566b3008 --- /dev/null +++ b/bandwidth/models/message.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum + +class Message(BaseModel): + """ + Message + """ + id: Optional[StrictStr] = Field(None, description="The id of the message.") + owner: Optional[StrictStr] = Field(None, description="The Bandwidth phone number associated with the message.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The application ID associated with the message.") + time: Optional[datetime] = Field(None, description="The datetime stamp of the message in ISO 8601") + segment_count: Optional[StrictInt] = Field(None, alias="segmentCount", description="The number of segments the original message from the user is broken into before sending over to carrier networks.") + direction: Optional[MessageDirectionEnum] = None + to: Optional[conlist(StrictStr, unique_items=True)] = Field(None, description="The phone number recipients of the message.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The phone number the message was sent from.") + media: Optional[conlist(StrictStr, unique_items=True)] = Field(None, description="The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name.") + text: Optional[StrictStr] = Field(None, description="The contents of the message.") + tag: Optional[StrictStr] = Field(None, description="The custom string set by the user.") + priority: Optional[PriorityEnum] = None + expiration: Optional[datetime] = Field(None, description="The expiration date-time set by the user.") + additional_properties: Dict[str, Any] = {} + __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "media", "text", "tag", "priority", "expiration"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Message: + """Create an instance of Message from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Message: + """Create an instance of Message from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Message.parse_obj(obj) + + _obj = Message.parse_obj({ + "id": obj.get("id"), + "owner": obj.get("owner"), + "application_id": obj.get("applicationId"), + "time": obj.get("time"), + "segment_count": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "media": obj.get("media"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "priority": obj.get("priority"), + "expiration": obj.get("expiration") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_delivered_callback.py b/bandwidth/models/message_delivered_callback.py new file mode 100644 index 00000000..e5e8d822 --- /dev/null +++ b/bandwidth/models/message_delivered_callback.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage + +class MessageDeliveredCallback(BaseModel): + """ + Message Delivered Callback + """ + time: datetime = Field(...) + type: StrictStr = Field(...) + to: StrictStr = Field(...) + description: StrictStr = Field(...) + message: MessageDeliveredCallbackMessage = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["time", "type", "to", "description", "message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageDeliveredCallback: + """Create an instance of MessageDeliveredCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of message + if self.message: + _dict['message'] = self.message.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageDeliveredCallback: + """Create an instance of MessageDeliveredCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageDeliveredCallback.parse_obj(obj) + + _obj = MessageDeliveredCallback.parse_obj({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": MessageDeliveredCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_delivered_callback_message.py b/bandwidth/models/message_delivered_callback_message.py new file mode 100644 index 00000000..2cc697f8 --- /dev/null +++ b/bandwidth/models/message_delivered_callback_message.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum + +class MessageDeliveredCallbackMessage(BaseModel): + """ + Message Delivered Callback Message Schema + """ + id: StrictStr = Field(...) + owner: StrictStr = Field(...) + application_id: StrictStr = Field(..., alias="applicationId") + time: datetime = Field(...) + segment_count: StrictInt = Field(..., alias="segmentCount") + direction: MessageDirectionEnum = Field(...) + to: conlist(StrictStr, unique_items=True) = Field(...) + var_from: StrictStr = Field(..., alias="from") + text: StrictStr = Field(...) + tag: StrictStr = Field(...) + media: Optional[conlist(StrictStr)] = None + priority: Optional[PriorityEnum] = None + additional_properties: Dict[str, Any] = {} + __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageDeliveredCallbackMessage: + """Create an instance of MessageDeliveredCallbackMessage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageDeliveredCallbackMessage: + """Create an instance of MessageDeliveredCallbackMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageDeliveredCallbackMessage.parse_obj(obj) + + _obj = MessageDeliveredCallbackMessage.parse_obj({ + "id": obj.get("id"), + "owner": obj.get("owner"), + "application_id": obj.get("applicationId"), + "time": obj.get("time"), + "segment_count": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "media": obj.get("media"), + "priority": obj.get("priority") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_direction_enum.py b/bandwidth/models/message_direction_enum.py new file mode 100644 index 00000000..41ad5fce --- /dev/null +++ b/bandwidth/models/message_direction_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class MessageDirectionEnum(str, Enum): + """ + The direction of the message. One of in out. + """ + + """ + allowed enum values + """ + IN = 'in' + OUT = 'out' + + @classmethod + def from_json(cls, json_str: str) -> MessageDirectionEnum: + """Create an instance of MessageDirectionEnum from a JSON string""" + return MessageDirectionEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/message_failed_callback.py b/bandwidth/models/message_failed_callback.py new file mode 100644 index 00000000..9e708a0f --- /dev/null +++ b/bandwidth/models/message_failed_callback.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage + +class MessageFailedCallback(BaseModel): + """ + Message Failed Callback + """ + time: datetime = Field(...) + type: StrictStr = Field(...) + to: StrictStr = Field(...) + description: StrictStr = Field(...) + message: MessageFailedCallbackMessage = Field(...) + error_code: StrictInt = Field(..., alias="errorCode") + additional_properties: Dict[str, Any] = {} + __properties = ["time", "type", "to", "description", "message", "errorCode"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageFailedCallback: + """Create an instance of MessageFailedCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of message + if self.message: + _dict['message'] = self.message.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageFailedCallback: + """Create an instance of MessageFailedCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageFailedCallback.parse_obj(obj) + + _obj = MessageFailedCallback.parse_obj({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": MessageFailedCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None, + "error_code": obj.get("errorCode") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_failed_callback_message.py b/bandwidth/models/message_failed_callback_message.py new file mode 100644 index 00000000..90155f61 --- /dev/null +++ b/bandwidth/models/message_failed_callback_message.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum + +class MessageFailedCallbackMessage(BaseModel): + """ + Message Failed Callback Message Schema + """ + id: StrictStr = Field(...) + owner: StrictStr = Field(...) + application_id: StrictStr = Field(..., alias="applicationId") + time: datetime = Field(...) + segment_count: StrictInt = Field(..., alias="segmentCount") + direction: MessageDirectionEnum = Field(...) + to: conlist(StrictStr, unique_items=True) = Field(...) + var_from: StrictStr = Field(..., alias="from") + text: StrictStr = Field(...) + tag: StrictStr = Field(...) + media: Optional[conlist(StrictStr)] = None + priority: PriorityEnum = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageFailedCallbackMessage: + """Create an instance of MessageFailedCallbackMessage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageFailedCallbackMessage: + """Create an instance of MessageFailedCallbackMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageFailedCallbackMessage.parse_obj(obj) + + _obj = MessageFailedCallbackMessage.parse_obj({ + "id": obj.get("id"), + "owner": obj.get("owner"), + "application_id": obj.get("applicationId"), + "time": obj.get("time"), + "segment_count": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "media": obj.get("media"), + "priority": obj.get("priority") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py new file mode 100644 index 00000000..8808fc40 --- /dev/null +++ b/bandwidth/models/message_request.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, constr +from bandwidth.models.priority_enum import PriorityEnum + +class MessageRequest(BaseModel): + """ + MessageRequest + """ + application_id: StrictStr = Field(..., alias="applicationId", description="The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.") + to: conlist(StrictStr, unique_items=True) = Field(..., description="The phone number(s) the message should be sent to in E164 format.") + var_from: StrictStr = Field(..., alias="from", description="One of your telephone numbers the message should come from in E164 format.") + text: Optional[constr(strict=True, max_length=2048)] = Field(None, description="The contents of the text message. Must be 2048 characters or less.") + media: Optional[conlist(constr(strict=True, max_length=4096))] = Field(None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.") + tag: Optional[StrictStr] = Field(None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") + priority: Optional[PriorityEnum] = None + expiration: Optional[datetime] = Field(None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS.") + additional_properties: Dict[str, Any] = {} + __properties = ["applicationId", "to", "from", "text", "media", "tag", "priority", "expiration"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageRequest: + """Create an instance of MessageRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageRequest: + """Create an instance of MessageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageRequest.parse_obj(obj) + + _obj = MessageRequest.parse_obj({ + "application_id": obj.get("applicationId"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "text": obj.get("text"), + "media": obj.get("media"), + "tag": obj.get("tag"), + "priority": obj.get("priority"), + "expiration": obj.get("expiration") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_sending_callback.py b/bandwidth/models/message_sending_callback.py new file mode 100644 index 00000000..c4de877d --- /dev/null +++ b/bandwidth/models/message_sending_callback.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage + +class MessageSendingCallback(BaseModel): + """ + Message Sending Callback + """ + time: datetime = Field(...) + type: StrictStr = Field(...) + to: StrictStr = Field(...) + description: StrictStr = Field(...) + message: MessageSendingCallbackMessage = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["time", "type", "to", "description", "message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageSendingCallback: + """Create an instance of MessageSendingCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of message + if self.message: + _dict['message'] = self.message.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageSendingCallback: + """Create an instance of MessageSendingCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageSendingCallback.parse_obj(obj) + + _obj = MessageSendingCallback.parse_obj({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": MessageSendingCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_sending_callback_message.py b/bandwidth/models/message_sending_callback_message.py new file mode 100644 index 00000000..7a1250b4 --- /dev/null +++ b/bandwidth/models/message_sending_callback_message.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum + +class MessageSendingCallbackMessage(BaseModel): + """ + Message Sending Callback Message Schema + """ + id: StrictStr = Field(...) + owner: StrictStr = Field(...) + application_id: StrictStr = Field(..., alias="applicationId") + time: datetime = Field(...) + segment_count: StrictInt = Field(..., alias="segmentCount") + direction: MessageDirectionEnum = Field(...) + to: conlist(StrictStr, unique_items=True) = Field(...) + var_from: StrictStr = Field(..., alias="from") + text: StrictStr = Field(...) + tag: Optional[StrictStr] = None + media: conlist(StrictStr) = Field(...) + priority: PriorityEnum = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessageSendingCallbackMessage: + """Create an instance of MessageSendingCallbackMessage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessageSendingCallbackMessage: + """Create an instance of MessageSendingCallbackMessage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessageSendingCallbackMessage.parse_obj(obj) + + _obj = MessageSendingCallbackMessage.parse_obj({ + "id": obj.get("id"), + "owner": obj.get("owner"), + "application_id": obj.get("applicationId"), + "time": obj.get("time"), + "segment_count": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "var_from": obj.get("from"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "media": obj.get("media"), + "priority": obj.get("priority") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/message_status_enum.py b/bandwidth/models/message_status_enum.py new file mode 100644 index 00000000..08e85f78 --- /dev/null +++ b/bandwidth/models/message_status_enum.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class MessageStatusEnum(str, Enum): + """ + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + """ + + """ + allowed enum values + """ + RECEIVED = 'RECEIVED' + QUEUED = 'QUEUED' + SENDING = 'SENDING' + SENT = 'SENT' + FAILED = 'FAILED' + DELIVERED = 'DELIVERED' + ACCEPTED = 'ACCEPTED' + UNDELIVERED = 'UNDELIVERED' + + @classmethod + def from_json(cls, json_str: str) -> MessageStatusEnum: + """Create an instance of MessageStatusEnum from a JSON string""" + return MessageStatusEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/message_type_enum.py b/bandwidth/models/message_type_enum.py new file mode 100644 index 00000000..7e7bca41 --- /dev/null +++ b/bandwidth/models/message_type_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class MessageTypeEnum(str, Enum): + """ + The type of message. Either SMS or MMS. + """ + + """ + allowed enum values + """ + SMS = 'sms' + MMS = 'mms' + + @classmethod + def from_json(cls, json_str: str) -> MessageTypeEnum: + """Create an instance of MessageTypeEnum from a JSON string""" + return MessageTypeEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/messages_list.py b/bandwidth/models/messages_list.py new file mode 100644 index 00000000..2bd0f4f4 --- /dev/null +++ b/bandwidth/models/messages_list.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictInt, conlist +from bandwidth.models.list_message_item import ListMessageItem +from bandwidth.models.page_info import PageInfo + +class MessagesList(BaseModel): + """ + MessagesList + """ + total_count: Optional[StrictInt] = Field(None, alias="totalCount", description="The total number of messages matched by the search. When the request has limitTotalCount set to true this value is limited to 10,000.") + page_info: Optional[PageInfo] = Field(None, alias="pageInfo") + messages: Optional[conlist(ListMessageItem)] = None + additional_properties: Dict[str, Any] = {} + __properties = ["totalCount", "pageInfo", "messages"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessagesList: + """Create an instance of MessagesList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of page_info + if self.page_info: + _dict['pageInfo'] = self.page_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in messages (list) + _items = [] + if self.messages: + for _item in self.messages: + if _item: + _items.append(_item.to_dict()) + _dict['messages'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessagesList: + """Create an instance of MessagesList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessagesList.parse_obj(obj) + + _obj = MessagesList.parse_obj({ + "total_count": obj.get("totalCount"), + "page_info": PageInfo.from_dict(obj.get("pageInfo")) if obj.get("pageInfo") is not None else None, + "messages": [ListMessageItem.from_dict(_item) for _item in obj.get("messages")] if obj.get("messages") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/messaging_code_response.py b/bandwidth/models/messaging_code_response.py new file mode 100644 index 00000000..8d2a4405 --- /dev/null +++ b/bandwidth/models/messaging_code_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class MessagingCodeResponse(BaseModel): + """ + MessagingCodeResponse + """ + message_id: Optional[StrictStr] = Field(None, alias="messageId", description="Messaging API Message ID.") + additional_properties: Dict[str, Any] = {} + __properties = ["messageId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessagingCodeResponse: + """Create an instance of MessagingCodeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessagingCodeResponse: + """Create an instance of MessagingCodeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessagingCodeResponse.parse_obj(obj) + + _obj = MessagingCodeResponse.parse_obj({ + "message_id": obj.get("messageId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/messaging_request_error.py b/bandwidth/models/messaging_request_error.py new file mode 100644 index 00000000..d4c09716 --- /dev/null +++ b/bandwidth/models/messaging_request_error.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict +from pydantic import BaseModel, Field, StrictStr + +class MessagingRequestError(BaseModel): + """ + MessagingRequestError + """ + type: StrictStr = Field(...) + description: StrictStr = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["type", "description"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MessagingRequestError: + """Create an instance of MessagingRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MessagingRequestError: + """Create an instance of MessagingRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MessagingRequestError.parse_obj(obj) + + _obj = MessagingRequestError.parse_obj({ + "type": obj.get("type"), + "description": obj.get("description") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/mfa_forbidden_request_error.py b/bandwidth/models/mfa_forbidden_request_error.py new file mode 100644 index 00000000..7cf9c507 --- /dev/null +++ b/bandwidth/models/mfa_forbidden_request_error.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class MfaForbiddenRequestError(BaseModel): + """ + MfaForbiddenRequestError + """ + message: Optional[StrictStr] = Field(None, description="The message containing the reason behind the request being forbidden.") + additional_properties: Dict[str, Any] = {} + __properties = ["message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MfaForbiddenRequestError: + """Create an instance of MfaForbiddenRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MfaForbiddenRequestError: + """Create an instance of MfaForbiddenRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MfaForbiddenRequestError.parse_obj(obj) + + _obj = MfaForbiddenRequestError.parse_obj({ + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/mfa_request_error.py b/bandwidth/models/mfa_request_error.py new file mode 100644 index 00000000..46c67736 --- /dev/null +++ b/bandwidth/models/mfa_request_error.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class MfaRequestError(BaseModel): + """ + MfaRequestError + """ + error: Optional[StrictStr] = Field(None, description="A message describing the error with your request.") + request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The associated requestId from AWS.") + additional_properties: Dict[str, Any] = {} + __properties = ["error", "requestId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MfaRequestError: + """Create an instance of MfaRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MfaRequestError: + """Create an instance of MfaRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MfaRequestError.parse_obj(obj) + + _obj = MfaRequestError.parse_obj({ + "error": obj.get("error"), + "request_id": obj.get("requestId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/mfa_unauthorized_request_error.py b/bandwidth/models/mfa_unauthorized_request_error.py new file mode 100644 index 00000000..74c61eab --- /dev/null +++ b/bandwidth/models/mfa_unauthorized_request_error.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class MfaUnauthorizedRequestError(BaseModel): + """ + MfaUnauthorizedRequestError + """ + message: Optional[StrictStr] = Field(None, description="Unauthorized") + additional_properties: Dict[str, Any] = {} + __properties = ["message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MfaUnauthorizedRequestError: + """Create an instance of MfaUnauthorizedRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MfaUnauthorizedRequestError: + """Create an instance of MfaUnauthorizedRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MfaUnauthorizedRequestError.parse_obj(obj) + + _obj = MfaUnauthorizedRequestError.parse_obj({ + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/page_info.py b/bandwidth/models/page_info.py new file mode 100644 index 00000000..2593411a --- /dev/null +++ b/bandwidth/models/page_info.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class PageInfo(BaseModel): + """ + PageInfo + """ + prev_page: Optional[StrictStr] = Field(None, alias="prevPage", description="The link to the previous page for pagination.") + next_page: Optional[StrictStr] = Field(None, alias="nextPage", description="The link to the next page for pagination.") + prev_page_token: Optional[StrictStr] = Field(None, alias="prevPageToken", description="The isolated pagination token for the previous page.") + next_page_token: Optional[StrictStr] = Field(None, alias="nextPageToken", description="The isolated pagination token for the next page.") + additional_properties: Dict[str, Any] = {} + __properties = ["prevPage", "nextPage", "prevPageToken", "nextPageToken"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PageInfo: + """Create an instance of PageInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PageInfo: + """Create an instance of PageInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PageInfo.parse_obj(obj) + + _obj = PageInfo.parse_obj({ + "prev_page": obj.get("prevPage"), + "next_page": obj.get("nextPage"), + "prev_page_token": obj.get("prevPageToken"), + "next_page_token": obj.get("nextPageToken") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/priority_enum.py b/bandwidth/models/priority_enum.py new file mode 100644 index 00000000..372dbfee --- /dev/null +++ b/bandwidth/models/priority_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class PriorityEnum(str, Enum): + """ + The priority specified by the user. Not supported on MMS. + """ + + """ + allowed enum values + """ + DEFAULT = 'default' + HIGH = 'high' + + @classmethod + def from_json(cls, json_str: str) -> PriorityEnum: + """Create an instance of PriorityEnum from a JSON string""" + return PriorityEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/recording_available_callback.py b/bandwidth/models/recording_available_callback.py new file mode 100644 index 00000000..bfd63eec --- /dev/null +++ b/bandwidth/models/recording_available_callback.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.file_format_enum import FileFormatEnum + +class RecordingAvailableCallback(BaseModel): + """ + The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + channels: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "channels", "tag", "status", "transferCallerId", "transferTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> RecordingAvailableCallback: + """Create an instance of RecordingAvailableCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> RecordingAvailableCallback: + """Create an instance of RecordingAvailableCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RecordingAvailableCallback.parse_obj(obj) + + _obj = RecordingAvailableCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "parent_call_id": obj.get("parentCallId"), + "recording_id": obj.get("recordingId"), + "media_url": obj.get("mediaUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "end_time": obj.get("endTime"), + "duration": obj.get("duration"), + "file_format": obj.get("fileFormat"), + "channels": obj.get("channels"), + "tag": obj.get("tag"), + "status": obj.get("status"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/recording_complete_callback.py b/bandwidth/models/recording_complete_callback.py new file mode 100644 index 00000000..e475ee7e --- /dev/null +++ b/bandwidth/models/recording_complete_callback.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.file_format_enum import FileFormatEnum + +class RecordingCompleteCallback(BaseModel): + """ + The Record Complete event is sent after a verb has executed if the call is still active. The BXML returned by this callback is executed next. When the recording is available for download, a Recording Available event will be sent. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "duration", "fileFormat", "channels", "tag", "transferCallerId", "transferTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> RecordingCompleteCallback: + """Create an instance of RecordingCompleteCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> RecordingCompleteCallback: + """Create an instance of RecordingCompleteCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RecordingCompleteCallback.parse_obj(obj) + + _obj = RecordingCompleteCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "parent_call_id": obj.get("parentCallId"), + "recording_id": obj.get("recordingId"), + "media_url": obj.get("mediaUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "end_time": obj.get("endTime"), + "duration": obj.get("duration"), + "file_format": obj.get("fileFormat"), + "channels": obj.get("channels"), + "tag": obj.get("tag"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/recording_state_enum.py b/bandwidth/models/recording_state_enum.py new file mode 100644 index 00000000..8a34f09f --- /dev/null +++ b/bandwidth/models/recording_state_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class RecordingStateEnum(str, Enum): + """ + The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording + """ + + """ + allowed enum values + """ + PAUSED = 'paused' + RECORDING = 'recording' + + @classmethod + def from_json(cls, json_str: str) -> RecordingStateEnum: + """Create an instance of RecordingStateEnum from a JSON string""" + return RecordingStateEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/redirect_callback.py b/bandwidth/models/redirect_callback.py new file mode 100644 index 00000000..acd681cd --- /dev/null +++ b/bandwidth/models/redirect_callback.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class RedirectCallback(BaseModel): + """ + The Redirect event is fired when a verb is executed. Its purpose is to get the next set of verbs from the calling application. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> RedirectCallback: + """Create an instance of RedirectCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> RedirectCallback: + """Create an instance of RedirectCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RedirectCallback.parse_obj(obj) + + _obj = RedirectCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "parent_call_id": obj.get("parentCallId"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/redirect_method_enum.py b/bandwidth/models/redirect_method_enum.py new file mode 100644 index 00000000..312860ce --- /dev/null +++ b/bandwidth/models/redirect_method_enum.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class RedirectMethodEnum(str, Enum): + """ + The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. + """ + + """ + allowed enum values + """ + GET = 'GET' + POST = 'POST' + + @classmethod + def from_json(cls, json_str: str) -> RedirectMethodEnum: + """Create an instance of RedirectMethodEnum from a JSON string""" + return RedirectMethodEnum(json.loads(json_str)) + + diff --git a/bandwidth/models/stir_shaken.py b/bandwidth/models/stir_shaken.py new file mode 100644 index 00000000..e2959922 --- /dev/null +++ b/bandwidth/models/stir_shaken.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class StirShaken(BaseModel): + """ + StirShaken + """ + verstat: Optional[StrictStr] = Field(None, description="(optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed.") + attestation_indicator: Optional[StrictStr] = Field(None, alias="attestationIndicator", description="(optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway).") + originating_id: Optional[StrictStr] = Field(None, alias="originatingId", description="(optional) A unique origination identifier.") + additional_properties: Dict[str, Any] = {} + __properties = ["verstat", "attestationIndicator", "originatingId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> StirShaken: + """Create an instance of StirShaken from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> StirShaken: + """Create an instance of StirShaken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return StirShaken.parse_obj(obj) + + _obj = StirShaken.parse_obj({ + "verstat": obj.get("verstat"), + "attestation_indicator": obj.get("attestationIndicator"), + "originating_id": obj.get("originatingId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/tag.py b/bandwidth/models/tag.py new file mode 100644 index 00000000..d7afeff1 --- /dev/null +++ b/bandwidth/models/tag.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, StrictStr + +class Tag(BaseModel): + """ + Tag + """ + key: Optional[StrictStr] = None + value: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties = ["key", "value"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Tag: + """Create an instance of Tag from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Tag: + """Create an instance of Tag from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Tag.parse_obj(obj) + + _obj = Tag.parse_obj({ + "key": obj.get("key"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/tn_lookup_request_error.py b/bandwidth/models/tn_lookup_request_error.py new file mode 100644 index 00000000..cb714510 --- /dev/null +++ b/bandwidth/models/tn_lookup_request_error.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class TnLookupRequestError(BaseModel): + """ + TnLookupRequestError + """ + message: Optional[StrictStr] = Field(None, description="A description of what validation error occurred.") + additional_properties: Dict[str, Any] = {} + __properties = ["message"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TnLookupRequestError: + """Create an instance of TnLookupRequestError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TnLookupRequestError: + """Create an instance of TnLookupRequestError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TnLookupRequestError.parse_obj(obj) + + _obj = TnLookupRequestError.parse_obj({ + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transcribe_recording.py b/bandwidth/models/transcribe_recording.py new file mode 100644 index 00000000..4b94cd93 --- /dev/null +++ b/bandwidth/models/transcribe_recording.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, constr +from bandwidth.models.callback_method_enum import CallbackMethodEnum + +class TranscribeRecording(BaseModel): + """ + TranscribeRecording + """ + callback_url: Optional[StrictStr] = Field(None, alias="callbackUrl", description="The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization.") + callback_method: Optional[CallbackMethodEnum] = Field(None, alias="callbackMethod") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + callback_timeout: Optional[Union[confloat(le=25, ge=1, strict=True), conint(le=25, ge=1, strict=True)]] = Field(15, alias="callbackTimeout", description="This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25.") + detect_language: Optional[StrictBool] = Field(False, alias="detectLanguage", description="A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish.") + additional_properties: Dict[str, Any] = {} + __properties = ["callbackUrl", "callbackMethod", "username", "password", "tag", "callbackTimeout", "detectLanguage"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TranscribeRecording: + """Create an instance of TranscribeRecording from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if callback_method (nullable) is None + # and __fields_set__ contains the field + if self.callback_method is None and "callback_method" in self.__fields_set__: + _dict['callbackMethod'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if callback_timeout (nullable) is None + # and __fields_set__ contains the field + if self.callback_timeout is None and "callback_timeout" in self.__fields_set__: + _dict['callbackTimeout'] = None + + # set to None if detect_language (nullable) is None + # and __fields_set__ contains the field + if self.detect_language is None and "detect_language" in self.__fields_set__: + _dict['detectLanguage'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TranscribeRecording: + """Create an instance of TranscribeRecording from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TranscribeRecording.parse_obj(obj) + + _obj = TranscribeRecording.parse_obj({ + "callback_url": obj.get("callbackUrl"), + "callback_method": obj.get("callbackMethod"), + "username": obj.get("username"), + "password": obj.get("password"), + "tag": obj.get("tag"), + "callback_timeout": obj.get("callbackTimeout") if obj.get("callbackTimeout") is not None else 15, + "detect_language": obj.get("detectLanguage") if obj.get("detectLanguage") is not None else False + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transcription.py b/bandwidth/models/transcription.py new file mode 100644 index 00000000..a33bd243 --- /dev/null +++ b/bandwidth/models/transcription.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr + +class Transcription(BaseModel): + """ + Transcription + """ + text: Optional[StrictStr] = Field(None, description="The transcribed text") + confidence: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence.") + additional_properties: Dict[str, Any] = {} + __properties = ["text", "confidence"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Transcription: + """Create an instance of Transcription from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Transcription: + """Create an instance of Transcription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Transcription.parse_obj(obj) + + _obj = Transcription.parse_obj({ + "text": obj.get("text"), + "confidence": obj.get("confidence") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transcription_available_callback.py b/bandwidth/models/transcription_available_callback.py new file mode 100644 index 00000000..ed6c54a5 --- /dev/null +++ b/bandwidth/models/transcription_available_callback.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.transcription import Transcription + +class TranscriptionAvailableCallback(BaseModel): + """ + The Transcription Available event is sent when the recording transcription is available to be downloaded. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format") + file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transcription: Optional[Transcription] = None + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "mediaUrl", "parentCallId", "recordingId", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "tag", "transcription", "transferCallerId", "transferTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TranscriptionAvailableCallback: + """Create an instance of TranscriptionAvailableCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of transcription + if self.transcription: + _dict['transcription'] = self.transcription.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if media_url (nullable) is None + # and __fields_set__ contains the field + if self.media_url is None and "media_url" in self.__fields_set__: + _dict['mediaUrl'] = None + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TranscriptionAvailableCallback: + """Create an instance of TranscriptionAvailableCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TranscriptionAvailableCallback.parse_obj(obj) + + _obj = TranscriptionAvailableCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "media_url": obj.get("mediaUrl"), + "parent_call_id": obj.get("parentCallId"), + "recording_id": obj.get("recordingId"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "end_time": obj.get("endTime"), + "duration": obj.get("duration"), + "file_format": obj.get("fileFormat"), + "tag": obj.get("tag"), + "transcription": Transcription.from_dict(obj.get("transcription")) if obj.get("transcription") is not None else None, + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transcription_list.py b/bandwidth/models/transcription_list.py new file mode 100644 index 00000000..0fa0c972 --- /dev/null +++ b/bandwidth/models/transcription_list.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, conlist +from bandwidth.models.transcription import Transcription + +class TranscriptionList(BaseModel): + """ + TranscriptionList + """ + transcripts: Optional[conlist(Transcription)] = None + additional_properties: Dict[str, Any] = {} + __properties = ["transcripts"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TranscriptionList: + """Create an instance of TranscriptionList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in transcripts (list) + _items = [] + if self.transcripts: + for _item in self.transcripts: + if _item: + _items.append(_item.to_dict()) + _dict['transcripts'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TranscriptionList: + """Create an instance of TranscriptionList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TranscriptionList.parse_obj(obj) + + _obj = TranscriptionList.parse_obj({ + "transcripts": [Transcription.from_dict(_item) for _item in obj.get("transcripts")] if obj.get("transcripts") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transcription_metadata.py b/bandwidth/models/transcription_metadata.py new file mode 100644 index 00000000..b6ed77ed --- /dev/null +++ b/bandwidth/models/transcription_metadata.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class TranscriptionMetadata(BaseModel): + """ + If the recording was transcribed, metadata about the transcription + """ + id: Optional[StrictStr] = Field(None, description="The unique transcription ID") + status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + completed_time: Optional[StrictStr] = Field(None, alias="completedTime", description="The time that the transcription was completed") + url: Optional[StrictStr] = Field(None, description="The URL of the [transcription](#operation/getCallTranscription)") + additional_properties: Dict[str, Any] = {} + __properties = ["id", "status", "completedTime", "url"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TranscriptionMetadata: + """Create an instance of TranscriptionMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TranscriptionMetadata: + """Create an instance of TranscriptionMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TranscriptionMetadata.parse_obj(obj) + + _obj = TranscriptionMetadata.parse_obj({ + "id": obj.get("id"), + "status": obj.get("status"), + "completed_time": obj.get("completedTime"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transfer_answer_callback.py b/bandwidth/models/transfer_answer_callback.py new file mode 100644 index 00000000..825f65fc --- /dev/null +++ b/bandwidth/models/transfer_answer_callback.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class TransferAnswerCallback(BaseModel): + """ + When processing a verb, this event is sent when a called party (B-leg) answers. The event is sent to the endpoint specified in the transferAnswerUrl attribute of the tag that answered. BXML returned by this callback will be executed for the called party only. After all BXML has been executed, the called party will be bridged to the original call. Most BXML verbs are allowed in response to a transferAnswer event, but some are not allowed. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TransferAnswerCallback: + """Create an instance of TransferAnswerCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TransferAnswerCallback: + """Create an instance of TransferAnswerCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TransferAnswerCallback.parse_obj(obj) + + _obj = TransferAnswerCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transfer_complete_callback.py b/bandwidth/models/transfer_complete_callback.py new file mode 100644 index 00000000..126a3ba9 --- /dev/null +++ b/bandwidth/models/transfer_complete_callback.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class TransferCompleteCallback(BaseModel): + """ + This event is sent to the transferCompleteUrl of the A-leg's verb when the transferred call (B-leg) completes. In a simultaneous ringing scenario, only one B-leg succeeds and this event corresponds to that successful leg. If none of the calls were answered, the transferComplete event corresponds to one of the legs. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") + error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.") + error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo", "cause", "errorMessage", "errorId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TransferCompleteCallback: + """Create an instance of TransferCompleteCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if error_message (nullable) is None + # and __fields_set__ contains the field + if self.error_message is None and "error_message" in self.__fields_set__: + _dict['errorMessage'] = None + + # set to None if error_id (nullable) is None + # and __fields_set__ contains the field + if self.error_id is None and "error_id" in self.__fields_set__: + _dict['errorId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TransferCompleteCallback: + """Create an instance of TransferCompleteCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TransferCompleteCallback.parse_obj(obj) + + _obj = TransferCompleteCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "tag": obj.get("tag"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo"), + "cause": obj.get("cause"), + "error_message": obj.get("errorMessage"), + "error_id": obj.get("errorId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/transfer_disconnect_callback.py b/bandwidth/models/transfer_disconnect_callback.py new file mode 100644 index 00000000..04853420 --- /dev/null +++ b/bandwidth/models/transfer_disconnect_callback.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr +from bandwidth.models.call_direction_enum import CallDirectionEnum + +class TransferDisconnectCallback(BaseModel): + """ + This event is sent to the transferDisconnectUrl of each tag when its respective call leg ends for any reason. The event is sent in the normal case, when the transferred leg is answered and later hung up, but is also sent if the new leg was never answered in the first place, if it was rejected, and if the original call leg hung up before the transferred leg. + """ + event_type: Optional[StrictStr] = Field(None, alias="eventType", description="The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.") + event_time: Optional[datetime] = Field(None, alias="eventTime", description="The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.") + account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.") + application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.") + var_from: Optional[StrictStr] = Field(None, alias="from", description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.") + to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") + direction: Optional[CallDirectionEnum] = None + call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.") + call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.") + parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.") + enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.") + start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.") + answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.") + end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format") + tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") + transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.") + transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).") + cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") + error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.") + error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.") + additional_properties: Dict[str, Any] = {} + __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "enqueuedTime", "startTime", "answerTime", "endTime", "tag", "transferCallerId", "transferTo", "cause", "errorMessage", "errorId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> TransferDisconnectCallback: + """Create an instance of TransferDisconnectCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if enqueued_time (nullable) is None + # and __fields_set__ contains the field + if self.enqueued_time is None and "enqueued_time" in self.__fields_set__: + _dict['enqueuedTime'] = None + + # set to None if answer_time (nullable) is None + # and __fields_set__ contains the field + if self.answer_time is None and "answer_time" in self.__fields_set__: + _dict['answerTime'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + # set to None if error_message (nullable) is None + # and __fields_set__ contains the field + if self.error_message is None and "error_message" in self.__fields_set__: + _dict['errorMessage'] = None + + # set to None if error_id (nullable) is None + # and __fields_set__ contains the field + if self.error_id is None and "error_id" in self.__fields_set__: + _dict['errorId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> TransferDisconnectCallback: + """Create an instance of TransferDisconnectCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TransferDisconnectCallback.parse_obj(obj) + + _obj = TransferDisconnectCallback.parse_obj({ + "event_type": obj.get("eventType"), + "event_time": obj.get("eventTime"), + "account_id": obj.get("accountId"), + "application_id": obj.get("applicationId"), + "var_from": obj.get("from"), + "to": obj.get("to"), + "direction": obj.get("direction"), + "call_id": obj.get("callId"), + "call_url": obj.get("callUrl"), + "parent_call_id": obj.get("parentCallId"), + "enqueued_time": obj.get("enqueuedTime"), + "start_time": obj.get("startTime"), + "answer_time": obj.get("answerTime"), + "end_time": obj.get("endTime"), + "tag": obj.get("tag"), + "transfer_caller_id": obj.get("transferCallerId"), + "transfer_to": obj.get("transferTo"), + "cause": obj.get("cause"), + "error_message": obj.get("errorMessage"), + "error_id": obj.get("errorId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/update_call.py b/bandwidth/models/update_call.py new file mode 100644 index 00000000..12502a96 --- /dev/null +++ b/bandwidth/models/update_call.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr, constr +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.redirect_method_enum import RedirectMethodEnum + +class UpdateCall(BaseModel): + """ + UpdateCall + """ + state: Optional[CallStateEnum] = None + redirect_url: Optional[StrictStr] = Field(None, alias="redirectUrl", description="The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`.") + redirect_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectMethod") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + redirect_fallback_url: Optional[StrictStr] = Field(None, alias="redirectFallbackUrl", description="A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond.") + redirect_fallback_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectFallbackMethod") + fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.") + fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.") + tag: Optional[constr(strict=True, max_length=256)] = Field(None, description="A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.") + additional_properties: Dict[str, Any] = {} + __properties = ["state", "redirectUrl", "redirectMethod", "username", "password", "redirectFallbackUrl", "redirectFallbackMethod", "fallbackUsername", "fallbackPassword", "tag"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> UpdateCall: + """Create an instance of UpdateCall from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if state (nullable) is None + # and __fields_set__ contains the field + if self.state is None and "state" in self.__fields_set__: + _dict['state'] = None + + # set to None if redirect_url (nullable) is None + # and __fields_set__ contains the field + if self.redirect_url is None and "redirect_url" in self.__fields_set__: + _dict['redirectUrl'] = None + + # set to None if redirect_method (nullable) is None + # and __fields_set__ contains the field + if self.redirect_method is None and "redirect_method" in self.__fields_set__: + _dict['redirectMethod'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if redirect_fallback_url (nullable) is None + # and __fields_set__ contains the field + if self.redirect_fallback_url is None and "redirect_fallback_url" in self.__fields_set__: + _dict['redirectFallbackUrl'] = None + + # set to None if redirect_fallback_method (nullable) is None + # and __fields_set__ contains the field + if self.redirect_fallback_method is None and "redirect_fallback_method" in self.__fields_set__: + _dict['redirectFallbackMethod'] = None + + # set to None if fallback_username (nullable) is None + # and __fields_set__ contains the field + if self.fallback_username is None and "fallback_username" in self.__fields_set__: + _dict['fallbackUsername'] = None + + # set to None if fallback_password (nullable) is None + # and __fields_set__ contains the field + if self.fallback_password is None and "fallback_password" in self.__fields_set__: + _dict['fallbackPassword'] = None + + # set to None if tag (nullable) is None + # and __fields_set__ contains the field + if self.tag is None and "tag" in self.__fields_set__: + _dict['tag'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> UpdateCall: + """Create an instance of UpdateCall from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UpdateCall.parse_obj(obj) + + _obj = UpdateCall.parse_obj({ + "state": obj.get("state"), + "redirect_url": obj.get("redirectUrl"), + "redirect_method": obj.get("redirectMethod"), + "username": obj.get("username"), + "password": obj.get("password"), + "redirect_fallback_url": obj.get("redirectFallbackUrl"), + "redirect_fallback_method": obj.get("redirectFallbackMethod"), + "fallback_username": obj.get("fallbackUsername"), + "fallback_password": obj.get("fallbackPassword"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/update_call_recording.py b/bandwidth/models/update_call_recording.py new file mode 100644 index 00000000..3edf7933 --- /dev/null +++ b/bandwidth/models/update_call_recording.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict +from pydantic import BaseModel, Field +from bandwidth.models.recording_state_enum import RecordingStateEnum + +class UpdateCallRecording(BaseModel): + """ + UpdateCallRecording + """ + state: RecordingStateEnum = Field(...) + additional_properties: Dict[str, Any] = {} + __properties = ["state"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> UpdateCallRecording: + """Create an instance of UpdateCallRecording from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> UpdateCallRecording: + """Create an instance of UpdateCallRecording from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UpdateCallRecording.parse_obj(obj) + + _obj = UpdateCallRecording.parse_obj({ + "state": obj.get("state") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/update_conference.py b/bandwidth/models/update_conference.py new file mode 100644 index 00000000..77e3050f --- /dev/null +++ b/bandwidth/models/update_conference.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr, constr +from bandwidth.models.conference_state_enum import ConferenceStateEnum +from bandwidth.models.redirect_method_enum import RedirectMethodEnum + +class UpdateConference(BaseModel): + """ + UpdateConference + """ + status: Optional[ConferenceStateEnum] = None + redirect_url: Optional[StrictStr] = Field(None, alias="redirectUrl", description="The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`.") + redirect_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectMethod") + username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.") + password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.") + redirect_fallback_url: Optional[StrictStr] = Field(None, alias="redirectFallbackUrl", description="A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`.") + redirect_fallback_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectFallbackMethod") + fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.") + fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.") + additional_properties: Dict[str, Any] = {} + __properties = ["status", "redirectUrl", "redirectMethod", "username", "password", "redirectFallbackUrl", "redirectFallbackMethod", "fallbackUsername", "fallbackPassword"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> UpdateConference: + """Create an instance of UpdateConference from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if status (nullable) is None + # and __fields_set__ contains the field + if self.status is None and "status" in self.__fields_set__: + _dict['status'] = None + + # set to None if redirect_url (nullable) is None + # and __fields_set__ contains the field + if self.redirect_url is None and "redirect_url" in self.__fields_set__: + _dict['redirectUrl'] = None + + # set to None if redirect_method (nullable) is None + # and __fields_set__ contains the field + if self.redirect_method is None and "redirect_method" in self.__fields_set__: + _dict['redirectMethod'] = None + + # set to None if username (nullable) is None + # and __fields_set__ contains the field + if self.username is None and "username" in self.__fields_set__: + _dict['username'] = None + + # set to None if password (nullable) is None + # and __fields_set__ contains the field + if self.password is None and "password" in self.__fields_set__: + _dict['password'] = None + + # set to None if redirect_fallback_url (nullable) is None + # and __fields_set__ contains the field + if self.redirect_fallback_url is None and "redirect_fallback_url" in self.__fields_set__: + _dict['redirectFallbackUrl'] = None + + # set to None if redirect_fallback_method (nullable) is None + # and __fields_set__ contains the field + if self.redirect_fallback_method is None and "redirect_fallback_method" in self.__fields_set__: + _dict['redirectFallbackMethod'] = None + + # set to None if fallback_username (nullable) is None + # and __fields_set__ contains the field + if self.fallback_username is None and "fallback_username" in self.__fields_set__: + _dict['fallbackUsername'] = None + + # set to None if fallback_password (nullable) is None + # and __fields_set__ contains the field + if self.fallback_password is None and "fallback_password" in self.__fields_set__: + _dict['fallbackPassword'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> UpdateConference: + """Create an instance of UpdateConference from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UpdateConference.parse_obj(obj) + + _obj = UpdateConference.parse_obj({ + "status": obj.get("status"), + "redirect_url": obj.get("redirectUrl"), + "redirect_method": obj.get("redirectMethod"), + "username": obj.get("username"), + "password": obj.get("password"), + "redirect_fallback_url": obj.get("redirectFallbackUrl"), + "redirect_fallback_method": obj.get("redirectFallbackMethod"), + "fallback_username": obj.get("fallbackUsername"), + "fallback_password": obj.get("fallbackPassword") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/update_conference_member.py b/bandwidth/models/update_conference_member.py new file mode 100644 index 00000000..6bd47612 --- /dev/null +++ b/bandwidth/models/update_conference_member.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist + +class UpdateConferenceMember(BaseModel): + """ + UpdateConferenceMember + """ + mute: Optional[StrictBool] = Field(None, description="Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted.") + hold: Optional[StrictBool] = Field(None, description="Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted.") + call_ids_to_coach: Optional[conlist(StrictStr)] = Field(None, alias="callIdsToCoach", description="If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.") + additional_properties: Dict[str, Any] = {} + __properties = ["mute", "hold", "callIdsToCoach"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> UpdateConferenceMember: + """Create an instance of UpdateConferenceMember from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if call_ids_to_coach (nullable) is None + # and __fields_set__ contains the field + if self.call_ids_to_coach is None and "call_ids_to_coach" in self.__fields_set__: + _dict['callIdsToCoach'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> UpdateConferenceMember: + """Create an instance of UpdateConferenceMember from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UpdateConferenceMember.parse_obj(obj) + + _obj = UpdateConferenceMember.parse_obj({ + "mute": obj.get("mute"), + "hold": obj.get("hold"), + "call_ids_to_coach": obj.get("callIdsToCoach") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/verify_code_request.py b/bandwidth/models/verify_code_request.py new file mode 100644 index 00000000..a45802e9 --- /dev/null +++ b/bandwidth/models/verify_code_request.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictStr, confloat, conint, constr, validator + +class VerifyCodeRequest(BaseModel): + """ + VerifyCodeRequest + """ + to: constr(strict=True) = Field(..., description="The phone number to send the mfa code to.") + scope: Optional[StrictStr] = Field(None, description="An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".") + expiration_time_in_minutes: Union[confloat(le=15, ge=1, strict=True), conint(le=15, ge=1, strict=True)] = Field(..., alias="expirationTimeInMinutes", description="The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively.") + code: constr(strict=True, max_length=8, min_length=4) = Field(..., description="The generated mfa code to check if valid.") + additional_properties: Dict[str, Any] = {} + __properties = ["to", "scope", "expirationTimeInMinutes", "code"] + + @validator('to') + def to_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^\+[1-9]\d{1,14}$", value): + raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/") + return value + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> VerifyCodeRequest: + """Create an instance of VerifyCodeRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> VerifyCodeRequest: + """Create an instance of VerifyCodeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VerifyCodeRequest.parse_obj(obj) + + _obj = VerifyCodeRequest.parse_obj({ + "to": obj.get("to"), + "scope": obj.get("scope"), + "expiration_time_in_minutes": obj.get("expirationTimeInMinutes"), + "code": obj.get("code") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/verify_code_response.py b/bandwidth/models/verify_code_response.py new file mode 100644 index 00000000..f935d5f2 --- /dev/null +++ b/bandwidth/models/verify_code_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictBool + +class VerifyCodeResponse(BaseModel): + """ + VerifyCodeResponse + """ + valid: Optional[StrictBool] = Field(None, description="Whether or not the supplied code is valid.") + additional_properties: Dict[str, Any] = {} + __properties = ["valid"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> VerifyCodeResponse: + """Create an instance of VerifyCodeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> VerifyCodeResponse: + """Create an instance of VerifyCodeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VerifyCodeResponse.parse_obj(obj) + + _obj = VerifyCodeResponse.parse_obj({ + "valid": obj.get("valid") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/voice_api_error.py b/bandwidth/models/voice_api_error.py new file mode 100644 index 00000000..65fd3eba --- /dev/null +++ b/bandwidth/models/voice_api_error.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, StrictStr + +class VoiceApiError(BaseModel): + """ + VoiceApiError + """ + type: Optional[StrictStr] = None + description: Optional[StrictStr] = None + id: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties = ["type", "description", "id"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> VoiceApiError: + """Create an instance of VoiceApiError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if id (nullable) is None + # and __fields_set__ contains the field + if self.id is None and "id" in self.__fields_set__: + _dict['id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> VoiceApiError: + """Create an instance of VoiceApiError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VoiceApiError.parse_obj(obj) + + _obj = VoiceApiError.parse_obj({ + "type": obj.get("type"), + "description": obj.get("description"), + "id": obj.get("id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/voice_code_response.py b/bandwidth/models/voice_code_response.py new file mode 100644 index 00000000..8704a2ba --- /dev/null +++ b/bandwidth/models/voice_code_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field, StrictStr + +class VoiceCodeResponse(BaseModel): + """ + VoiceCodeResponse + """ + call_id: Optional[StrictStr] = Field(None, alias="callId", description="Programmable Voice API Call ID.") + additional_properties: Dict[str, Any] = {} + __properties = ["callId"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> VoiceCodeResponse: + """Create an instance of VoiceCodeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> VoiceCodeResponse: + """Create an instance of VoiceCodeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VoiceCodeResponse.parse_obj(obj) + + _obj = VoiceCodeResponse.parse_obj({ + "call_id": obj.get("callId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/py.typed b/bandwidth/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/bandwidth/rest.py b/bandwidth/rest.py index 9cfb0bce..d8fd7794 100644 --- a/bandwidth/rest.py +++ b/bandwidth/rest.py @@ -1,12 +1,16 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import io @@ -14,13 +18,11 @@ import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + +from urllib.parse import urlencode, quote_plus import urllib3 -import ipaddress -from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException logger = logging.getLogger(__name__) @@ -36,11 +38,11 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.urllib3_response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.urllib3_response.headers.get(name, default) class RESTClientObject(object): @@ -65,6 +67,10 @@ def __init__(self, configuration, pools_size=4, maxsize=None): if configuration.retries is not None: addition_pool_args['retries'] = configuration.retries + if configuration.tls_server_name: + addition_pool_args['server_hostname'] = configuration.tls_server_name + + if configuration.socket_options is not None: addition_pool_args['socket_options'] = configuration.socket_options @@ -75,8 +81,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): maxsize = 4 # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): + if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, @@ -131,10 +136,13 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} + # url already contains the URL query string + # so reset query_params to empty dict + query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): @@ -144,13 +152,9 @@ def request(self, method, url, query_params=None, headers=None, try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) @@ -200,7 +204,7 @@ def request(self, method, url, query_params=None, headers=None, # For `GET`, `HEAD` else: r = self.pool_manager.request(method, url, - fields=query_params, + fields={}, preload_content=_preload_content, timeout=timeout, headers=headers) @@ -215,6 +219,9 @@ def request(self, method, url, query_params=None, headers=None, logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: + if r.status == 400: + raise BadRequestException(http_resp=r) + if r.status == 401: raise UnauthorizedException(http_resp=r) @@ -231,7 +238,7 @@ def request(self, method, url, query_params=None, headers=None, return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, + def get_request(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): return self.request("GET", url, headers=headers, @@ -239,7 +246,7 @@ def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=_request_timeout, query_params=query_params) - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + def head_request(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): return self.request("HEAD", url, headers=headers, @@ -247,7 +254,7 @@ def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=_request_timeout, query_params=query_params) - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + def options_request(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): return self.request("OPTIONS", url, headers=headers, @@ -257,7 +264,7 @@ def OPTIONS(self, url, headers=None, query_params=None, post_params=None, _request_timeout=_request_timeout, body=body) - def DELETE(self, url, headers=None, query_params=None, body=None, + def delete_request(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): return self.request("DELETE", url, headers=headers, @@ -266,7 +273,7 @@ def DELETE(self, url, headers=None, query_params=None, body=None, _request_timeout=_request_timeout, body=body) - def POST(self, url, headers=None, query_params=None, post_params=None, + def post_request(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): return self.request("POST", url, headers=headers, @@ -276,7 +283,7 @@ def POST(self, url, headers=None, query_params=None, post_params=None, _request_timeout=_request_timeout, body=body) - def PUT(self, url, headers=None, query_params=None, post_params=None, + def put_request(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): return self.request("PUT", url, headers=headers, @@ -286,7 +293,7 @@ def PUT(self, url, headers=None, query_params=None, post_params=None, _request_timeout=_request_timeout, body=body) - def PATCH(self, url, headers=None, query_params=None, post_params=None, + def patch_request(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, _request_timeout=None): return self.request("PATCH", url, headers=headers, @@ -295,59 +302,3 @@ def PATCH(self, url, headers=None, query_params=None, post_params=None, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/docs/AccountStatistics.md b/docs/AccountStatistics.md index 37c7206d..58efebeb 100644 --- a/docs/AccountStatistics.md +++ b/docs/AccountStatistics.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **current_call_queue_size** | **int** | The number of calls currently enqueued. | [optional] **max_call_queue_size** | **int** | The maximum size of the queue before outgoing calls start being rejected. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.account_statistics import AccountStatistics + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountStatistics from a JSON string +account_statistics_instance = AccountStatistics.from_json(json) +# print the JSON string representation of the object +print AccountStatistics.to_json() + +# convert the object into a dict +account_statistics_dict = account_statistics_instance.to_dict() +# create an instance of AccountStatistics from a dict +account_statistics_form_dict = account_statistics.from_dict(account_statistics_dict) +``` [[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/AnswerCallback.md b/docs/AnswerCallback.md index b9d89f58..bf6127d2 100644 --- a/docs/AnswerCallback.md +++ b/docs/AnswerCallback.md @@ -6,21 +6,37 @@ The Answer event is sent to the answerUrl specified in the createCall request wh Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**machine_detection_result** | **str, none_type** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] +## Example + +```python +from bandwidth.models.answer_callback import AnswerCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of AnswerCallback from a JSON string +answer_callback_instance = AnswerCallback.from_json(json) +# print the JSON string representation of the object +print AnswerCallback.to_json() + +# convert the object into a dict +answer_callback_dict = answer_callback_instance.to_dict() +# create an instance of AnswerCallback from a dict +answer_callback_form_dict = answer_callback.from_dict(answer_callback_dict) +``` [[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/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md index 3d018511..d1f03961 100644 --- a/docs/BridgeCompleteCallback.md +++ b/docs/BridgeCompleteCallback.md @@ -6,23 +6,39 @@ If the target call leaves the , then this callback is sent to the bridge Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] -**error_message** | **str, none_type** | Text explaining the reason that caused the call to fail in case of errors. | [optional] -**error_id** | **str, none_type** | Bandwidth's internal id that references the error event. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] +**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional] +## Example + +```python +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of BridgeCompleteCallback from a JSON string +bridge_complete_callback_instance = BridgeCompleteCallback.from_json(json) +# print the JSON string representation of the object +print BridgeCompleteCallback.to_json() + +# convert the object into a dict +bridge_complete_callback_dict = bridge_complete_callback_instance.to_dict() +# create an instance of BridgeCompleteCallback from a dict +bridge_complete_callback_form_dict = bridge_complete_callback.from_dict(bridge_complete_callback_dict) +``` [[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/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md index e4de7047..d9d885e2 100644 --- a/docs/BridgeTargetCompleteCallback.md +++ b/docs/BridgeTargetCompleteCallback.md @@ -6,20 +6,36 @@ If the originating call leaves the , then this callback is sent to the b Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of BridgeTargetCompleteCallback from a JSON string +bridge_target_complete_callback_instance = BridgeTargetCompleteCallback.from_json(json) +# print the JSON string representation of the object +print BridgeTargetCompleteCallback.to_json() + +# convert the object into a dict +bridge_target_complete_callback_dict = bridge_target_complete_callback_instance.to_dict() +# create an instance of BridgeTargetCompleteCallback from a dict +bridge_target_complete_callback_form_dict = bridge_target_complete_callback.from_dict(bridge_target_complete_callback_dict) +``` [[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/CallCallback.md b/docs/CallCallback.md deleted file mode 100644 index 42371397..00000000 --- a/docs/CallCallback.md +++ /dev/null @@ -1,42 +0,0 @@ -# CallCallback - -This object represents all possible fields that may be included in callbacks related to call events, including events that come from BXML verbs - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**event_type** | **str** | | [optional] -**event_time** | **str** | | [optional] -**account_id** | **str** | | [optional] -**application_id** | **str** | | [optional] -**_from** | **str** | | [optional] -**to** | **str** | | [optional] -**direction** | **str** | | [optional] -**call_id** | **str** | | [optional] -**call_url** | **str** | | [optional] -**start_time** | **str** | | [optional] -**answer_time** | **str** | | [optional] -**transfer_caller_id** | **str** | | [optional] -**transfer_to** | **str** | | [optional] -**cause** | **str** | | [optional] -**error_message** | **str** | | [optional] -**error_id** | **str** | | [optional] -**end_time** | **str** | | [optional] -**digit** | **str** | | [optional] -**parent_call_id** | **str** | | [optional] -**recording_id** | **str** | | [optional] -**duration** | **str** | | [optional] -**file_format** | **str** | | [optional] -**media_url** | **str** | | [optional] -**tag** | **str** | | [optional] -**channels** | **int** | | [optional] -**status** | **str** | | [optional] -**digits** | **str** | | [optional] -**terminating_digit** | **str** | | [optional] -**transcription** | [**Transcription**](Transcription.md) | | [optional] -**diversion** | [**Diversion**](Diversion.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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/CallDirectionEnum.md b/docs/CallDirectionEnum.md index cab5a41d..7bc0ad21 100644 --- a/docs/CallDirectionEnum.md +++ b/docs/CallDirectionEnum.md @@ -5,7 +5,6 @@ The direction of the call. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The direction of the call. | must be one of ["inbound", "outbound", ] [[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/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md index d31c11b1..56ea2a38 100644 --- a/docs/CallRecordingMetadata.md +++ b/docs/CallRecordingMetadata.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **recording_id** | **str** | The unique ID of this recording | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] @@ -20,10 +20,26 @@ Name | Type | Description | Notes **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] **transcription** | [**TranscriptionMetadata**](TranscriptionMetadata.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.call_recording_metadata import CallRecordingMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of CallRecordingMetadata from a JSON string +call_recording_metadata_instance = CallRecordingMetadata.from_json(json) +# print the JSON string representation of the object +print CallRecordingMetadata.to_json() + +# convert the object into a dict +call_recording_metadata_dict = call_recording_metadata_instance.to_dict() +# create an instance of CallRecordingMetadata from a dict +call_recording_metadata_form_dict = call_recording_metadata.from_dict(call_recording_metadata_dict) +``` [[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/CallState.md b/docs/CallState.md index 6e035fef..2ddefa30 100644 --- a/docs/CallState.md +++ b/docs/CallState.md @@ -7,23 +7,39 @@ Name | Type | Description | Notes **application_id** | **str** | The application id associated with the call. | [optional] **account_id** | **str** | The account id associated with the call. | [optional] **call_id** | **str** | The programmable voice API call ID. | [optional] -**parent_call_id** | **str, none_type** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional] -**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI | [optional] -**_from** | **str** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional] +**parent_call_id** | **str** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional] +**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. | [optional] +**var_from** | **str** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **state** | **str** | The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**stir_shaken** | **{str: (str,)}, none_type** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken) | [optional] -**identity** | **str, none_type** | The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. | [optional] -**enqueued_time** | **datetime, none_type** | The time this call was placed in queue. | [optional] -**start_time** | **datetime, none_type** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional] -**answer_time** | **datetime, none_type** | Populated once the call has been answered, with the time in ISO 8601 format. | [optional] -**end_time** | **datetime, none_type** | Populated once the call has ended, with the time in ISO 8601 format. | [optional] -**disconnect_cause** | **str, none_type** | | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [`<Hangup>`](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future. | [optional] -**error_message** | **str, none_type** | Populated only if the call ended with an error, with text explaining the reason. | [optional] -**error_id** | **str, none_type** | Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. | [optional] +**stir_shaken** | **Dict[str, str]** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). | [optional] +**identity** | **str** | The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. | [optional] +**enqueued_time** | **datetime** | The time this call was placed in queue. | [optional] +**start_time** | **datetime** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional] +**answer_time** | **datetime** | Populated once the call has been answered, with the time in ISO 8601 format. | [optional] +**end_time** | **datetime** | Populated once the call has ended, with the time in ISO 8601 format. | [optional] +**disconnect_cause** | **str** | | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [`<Hangup>`](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future. | [optional] +**error_message** | **str** | Populated only if the call ended with an error, with text explaining the reason. | [optional] +**error_id** | **str** | Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. | [optional] **last_update** | **datetime** | The last time the call had a state update, in ISO 8601 format. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.call_state import CallState + +# TODO update the JSON string below +json = "{}" +# create an instance of CallState from a JSON string +call_state_instance = CallState.from_json(json) +# print the JSON string representation of the object +print CallState.to_json() + +# convert the object into a dict +call_state_dict = call_state_instance.to_dict() +# create an instance of CallState from a dict +call_state_form_dict = call_state.from_dict(call_state_dict) +``` [[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/CallStateEnum.md b/docs/CallStateEnum.md index 5b95cf41..051e3b88 100644 --- a/docs/CallStateEnum.md +++ b/docs/CallStateEnum.md @@ -5,7 +5,6 @@ The call state. Possible values:
`active` to redirect the call (default)
` ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The call state. Possible values:<br>`active` to redirect the call (default)<br>`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call | defaults to "active", must be one of ["active", "completed", ] [[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/CallbackMethodEnum.md b/docs/CallbackMethodEnum.md index ab939808..aa0ef6ae 100644 --- a/docs/CallbackMethodEnum.md +++ b/docs/CallbackMethodEnum.md @@ -5,7 +5,6 @@ The HTTP method to use to deliver the callback. GET or POST. Default value is PO ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The HTTP method to use to deliver the callback. GET or POST. Default value is POST. | defaults to "POST", must be one of ["GET", "POST", ] [[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/CallsApi.md b/docs/CallsApi.md index 9ffc9b1c..7b4d4fc7 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -20,15 +20,15 @@ Creates an outbound phone call. All calls are initially queued. Your outbound c ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import calls_api -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -42,69 +42,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = calls_api.CallsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - create_call = CreateCall( - to="+19195551234", - _from="+19195554321", - uui="eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ=;encoding=base64", - application_id="1234-qwer-5679-tyui", - answer_url="https://www.myCallbackServer.com/webhooks/answer", - answer_method=CallbackMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - answer_fallback_url="https://www.myFallbackServer.com/webhooks/answer", - answer_fallback_method=CallbackMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - disconnect_url="disconnect_url_example", - disconnect_method=CallbackMethodEnum("POST"), - call_timeout=30, - callback_timeout=15, - machine_detection=MachineDetectionConfiguration( - mode=MachineDetectionModeEnum("async"), - detection_timeout=15, - silence_timeout=10, - speech_threshold=10, - speech_end_threshold=5, - machine_speech_end_threshold=5, - delay_result=False, - callback_url="https://myServer.com/bandwidth/webhooks/machineDetectionComplete", - callback_method=CallbackMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - fallback_url="https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete", - fallback_method=CallbackMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - ), - priority=5, - tag="tag_example", - ) # CreateCall | JSON object containing information to create an outbound call - - # example passing only required values which don't have defaults set + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + create_call = bandwidth.CreateCall() # CreateCall | JSON object containing information to create an outbound call + try: # Create Call api_response = api_instance.create_call(account_id, create_call) + print("The response of CallsApi->create_call:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling CallsApi->create_call: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **create_call** | [**CreateCall**](CreateCall.md)| JSON object containing information to create an outbound call | + **account_id** | **str**| Your Bandwidth Account ID. | + **create_call** | [**CreateCall**](CreateCall.md)| JSON object containing information to create an outbound call | ### Return type @@ -119,9 +84,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Call Successfully Created | * Location - The URL for further interactions with this call
| @@ -131,7 +94,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -146,14 +109,14 @@ Retrieve the current state of a specific call. This information is near-realtime ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import calls_api -from bandwidth.model.call_state import CallState -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.call_state import CallState +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -167,33 +130,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = calls_api.CallsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. - # example passing only required values which don't have defaults set try: # Get Call State Information api_response = api_instance.get_call_state(account_id, call_id) + print("The response of CallsApi->get_call_state:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling CallsApi->get_call_state: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | ### Return type @@ -208,9 +172,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Call found | - | @@ -220,7 +182,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -235,14 +197,14 @@ Interrupts and redirects a call to a different URL that should return a BXML doc ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import calls_api -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.update_call import UpdateCall +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -256,45 +218,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = calls_api.CallsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - update_call = UpdateCall( - state=CallStateEnum("active"), - redirect_url="https://myServer.com/bandwidth/webhooks/redirect", - redirect_method=RedirectMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - redirect_fallback_url="https://myFallbackServer.com/bandwidth/webhooks/redirect", - redirect_fallback_method=RedirectMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - tag="My Custom Tag", - ) # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document - - # example passing only required values which don't have defaults set + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + update_call = bandwidth.UpdateCall() # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document + try: # Update Call api_instance.update_call(account_id, call_id, update_call) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling CallsApi->update_call: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **update_call** | [**UpdateCall**](UpdateCall.md)| JSON object containing information to redirect an existing call to a new BXML document | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **update_call** | [**UpdateCall**](UpdateCall.md)| JSON object containing information to redirect an existing call to a new BXML document | ### Return type @@ -309,12 +260,10 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Call Successfully Modified | - | +**200** | Call was successfully modified. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -322,7 +271,7 @@ void (empty response body) **405** | Method Not Allowed | - | **409** | Conflict | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -337,13 +286,13 @@ Interrupts and replaces an active call's BXML document. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import calls_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -357,37 +306,37 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = calls_api.CallsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - body = ''' + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + body = This is a test sentence. -''' # str | + # str | - # example passing only required values which don't have defaults set try: # Update Call BXML api_instance.update_call_bxml(account_id, call_id, body) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling CallsApi->update_call_bxml: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **body** | **str**| | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **body** | **str**| | ### Return type @@ -402,12 +351,10 @@ void (empty response body) - **Content-Type**: application/xml - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Call BXML Successfully Replaced | - | +**204** | Call BXML was successfully replaced. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -415,7 +362,7 @@ void (empty response body) **405** | Method Not Allowed | - | **409** | Conflict | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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/CodeRequest.md b/docs/CodeRequest.md index e06ebd7f..e0c3b255 100644 --- a/docs/CodeRequest.md +++ b/docs/CodeRequest.md @@ -5,13 +5,29 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **to** | **str** | The phone number to send the mfa code to. | -**_from** | **str** | The application phone number, the sender of the mfa code. | +**var_from** | **str** | The application phone number, the sender of the mfa code. | **application_id** | **str** | The application unique ID, obtained from Bandwidth. | +**scope** | **str** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] **message** | **str** | The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. | **digits** | **int** | The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. | -**scope** | **str** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.code_request import CodeRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CodeRequest from a JSON string +code_request_instance = CodeRequest.from_json(json) +# print the JSON string representation of the object +print CodeRequest.to_json() + +# convert the object into a dict +code_request_dict = code_request_instance.to_dict() +# create an instance of CodeRequest from a dict +code_request_form_dict = code_request.from_dict(code_request_dict) +``` [[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/Conference.md b/docs/Conference.md index 7d6848c3..a66b6593 100644 --- a/docs/Conference.md +++ b/docs/Conference.md @@ -4,16 +4,32 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | The Bandwidth-generated conference ID | [optional] -**name** | **str** | The name of the conference, as specified by your application | [optional] +**id** | **str** | The Bandwidth-generated conference ID. | [optional] +**name** | **str** | The name of the conference, as specified by your application. | [optional] **created_time** | **datetime** | The time the conference was initiated, in ISO 8601 format. | [optional] -**completed_time** | **datetime, none_type** | The time the conference was terminated, in ISO 8601 format. | [optional] -**conference_event_url** | **str, none_type** | The URL to send the conference-related events. | [optional] +**completed_time** | **datetime** | The time the conference was terminated, in ISO 8601 format. | [optional] +**conference_event_url** | **str** | The URL to send the conference-related events. | [optional] **conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**tag** | **str, none_type** | The custom string attached to the conference that will be sent with callbacks. | [optional] -**active_members** | [**[ConferenceMember], none_type**](ConferenceMember.md) | A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences) | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | The custom string attached to the conference that will be sent with callbacks. | [optional] +**active_members** | [**List[ConferenceMember]**](ConferenceMember.md) | A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). | [optional] +## Example + +```python +from bandwidth.models.conference import Conference + +# TODO update the JSON string below +json = "{}" +# create an instance of Conference from a JSON string +conference_instance = Conference.from_json(json) +# print the JSON string representation of the object +print Conference.to_json() + +# convert the object into a dict +conference_dict = conference_instance.to_dict() +# create an instance of Conference from a dict +conference_form_dict = conference.from_dict(conference_dict) +``` [[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/ConferenceCallback.md b/docs/ConferenceCallback.md deleted file mode 100644 index b2620d3f..00000000 --- a/docs/ConferenceCallback.md +++ /dev/null @@ -1,29 +0,0 @@ -# ConferenceCallback - -This object represents all possible fields that may be included in callbacks related to conference events - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**conference_id** | **str** | | [optional] -**name** | **str** | | [optional] -**event_type** | **str** | | [optional] -**event_time** | **str** | | [optional] -**tag** | **str** | | [optional] -**call_id** | **str** | | [optional] -**to** | **str** | | [optional] -**_from** | **str** | | [optional] -**account_id** | **str** | | [optional] -**recording_id** | **str** | | [optional] -**channels** | **int** | | [optional] -**start_time** | **str** | | [optional] -**end_time** | **str** | | [optional] -**duration** | **str** | | [optional] -**file_format** | **str** | | [optional] -**media_url** | **str** | | [optional] -**status** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md index 290439ec..bf449190 100644 --- a/docs/ConferenceCompletedCallback.md +++ b/docs/ConferenceCompletedCallback.md @@ -6,12 +6,28 @@ The Conference Completed event is fired when the last member leaves the conferen Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceCompletedCallback from a JSON string +conference_completed_callback_instance = ConferenceCompletedCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceCompletedCallback.to_json() + +# convert the object into a dict +conference_completed_callback_dict = conference_completed_callback_instance.to_dict() +# create an instance of ConferenceCompletedCallback from a dict +conference_completed_callback_form_dict = conference_completed_callback.from_dict(conference_completed_callback_dict) +``` [[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/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md index 03b1448a..4a976b29 100644 --- a/docs/ConferenceCreatedCallback.md +++ b/docs/ConferenceCreatedCallback.md @@ -6,12 +6,28 @@ The Conference Created event is fired whenever a new conference that specified a Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceCreatedCallback from a JSON string +conference_created_callback_instance = ConferenceCreatedCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceCreatedCallback.to_json() + +# convert the object into a dict +conference_created_callback_dict = conference_created_callback_instance.to_dict() +# create an instance of ConferenceCreatedCallback from a dict +conference_created_callback_form_dict = conference_created_callback.from_dict(conference_created_callback_dict) +``` [[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/ConferenceMember.md b/docs/ConferenceMember.md index 3639f0f9..0a3395e2 100644 --- a/docs/ConferenceMember.md +++ b/docs/ConferenceMember.md @@ -9,9 +9,25 @@ Name | Type | Description | Notes **member_url** | **str** | A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint. | [optional] **mute** | **bool** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted. | [optional] **hold** | **bool** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted. | [optional] -**call_ids_to_coach** | **[str], none_type** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**call_ids_to_coach** | **List[str]** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] +## Example + +```python +from bandwidth.models.conference_member import ConferenceMember + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceMember from a JSON string +conference_member_instance = ConferenceMember.from_json(json) +# print the JSON string representation of the object +print ConferenceMember.to_json() + +# convert the object into a dict +conference_member_dict = conference_member_instance.to_dict() +# create an instance of ConferenceMember from a dict +conference_member_form_dict = conference_member.from_dict(conference_member_dict) +``` [[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/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md index 32dbed0d..db062db0 100644 --- a/docs/ConferenceMemberExitCallback.md +++ b/docs/ConferenceMemberExitCallback.md @@ -6,15 +6,31 @@ The Conference Member Exit event is fired whenever a caller exits a conference t Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceMemberExitCallback from a JSON string +conference_member_exit_callback_instance = ConferenceMemberExitCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceMemberExitCallback.to_json() + +# convert the object into a dict +conference_member_exit_callback_dict = conference_member_exit_callback_instance.to_dict() +# create an instance of ConferenceMemberExitCallback from a dict +conference_member_exit_callback_form_dict = conference_member_exit_callback.from_dict(conference_member_exit_callback_dict) +``` [[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/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md index eeaf3901..af6ca5d8 100644 --- a/docs/ConferenceMemberJoinCallback.md +++ b/docs/ConferenceMemberJoinCallback.md @@ -6,15 +6,31 @@ The Conference Member Join event is fired whenever a caller joins a conference t Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceMemberJoinCallback from a JSON string +conference_member_join_callback_instance = ConferenceMemberJoinCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceMemberJoinCallback.to_json() + +# convert the object into a dict +conference_member_join_callback_dict = conference_member_join_callback_instance.to_dict() +# create an instance of ConferenceMemberJoinCallback from a dict +conference_member_join_callback_form_dict = conference_member_join_callback.from_dict(conference_member_join_callback_dict) +``` [[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/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md index 5e9845df..7a7ca2b9 100644 --- a/docs/ConferenceRecordingAvailableCallback.md +++ b/docs/ConferenceRecordingAvailableCallback.md @@ -6,7 +6,7 @@ The Conference Recording Available event is sent after a conference recording ha Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] **account_id** | **str** | The user account associated with the call. | [optional] @@ -16,11 +16,27 @@ Name | Type | Description | Notes **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceRecordingAvailableCallback from a JSON string +conference_recording_available_callback_instance = ConferenceRecordingAvailableCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceRecordingAvailableCallback.to_json() + +# convert the object into a dict +conference_recording_available_callback_dict = conference_recording_available_callback_instance.to_dict() +# create an instance of ConferenceRecordingAvailableCallback from a dict +conference_recording_available_callback_form_dict = conference_recording_available_callback.from_dict(conference_recording_available_callback_dict) +``` [[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/ConferenceRecordingMetadata.md b/docs/ConferenceRecordingMetadata.md index 1ff3824b..8f068ecd 100644 --- a/docs/ConferenceRecordingMetadata.md +++ b/docs/ConferenceRecordingMetadata.md @@ -14,9 +14,25 @@ Name | Type | Description | Notes **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +## Example + +```python +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceRecordingMetadata from a JSON string +conference_recording_metadata_instance = ConferenceRecordingMetadata.from_json(json) +# print the JSON string representation of the object +print ConferenceRecordingMetadata.to_json() + +# convert the object into a dict +conference_recording_metadata_dict = conference_recording_metadata_instance.to_dict() +# create an instance of ConferenceRecordingMetadata from a dict +conference_recording_metadata_form_dict = conference_recording_metadata.from_dict(conference_recording_metadata_dict) +``` [[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/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md index 03e844c6..e1c34958 100644 --- a/docs/ConferenceRedirectCallback.md +++ b/docs/ConferenceRedirectCallback.md @@ -6,12 +6,28 @@ The Conference Redirect event is fired whenever an existing conference is modifi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of ConferenceRedirectCallback from a JSON string +conference_redirect_callback_instance = ConferenceRedirectCallback.from_json(json) +# print the JSON string representation of the object +print ConferenceRedirectCallback.to_json() + +# convert the object into a dict +conference_redirect_callback_dict = conference_redirect_callback_instance.to_dict() +# create an instance of ConferenceRedirectCallback from a dict +conference_redirect_callback_form_dict = conference_redirect_callback.from_dict(conference_redirect_callback_dict) +``` [[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/ConferenceStateEnum.md b/docs/ConferenceStateEnum.md index a90bb3b8..91a8ca0a 100644 --- a/docs/ConferenceStateEnum.md +++ b/docs/ConferenceStateEnum.md @@ -1,11 +1,10 @@ # ConferenceStateEnum -Setting the conference state to `completed` ends the conference and ejects all members +Setting the conference state to `completed` ends the conference and ejects all members. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | Setting the conference state to `completed` ends the conference and ejects all members | defaults to "active", must be one of ["active", "completed", ] [[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/ConferencesApi.md b/docs/ConferencesApi.md index 7a2c15e6..86879936 100644 --- a/docs/ConferencesApi.md +++ b/docs/ConferencesApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **download_conference_recording** -> file_type download_conference_recording(account_id, conference_id, recording_id) +> bytearray download_conference_recording(account_id, conference_id, recording_id) Download Conference Recording @@ -25,13 +25,13 @@ Downloads the specified recording file. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -45,39 +45,40 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Download Conference Recording api_response = api_instance.download_conference_recording(account_id, conference_id, recording_id) + print("The response of ConferencesApi->download_conference_recording:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->download_conference_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type -**file_type** +**bytearray** ### Authorization @@ -88,9 +89,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: audio/vnd.wave, audio/mpeg, application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Media found | - | @@ -100,7 +99,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -115,14 +114,14 @@ Returns information about the specified conference. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.conference import Conference -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.conference import Conference +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -136,33 +135,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. - # example passing only required values which don't have defaults set try: # Get Conference Information api_response = api_instance.get_conference(account_id, conference_id) + print("The response of ConferencesApi->get_conference:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->get_conference: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | ### Return type @@ -177,9 +177,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Conferences retrieved successfully | - | @@ -189,7 +187,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -204,14 +202,14 @@ Returns information about the specified conference member. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.conference_member import ConferenceMember -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.conference_member import ConferenceMember +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -225,35 +223,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - member_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Conference Member ID + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Conference Member ID. - # example passing only required values which don't have defaults set try: # Get Conference Member api_response = api_instance.get_conference_member(account_id, conference_id, member_id) + print("The response of ConferencesApi->get_conference_member:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->get_conference_member: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **member_id** | **str**| Programmable Voice API Conference Member ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **member_id** | **str**| Programmable Voice API Conference Member ID. | ### Return type @@ -268,9 +267,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Conference member found | - | @@ -280,7 +277,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -295,14 +292,14 @@ Returns metadata for the specified recording. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -316,35 +313,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Get Conference Recording Information api_response = api_instance.get_conference_recording(account_id, conference_id, recording_id) + print("The response of ConferencesApi->get_conference_recording:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->get_conference_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -359,9 +357,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Conference recording found | - | @@ -371,13 +367,13 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) # **list_conference_recordings** -> [ConferenceRecordingMetadata] list_conference_recordings(account_id, conference_id) +> List[ConferenceRecordingMetadata] list_conference_recordings(account_id, conference_id) Get Conference Recordings @@ -386,14 +382,14 @@ Returns a (potentially empty) list of metadata for the recordings that took plac ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -407,37 +403,38 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. - # example passing only required values which don't have defaults set try: # Get Conference Recordings api_response = api_instance.list_conference_recordings(account_id, conference_id) + print("The response of ConferencesApi->list_conference_recordings:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->list_conference_recordings: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | ### Return type -[**[ConferenceRecordingMetadata]**](ConferenceRecordingMetadata.md) +[**List[ConferenceRecordingMetadata]**](ConferenceRecordingMetadata.md) ### Authorization @@ -448,9 +445,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Conference recordings retrieved successfully | - | @@ -460,13 +455,13 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) # **list_conferences** -> [Conference] list_conferences(account_id) +> List[Conference] list_conferences(account_id, name=name, min_created_time=min_created_time, max_created_time=max_created_time, page_size=page_size, page_token=page_token) Get Conferences @@ -475,14 +470,14 @@ Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.conference import Conference -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.conference import Conference +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -496,54 +491,46 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - name = "my-custom-name" # str | Filter results by the `name` field. (optional) - min_created_time = "2022-06-21T19:13:21Z" # str | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). (optional) - max_created_time = "2022-06-21T19:13:21Z" # str | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). (optional) - page_size = 500 # int | Specifies the max number of conferences that will be returned. (optional) if omitted the server will use the default value of 1000 - page_token = "pageToken_example" # str | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional) - - # example passing only required values which don't have defaults set - try: - # Get Conferences - api_response = api_instance.list_conferences(account_id) - pprint(api_response) - except bandwidth.ApiException as e: - print("Exception when calling ConferencesApi->list_conferences: %s\n" % e) + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + name = 'my-custom-name' # str | Filter results by the `name` field. (optional) + min_created_time = '2022-06-21T19:13:21Z' # str | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). (optional) + max_created_time = '2022-06-21T19:13:21Z' # str | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). (optional) + page_size = 1000 # int | Specifies the max number of conferences that will be returned. (optional) (default to 1000) + page_token = 'page_token_example' # str | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get Conferences api_response = api_instance.list_conferences(account_id, name=name, min_created_time=min_created_time, max_created_time=max_created_time, page_size=page_size, page_token=page_token) + print("The response of ConferencesApi->list_conferences:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->list_conferences: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **name** | **str**| Filter results by the `name` field. | [optional] - **min_created_time** | **str**| Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional] - **max_created_time** | **str**| Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional] - **page_size** | **int**| Specifies the max number of conferences that will be returned. | [optional] if omitted the server will use the default value of 1000 - **page_token** | **str**| Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. | [optional] + **account_id** | **str**| Your Bandwidth Account ID. | + **name** | **str**| Filter results by the `name` field. | [optional] + **min_created_time** | **str**| Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional] + **max_created_time** | **str**| Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional] + **page_size** | **int**| Specifies the max number of conferences that will be returned. | [optional] [default to 1000] + **page_token** | **str**| Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. | [optional] ### Return type -[**[Conference]**](Conference.md) +[**List[Conference]**](Conference.md) ### Authorization @@ -554,9 +541,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Conferences retrieved successfully | - | @@ -566,7 +551,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -581,14 +566,14 @@ Update the conference state. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.update_conference import UpdateConference -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.update_conference import UpdateConference +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -602,44 +587,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - update_conference = UpdateConference( - status=ConferenceStateEnum("active"), - redirect_url="https://myServer.com/bandwidth/webhooks/conferenceRedirect", - redirect_method=RedirectMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - redirect_fallback_url="https://myFallbackServer.com/bandwidth/webhooks/conferenceRedirect", - redirect_fallback_method=RedirectMethodEnum("POST"), - fallback_username="mySecretUsername", - fallback_password="mySecretPassword1!", - ) # UpdateConference | - - # example passing only required values which don't have defaults set + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + update_conference = bandwidth.UpdateConference() # UpdateConference | + try: # Update Conference api_instance.update_conference(account_id, conference_id, update_conference) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->update_conference: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **update_conference** | [**UpdateConference**](UpdateConference.md)| | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **update_conference** | [**UpdateConference**](UpdateConference.md)| | ### Return type @@ -654,19 +629,17 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Conference successfully modified | - | +**204** | Conference was successfully modified. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -681,13 +654,13 @@ Update the conference BXML document. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -701,37 +674,37 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - body = ''' + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + body = -''' # str | + # str | - # example passing only required values which don't have defaults set try: # Update Conference BXML api_instance.update_conference_bxml(account_id, conference_id, body) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->update_conference_bxml: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **body** | **str**| | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **body** | **str**| | ### Return type @@ -746,19 +719,17 @@ void (empty response body) - **Content-Type**: application/xml - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Conference successfully modified | - | +**204** | Conference successfully modified. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -773,14 +744,14 @@ Updates settings for a particular conference member. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import conferences_api -from bandwidth.model.update_conference_member import UpdateConferenceMember -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.update_conference_member import UpdateConferenceMember +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -794,40 +765,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = conferences_api.ConferencesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - conference_id = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9" # str | Programmable Voice API Conference ID - member_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Conference Member ID - update_conference_member = UpdateConferenceMember( - mute=False, - hold=False, - call_ids_to_coach=["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], - ) # UpdateConferenceMember | - - # example passing only required values which don't have defaults set + api_instance = bandwidth.ConferencesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID. + member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Conference Member ID. + update_conference_member = bandwidth.UpdateConferenceMember() # UpdateConferenceMember | + try: # Update Conference Member api_instance.update_conference_member(account_id, conference_id, member_id, update_conference_member) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling ConferencesApi->update_conference_member: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **conference_id** | **str**| Programmable Voice API Conference ID | - **member_id** | **str**| Programmable Voice API Conference Member ID | - **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md)| | + **account_id** | **str**| Your Bandwidth Account ID. | + **conference_id** | **str**| Programmable Voice API Conference ID. | + **member_id** | **str**| Programmable Voice API Conference Member ID. | + **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md)| | ### Return type @@ -842,19 +809,17 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Conference member successfully modified | - | +**204** | Conference member was successfully modified. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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/CreateCall.md b/docs/CreateCall.md index fe65676a..e5ba0658 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -4,27 +4,44 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.com`)). | -**_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). | +**to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | +**var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). | +**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. | [optional] +**uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] **application_id** | **str** | The id of the application associated with the `from` number. | -**answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password` | -**uui** | **str, none_type** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] +**answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**username** | **str, none_type** | Basic auth username. | [optional] -**password** | **str, none_type** | Basic auth password. | [optional] -**answer_fallback_url** | **str, none_type** | A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword` | [optional] +**username** | **str** | Basic auth username. | [optional] +**password** | **str** | Basic auth password. | [optional] +**answer_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. | [optional] **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**fallback_username** | **str, none_type** | Basic auth username. | [optional] -**fallback_password** | **str, none_type** | Basic auth password. | [optional] -**disconnect_url** | **str, none_type** | The URL to send the <a href='/docs/voice/webhooks/disconnect'>Disconnect</a> event to when the call ends. This event does not expect a BXML response. | [optional] +**fallback_username** | **str** | Basic auth username. | [optional] +**fallback_password** | **str** | Basic auth password. | [optional] +**disconnect_url** | **str** | The URL to send the <a href='/docs/voice/webhooks/disconnect'>Disconnect</a> event to when the call ends. This event does not expect a BXML response. | [optional] **disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**call_timeout** | **float, none_type** | The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300. | [optional] if omitted the server will use the default value of 30 -**callback_timeout** | **float, none_type** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional] if omitted the server will use the default value of 15 +**call_timeout** | **float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300. | [optional] [default to 30] +**callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional] [default to 15] **machine_detection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] -**priority** | **int, none_type** | The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. | [optional] if omitted the server will use the default value of 5 -**tag** | **str, none_type** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**priority** | **int** | The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. | [optional] [default to 5] +**tag** | **str** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] +## Example + +```python +from bandwidth.models.create_call import CreateCall + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCall from a JSON string +create_call_instance = CreateCall.from_json(json) +# print the JSON string representation of the object +print CreateCall.to_json() + +# convert the object into a dict +create_call_dict = create_call_instance.to_dict() +# create an instance of CreateCall from a dict +create_call_form_dict = create_call.from_dict(create_call_dict) +``` [[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/CreateCallResponse.md b/docs/CreateCallResponse.md index ab0103e1..f40cad98 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -5,28 +5,44 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The id of the application associated with the `from` number. | -**account_id** | **str** | The bandwidth account ID associated with the call | -**call_id** | **str** | Programmable Voice API Call ID | -**to** | **str** | Recipient of the outgoing call | -**_from** | **str** | Phone number that created the outbound call | -**call_url** | **str** | The URL to update call state | -**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | -**answer_url** | **str** | URL to deliver the `answer` event webhook. | -**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | -**enqueued_time** | **datetime, none_type** | Time the call was accepted into the queue | [optional] +**account_id** | **str** | The bandwidth account ID associated with the call. | +**call_id** | **str** | Programmable Voice API Call ID. | +**to** | **str** | Recipient of the outgoing call. | +**var_from** | **str** | Phone number that created the outbound call. | +**enqueued_time** | **datetime** | The time at which the call was accepted into the queue. | [optional] +**call_url** | **str** | The URL to update this call's state. | **call_timeout** | **float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. | [optional] **callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering webhooks for the call. | [optional] -**tag** | **str, none_type** | Custom tag value | [optional] +**tag** | **str** | Custom tag value. | [optional] +**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | +**answer_url** | **str** | URL to deliver the `answer` event webhook. | **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**answer_fallback_url** | **str, none_type** | Fallback URL to deliver the `answer` event webhook. | [optional] -**disconnect_url** | **str, none_type** | URL to deliver the `disconnect` event webhook. | [optional] -**username** | **str, none_type** | Basic auth username. | [optional] -**password** | **str, none_type** | Basic auth password. | [optional] -**fallback_username** | **str, none_type** | Basic auth username. | [optional] -**fallback_password** | **str, none_type** | Basic auth password. | [optional] -**priority** | **float, none_type** | The priority of this call over other calls from your account. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**answer_fallback_url** | **str** | Fallback URL to deliver the `answer` event webhook. | [optional] +**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | +**disconnect_url** | **str** | URL to deliver the `disconnect` event webhook. | [optional] +**username** | **str** | Basic auth username. | [optional] +**password** | **str** | Basic auth password. | [optional] +**fallback_username** | **str** | Basic auth username. | [optional] +**fallback_password** | **str** | Basic auth password. | [optional] +**priority** | **int** | The priority of this call over other calls from your account. | [optional] + +## Example + +```python +from bandwidth.models.create_call_response import CreateCallResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCallResponse from a JSON string +create_call_response_instance = CreateCallResponse.from_json(json) +# print the JSON string representation of the object +print CreateCallResponse.to_json() +# convert the object into a dict +create_call_response_dict = create_call_response_instance.to_dict() +# create an instance of CreateCallResponse from a dict +create_call_response_form_dict = create_call_response.from_dict(create_call_response_dict) +``` [[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/CreateLookupResponse.md b/docs/CreateLookupResponse.md index a5c133c0..98b97e9b 100644 --- a/docs/CreateLookupResponse.md +++ b/docs/CreateLookupResponse.md @@ -7,8 +7,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **request_id** | **str** | The phone number lookup request ID from Bandwidth. | [optional] **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.create_lookup_response import CreateLookupResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLookupResponse from a JSON string +create_lookup_response_instance = CreateLookupResponse.from_json(json) +# print the JSON string representation of the object +print CreateLookupResponse.to_json() + +# convert the object into a dict +create_lookup_response_dict = create_lookup_response_instance.to_dict() +# create an instance of CreateLookupResponse from a dict +create_lookup_response_form_dict = create_lookup_response.from_dict(create_lookup_response_dict) +``` [[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/CreateMessageRequestError.md b/docs/CreateMessageRequestError.md index 2443ef7a..d079b313 100644 --- a/docs/CreateMessageRequestError.md +++ b/docs/CreateMessageRequestError.md @@ -6,9 +6,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | **description** | **str** | | -**field_errors** | [**[FieldError]**](FieldError.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**field_errors** | [**List[FieldError]**](FieldError.md) | | [optional] +## Example + +```python +from bandwidth.models.create_message_request_error import CreateMessageRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateMessageRequestError from a JSON string +create_message_request_error_instance = CreateMessageRequestError.from_json(json) +# print the JSON string representation of the object +print CreateMessageRequestError.to_json() + +# convert the object into a dict +create_message_request_error_dict = create_message_request_error_instance.to_dict() +# create an instance of CreateMessageRequestError from a dict +create_message_request_error_form_dict = create_message_request_error.from_dict(create_message_request_error_dict) +``` [[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/DeferredResult.md b/docs/DeferredResult.md index b9794813..228ed4a2 100644 --- a/docs/DeferredResult.md +++ b/docs/DeferredResult.md @@ -4,10 +4,26 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**result** | **object** | | [optional] **set_or_expired** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.deferred_result import DeferredResult + +# TODO update the JSON string below +json = "{}" +# create an instance of DeferredResult from a JSON string +deferred_result_instance = DeferredResult.from_json(json) +# print the JSON string representation of the object +print DeferredResult.to_json() + +# convert the object into a dict +deferred_result_dict = deferred_result_instance.to_dict() +# create an instance of DeferredResult from a dict +deferred_result_form_dict = deferred_result.from_dict(deferred_result_dict) +``` [[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/DisconenctCallback.md b/docs/DisconnectCallback.md similarity index 51% rename from docs/DisconenctCallback.md rename to docs/DisconnectCallback.md index 6b07f1b0..d7fb29b5 100644 --- a/docs/DisconenctCallback.md +++ b/docs/DisconnectCallback.md @@ -1,4 +1,4 @@ -# DisconenctCallback +# DisconnectCallback The Disconnect event is fired when a call ends, for any reason. @@ -6,24 +6,40 @@ The Disconnect event is fired when a call ends, for any reason. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] -**error_message** | **str, none_type** | Text explaining the reason that caused the call to fail in case of errors. | [optional] -**error_id** | **str, none_type** | Bandwidth's internal id that references the error event. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] +**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.disconnect_callback import DisconnectCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of DisconnectCallback from a JSON string +disconnect_callback_instance = DisconnectCallback.from_json(json) +# print the JSON string representation of the object +print DisconnectCallback.to_json() + +# convert the object into a dict +disconnect_callback_dict = disconnect_callback_instance.to_dict() +# create an instance of DisconnectCallback from a dict +disconnect_callback_form_dict = disconnect_callback.from_dict(disconnect_callback_dict) +``` [[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/Diversion.md b/docs/Diversion.md index 5ee17864..210f52b0 100644 --- a/docs/Diversion.md +++ b/docs/Diversion.md @@ -11,8 +11,24 @@ Name | Type | Description | Notes **limit** | **str** | The maximum number of diversions allowed for this session | [optional] **unknown** | **str** | The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys. | [optional] **orig_to** | **str** | Always present. Indicates the last telephone number that the call was diverted from. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.diversion import Diversion + +# TODO update the JSON string below +json = "{}" +# create an instance of Diversion from a JSON string +diversion_instance = Diversion.from_json(json) +# print the JSON string representation of the object +print Diversion.to_json() + +# convert the object into a dict +diversion_dict = diversion_instance.to_dict() +# create an instance of Diversion from a dict +diversion_form_dict = diversion.from_dict(diversion_dict) +``` [[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/DtmfCallback.md b/docs/DtmfCallback.md index e710e23d..f07d87aa 100644 --- a/docs/DtmfCallback.md +++ b/docs/DtmfCallback.md @@ -6,24 +6,40 @@ The DTMF event is sent for every digit detected after a verb is ex Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **digit** | **str** | The digit collected in the call. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.dtmf_callback import DtmfCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of DtmfCallback from a JSON string +dtmf_callback_instance = DtmfCallback.from_json(json) +# print the JSON string representation of the object +print DtmfCallback.to_json() + +# convert the object into a dict +dtmf_callback_dict = dtmf_callback_instance.to_dict() +# create an instance of DtmfCallback from a dict +dtmf_callback_form_dict = dtmf_callback.from_dict(dtmf_callback_dict) +``` [[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/FieldError.md b/docs/FieldError.md index bce57629..95d6ad78 100644 --- a/docs/FieldError.md +++ b/docs/FieldError.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field_name** | **str** | The name of the field that contains the error | [optional] **description** | **str** | The error associated with the field | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.field_error import FieldError + +# TODO update the JSON string below +json = "{}" +# create an instance of FieldError from a JSON string +field_error_instance = FieldError.from_json(json) +# print the JSON string representation of the object +print FieldError.to_json() + +# convert the object into a dict +field_error_dict = field_error_instance.to_dict() +# create an instance of FieldError from a dict +field_error_form_dict = field_error.from_dict(field_error_dict) +``` [[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/FileFormatEnum.md b/docs/FileFormatEnum.md index 0f7e92a7..149b4ac0 100644 --- a/docs/FileFormatEnum.md +++ b/docs/FileFormatEnum.md @@ -1,11 +1,10 @@ # FileFormatEnum -The format that the recording is stored in +The format that the recording is stored in. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The format that the recording is stored in | must be one of ["mp3", "wav", ] [[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/GatherCallback.md b/docs/GatherCallback.md index c285dac7..72bb5747 100644 --- a/docs/GatherCallback.md +++ b/docs/GatherCallback.md @@ -6,25 +6,41 @@ The gather event is sent after a verb is executed. Its purpose is to re Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **digits** | **str** | (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **terminating_digit** | **str** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +## Example + +```python +from bandwidth.models.gather_callback import GatherCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of GatherCallback from a JSON string +gather_callback_instance = GatherCallback.from_json(json) +# print the JSON string representation of the object +print GatherCallback.to_json() + +# convert the object into a dict +gather_callback_dict = gather_callback_instance.to_dict() +# create an instance of GatherCallback from a dict +gather_callback_form_dict = gather_callback.from_dict(gather_callback_dict) +``` [[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/InboundMessageCallback.md b/docs/InboundMessageCallback.md new file mode 100644 index 00000000..68d66d67 --- /dev/null +++ b/docs/InboundMessageCallback.md @@ -0,0 +1,33 @@ +# InboundMessageCallback + +Inbound Message Callback + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | **str** | | +**to** | **str** | | +**description** | **str** | | +**message** | [**InboundMessageCallbackMessage**](InboundMessageCallbackMessage.md) | | + +## Example + +```python +from bandwidth.models.inbound_message_callback import InboundMessageCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of InboundMessageCallback from a JSON string +inbound_message_callback_instance = InboundMessageCallback.from_json(json) +# print the JSON string representation of the object +print InboundMessageCallback.to_json() + +# convert the object into a dict +inbound_message_callback_dict = inbound_message_callback_instance.to_dict() +# create an instance of InboundMessageCallback from a dict +inbound_message_callback_form_dict = inbound_message_callback.from_dict(inbound_message_callback_dict) +``` +[[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/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md new file mode 100644 index 00000000..33230fe3 --- /dev/null +++ b/docs/InboundMessageCallbackMessage.md @@ -0,0 +1,40 @@ +# InboundMessageCallbackMessage + +Inbound Message Callback Message Schema + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**owner** | **str** | | +**application_id** | **str** | | +**time** | **datetime** | | +**segment_count** | **int** | | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | | +**var_from** | **str** | | +**text** | **str** | | +**tag** | **str** | | [optional] +**media** | **List[str]** | | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] + +## Example + +```python +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of InboundMessageCallbackMessage from a JSON string +inbound_message_callback_message_instance = InboundMessageCallbackMessage.from_json(json) +# print the JSON string representation of the object +print InboundMessageCallbackMessage.to_json() + +# convert the object into a dict +inbound_message_callback_message_dict = inbound_message_callback_message_instance.to_dict() +# create an instance of InboundMessageCallbackMessage from a dict +inbound_message_callback_message_form_dict = inbound_message_callback_message.from_dict(inbound_message_callback_message_dict) +``` +[[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/InitiateCallback.md b/docs/InitiateCallback.md index 03c7fee7..2f7b5860 100644 --- a/docs/InitiateCallback.md +++ b/docs/InitiateCallback.md @@ -6,10 +6,10 @@ The Initiate event is fired when an inbound call is received for a Telephone Num Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -17,8 +17,24 @@ Name | Type | Description | Notes **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **diversion** | [**Diversion**](Diversion.md) | | [optional] **stir_shaken** | [**StirShaken**](StirShaken.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.initiate_callback import InitiateCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of InitiateCallback from a JSON string +initiate_callback_instance = InitiateCallback.from_json(json) +# print the JSON string representation of the object +print InitiateCallback.to_json() + +# convert the object into a dict +initiate_callback_dict = initiate_callback_instance.to_dict() +# create an instance of InitiateCallback from a dict +initiate_callback_form_dict = initiate_callback.from_dict(initiate_callback_dict) +``` [[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/ListMessageDirectionEnum.md b/docs/ListMessageDirectionEnum.md index 08c8bcca..c39a3328 100644 --- a/docs/ListMessageDirectionEnum.md +++ b/docs/ListMessageDirectionEnum.md @@ -5,7 +5,6 @@ The direction of the message. One of INBOUND OUTBOUND. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The direction of the message. One of INBOUND OUTBOUND. | must be one of ["INBOUND", "OUTBOUND", ] [[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/ListMessageItem.md b/docs/ListMessageItem.md index c82174d2..ffd5a30c 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -13,15 +13,32 @@ Name | Type | Description | Notes **message_type** | [**MessageTypeEnum**](MessageTypeEnum.md) | | [optional] **segment_count** | **int** | The number of segments the message was sent as. | [optional] **error_code** | **int** | The numeric error code of the message. | [optional] -**receive_time** | **str** | The ISO 8601 datetime of the message. | [optional] -**carrier_name** | **str, none_type** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] -**message_size** | **int, none_type** | The size of the message including message content and headers. | [optional] +**receive_time** | **datetime** | The ISO 8601 datetime of the message. | [optional] +**carrier_name** | **str** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] +**message_size** | **int** | The size of the message including message content and headers. | [optional] **message_length** | **int** | The length of the message content. | [optional] -**attachment_count** | **int, none_type** | The number of attachments the message has. | [optional] -**recipient_count** | **int, none_type** | The number of recipients the message has. | [optional] -**campaign_class** | **str, none_type** | The campaign class of the message if it has one. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**attachment_count** | **int** | The number of attachments the message has. | [optional] +**recipient_count** | **int** | The number of recipients the message has. | [optional] +**campaign_class** | **str** | The campaign class of the message if it has one. | [optional] +**campaign_id** | **str** | The campaign ID of the message if it has one. | [optional] +## Example + +```python +from bandwidth.models.list_message_item import ListMessageItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ListMessageItem from a JSON string +list_message_item_instance = ListMessageItem.from_json(json) +# print the JSON string representation of the object +print ListMessageItem.to_json() + +# convert the object into a dict +list_message_item_dict = list_message_item_instance.to_dict() +# create an instance of ListMessageItem from a dict +list_message_item_form_dict = list_message_item.from_dict(list_message_item_dict) +``` [[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/LookupRequest.md b/docs/LookupRequest.md index 077cab9c..78c3debf 100644 --- a/docs/LookupRequest.md +++ b/docs/LookupRequest.md @@ -5,9 +5,25 @@ Create phone number lookup request. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tns** | **[str]** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tns** | **List[str]** | | +## Example + +```python +from bandwidth.models.lookup_request import LookupRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LookupRequest from a JSON string +lookup_request_instance = LookupRequest.from_json(json) +# print the JSON string representation of the object +print LookupRequest.to_json() + +# convert the object into a dict +lookup_request_dict = lookup_request_instance.to_dict() +# create an instance of LookupRequest from a dict +lookup_request_form_dict = lookup_request.from_dict(lookup_request_dict) +``` [[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/LookupResult.md b/docs/LookupResult.md index 61b2d0dc..6b0900d6 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -14,8 +14,24 @@ Name | Type | Description | Notes **line_provider** | **str** | The messaging service provider of the telephone number. | [optional] **mobile_country_code** | **str** | The first half of the Home Network Identity (HNI). | [optional] **mobile_network_code** | **str** | The second half of the HNI. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.lookup_result import LookupResult + +# TODO update the JSON string below +json = "{}" +# create an instance of LookupResult from a JSON string +lookup_result_instance = LookupResult.from_json(json) +# print the JSON string representation of the object +print LookupResult.to_json() + +# convert the object into a dict +lookup_result_dict = lookup_result_instance.to_dict() +# create an instance of LookupResult from a dict +lookup_result_form_dict = lookup_result.from_dict(lookup_result_dict) +``` [[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/LookupStatus.md b/docs/LookupStatus.md index 466b9fd5..fd445292 100644 --- a/docs/LookupStatus.md +++ b/docs/LookupStatus.md @@ -7,10 +7,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **request_id** | **str** | The requestId. | [optional] **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] -**result** | [**[LookupResult]**](LookupResult.md) | The carrier information results for the specified telephone number. | [optional] -**failed_telephone_numbers** | **[str]** | The telephone numbers whose lookup failed. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**result** | [**List[LookupResult]**](LookupResult.md) | The carrier information results for the specified telephone number. | [optional] +**failed_telephone_numbers** | **List[str]** | The telephone numbers whose lookup failed. | [optional] +## Example + +```python +from bandwidth.models.lookup_status import LookupStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of LookupStatus from a JSON string +lookup_status_instance = LookupStatus.from_json(json) +# print the JSON string representation of the object +print LookupStatus.to_json() + +# convert the object into a dict +lookup_status_dict = lookup_status_instance.to_dict() +# create an instance of LookupStatus from a dict +lookup_status_form_dict = lookup_status.from_dict(lookup_status_dict) +``` [[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/LookupStatusEnum.md b/docs/LookupStatusEnum.md index 3db95cb0..d5486493 100644 --- a/docs/LookupStatusEnum.md +++ b/docs/LookupStatusEnum.md @@ -5,7 +5,6 @@ The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED). ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED). | must be one of ["IN_PROGRESS", "COMPLETE", "PARTIAL_COMPLETE", "FAILED", ] [[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/LookupStatusResultInner.md b/docs/LookupStatusResultInner.md deleted file mode 100644 index a4630788..00000000 --- a/docs/LookupStatusResultInner.md +++ /dev/null @@ -1,20 +0,0 @@ -# LookupStatusResultInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**response_code** | **int** | Our vendor's response code. | [optional] -**message** | **str** | Message associated with the response code. | [optional] -**e_164_format** | **str** | The telephone number in E.164 format. | [optional] -**formatted** | **str** | The formatted version of the telephone number. | [optional] -**country** | **str** | The country of the telephone number. | [optional] -**line_type** | **str** | The line type of the telephone number. | [optional] -**line_provider** | **str** | The messaging service provider of the telephone number. | [optional] -**mobile_country_code** | **str** | The first half of the Home Network Identity (HNI). | [optional] -**mobile_network_code** | **str** | The second half of the HNI. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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/MFAApi.md b/docs/MFAApi.md index 7aae0fc5..ef3e2b7f 100644 --- a/docs/MFAApi.md +++ b/docs/MFAApi.md @@ -19,17 +19,15 @@ Send an MFA code via text message (SMS). ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import mfa_api -from bandwidth.model.code_request import CodeRequest -from bandwidth.model.messaging_code_response import MessagingCodeResponse -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError -from bandwidth.model.mfa_request_error import MfaRequestError -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -43,40 +41,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = mfa_api.MFAApi(api_client) - account_id = "accountId_example" # str | Bandwidth Account ID with Voice service enabled. - code_request = CodeRequest( - to="+19195551234", - _from="+19195554321", - application_id="66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1", - scope="2FA", - message="Your temporary {NAME} {SCOPE} code is {CODE}", - digits=6, - ) # CodeRequest | MFA code request body. - - # example passing only required values which don't have defaults set + api_instance = bandwidth.MFAApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + code_request = bandwidth.CodeRequest() # CodeRequest | MFA code request body. + try: # Messaging Authentication Code api_response = api_instance.generate_messaging_code(account_id, code_request) + print("The response of MFAApi->generate_messaging_code:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MFAApi->generate_messaging_code: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Bandwidth Account ID with Voice service enabled. | - **code_request** | [**CodeRequest**](CodeRequest.md)| MFA code request body. | + **account_id** | **str**| Your Bandwidth Account ID. | + **code_request** | [**CodeRequest**](CodeRequest.md)| MFA code request body. | ### Return type @@ -91,9 +83,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -114,17 +104,15 @@ Send an MFA Code via a phone call. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import mfa_api -from bandwidth.model.code_request import CodeRequest -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError -from bandwidth.model.voice_code_response import VoiceCodeResponse -from bandwidth.model.mfa_request_error import MfaRequestError -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.voice_code_response import VoiceCodeResponse +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -138,40 +126,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = mfa_api.MFAApi(api_client) - account_id = "accountId_example" # str | Bandwidth Account ID with Voice service enabled. - code_request = CodeRequest( - to="+19195551234", - _from="+19195554321", - application_id="66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1", - scope="2FA", - message="Your temporary {NAME} {SCOPE} code is {CODE}", - digits=6, - ) # CodeRequest | MFA code request body. - - # example passing only required values which don't have defaults set + api_instance = bandwidth.MFAApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + code_request = bandwidth.CodeRequest() # CodeRequest | MFA code request body. + try: # Voice Authentication Code api_response = api_instance.generate_voice_code(account_id, code_request) + print("The response of MFAApi->generate_voice_code:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MFAApi->generate_voice_code: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Bandwidth Account ID with Voice service enabled. | - **code_request** | [**CodeRequest**](CodeRequest.md)| MFA code request body. | + **account_id** | **str**| Your Bandwidth Account ID. | + **code_request** | [**CodeRequest**](CodeRequest.md)| MFA code request body. | ### Return type @@ -186,9 +168,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -209,17 +189,15 @@ Verify a previously sent MFA code. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import mfa_api -from bandwidth.model.verify_code_response import VerifyCodeResponse -from bandwidth.model.verify_code_request import VerifyCodeRequest -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError -from bandwidth.model.mfa_request_error import MfaRequestError -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -233,38 +211,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = mfa_api.MFAApi(api_client) - account_id = "accountId_example" # str | Bandwidth Account ID with Voice service enabled. - verify_code_request = VerifyCodeRequest( - to="+19195551234", - scope="2FA", - expiration_time_in_minutes=3, - code="123456", - ) # VerifyCodeRequest | MFA code verify request body. - - # example passing only required values which don't have defaults set + api_instance = bandwidth.MFAApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + verify_code_request = bandwidth.VerifyCodeRequest() # VerifyCodeRequest | MFA code verify request body. + try: # Verify Authentication Code api_response = api_instance.verify_code(account_id, verify_code_request) + print("The response of MFAApi->verify_code:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MFAApi->verify_code: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Bandwidth Account ID with Voice service enabled. | - **verify_code_request** | [**VerifyCodeRequest**](VerifyCodeRequest.md)| MFA code verify request body. | + **account_id** | **str**| Your Bandwidth Account ID. | + **verify_code_request** | [**VerifyCodeRequest**](VerifyCodeRequest.md)| MFA code verify request body. | ### Return type @@ -279,9 +253,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md index 5a3afef9..21838990 100644 --- a/docs/MachineDetectionCompleteCallback.md +++ b/docs/MachineDetectionCompleteCallback.md @@ -6,21 +6,37 @@ This event is sent to the url informed when requesting a machine detection opera Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**machine_detection_result** | **str, none_type** | (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] +## Example + +```python +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of MachineDetectionCompleteCallback from a JSON string +machine_detection_complete_callback_instance = MachineDetectionCompleteCallback.from_json(json) +# print the JSON string representation of the object +print MachineDetectionCompleteCallback.to_json() + +# convert the object into a dict +machine_detection_complete_callback_dict = machine_detection_complete_callback_instance.to_dict() +# create an instance of MachineDetectionCompleteCallback from a dict +machine_detection_complete_callback_form_dict = machine_detection_complete_callback.from_dict(machine_detection_complete_callback_dict) +``` [[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/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index 5d27ffba..ba9e4bd4 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -6,22 +6,38 @@ The machine detection request used to perform delete_media: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **media_id** | **str**| Media ID to retrieve. | + **account_id** | **str**| Your Bandwidth Account ID. | + **media_id** | **str**| Media ID to retrieve. | ### Return type @@ -80,9 +80,7 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No Content | - | @@ -90,6 +88,7 @@ void (empty response body) **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | **500** | Internal Server Error | - | @@ -97,7 +96,7 @@ void (empty response body) [[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) # **get_media** -> file_type get_media(account_id, media_id) +> bytearray get_media(account_id, media_id) Get Media @@ -106,13 +105,13 @@ Downloads a media file you previously uploaded. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import media_api -from bandwidth.model.messaging_request_error import MessagingRequestError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -126,37 +125,38 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = media_api.MediaApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID. - media_id = "14762070468292kw2fuqty55yp2b2/0/bw.png" # str | Media ID to retrieve. + api_instance = bandwidth.MediaApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve. - # example passing only required values which don't have defaults set try: # Get Media api_response = api_instance.get_media(account_id, media_id) + print("The response of MediaApi->get_media:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MediaApi->get_media: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **media_id** | **str**| Media ID to retrieve. | + **account_id** | **str**| Your Bandwidth Account ID. | + **media_id** | **str**| Media ID to retrieve. | ### Return type -**file_type** +**bytearray** ### Authorization @@ -167,9 +167,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/octet-stream, application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -177,6 +175,7 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | **500** | Internal Server Error | - | @@ -184,7 +183,7 @@ Name | Type | Description | Notes [[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) # **list_media** -> [Media] list_media(account_id) +> List[Media] list_media(account_id, continuation_token=continuation_token) List Media @@ -193,14 +192,14 @@ Gets a list of your media files. No query parameters are supported. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import media_api -from bandwidth.model.media import Media -from bandwidth.model.messaging_request_error import MessagingRequestError +from bandwidth.models.media import Media +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -214,46 +213,38 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = media_api.MediaApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID. - continuation_token = "1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39" # str | Continuation token used to retrieve subsequent media. (optional) - - # example passing only required values which don't have defaults set - try: - # List Media - api_response = api_instance.list_media(account_id) - pprint(api_response) - except bandwidth.ApiException as e: - print("Exception when calling MediaApi->list_media: %s\n" % e) + api_instance = bandwidth.MediaApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + continuation_token = '1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39' # str | Continuation token used to retrieve subsequent media. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List Media api_response = api_instance.list_media(account_id, continuation_token=continuation_token) + print("The response of MediaApi->list_media:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MediaApi->list_media: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **continuation_token** | **str**| Continuation token used to retrieve subsequent media. | [optional] + **account_id** | **str**| Your Bandwidth Account ID. | + **continuation_token** | **str**| Continuation token used to retrieve subsequent media. | [optional] ### Return type -[**[Media]**](Media.md) +[**List[Media]**](Media.md) ### Authorization @@ -264,9 +255,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | * Continuation-Token - Continuation token used to retrieve subsequent media.
| @@ -274,6 +263,7 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | **500** | Internal Server Error | - | @@ -281,22 +271,22 @@ Name | Type | Description | Notes [[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) # **upload_media** -> upload_media(account_id, media_id, body) +> upload_media(account_id, media_id, body, content_type=content_type, cache_control=cache_control) Upload Media -Upload a file. You may add headers to the request in order to provide some control to your media file. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). +Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import media_api -from bandwidth.model.messaging_request_error import MessagingRequestError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -310,46 +300,38 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = media_api.MediaApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID. - media_id = "14762070468292kw2fuqty55yp2b2/0/bw.png" # str | Media ID to retrieve. - body = open('/path/to/file', 'rb') # file_type | - content_type = "audio/wav" # str | The media type of the entity-body. (optional) - cache_control = "no-cache" # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) - - # example passing only required values which don't have defaults set - try: - # Upload Media - api_instance.upload_media(account_id, media_id, body) - except bandwidth.ApiException as e: - print("Exception when calling MediaApi->upload_media: %s\n" % e) + api_instance = bandwidth.MediaApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve. + body = None # bytearray | + content_type = 'audio/wav' # str | The media type of the entity-body. (optional) + cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Upload Media api_instance.upload_media(account_id, media_id, body, content_type=content_type, cache_control=cache_control) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MediaApi->upload_media: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **media_id** | **str**| Media ID to retrieve. | - **body** | **file_type**| | - **content_type** | **str**| The media type of the entity-body. | [optional] - **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] + **account_id** | **str**| Your Bandwidth Account ID. | + **media_id** | **str**| Media ID to retrieve. | + **body** | **bytearray**| | + **content_type** | **str**| The media type of the entity-body. | [optional] + **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] ### Return type @@ -364,9 +346,7 @@ void (empty response body) - **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **204** | No Content | - | @@ -374,6 +354,7 @@ void (empty response body) **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | **500** | Internal Server Error | - | diff --git a/docs/Message.md b/docs/Message.md index 2ec7b78e..87ad84b1 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -7,17 +7,34 @@ Name | Type | Description | Notes **id** | **str** | The id of the message. | [optional] **owner** | **str** | The Bandwidth phone number associated with the message. | [optional] **application_id** | **str** | The application ID associated with the message. | [optional] -**time** | **str** | The datetime stamp of the message in ISO 8601 | [optional] +**time** | **datetime** | The datetime stamp of the message in ISO 8601 | [optional] **segment_count** | **int** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] -**to** | **[str]** | The phone number recipients of the message. | [optional] -**_from** | **str** | The phone number the message was sent from. | [optional] -**media** | **[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] +**to** | **List[str]** | The phone number recipients of the message. | [optional] +**var_from** | **str** | The phone number the message was sent from. | [optional] +**media** | **List[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] **text** | **str** | The contents of the message. | [optional] **tag** | **str** | The custom string set by the user. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**expiration** | **datetime** | The expiration date-time set by the user. | [optional] +## Example + +```python +from bandwidth.models.message import Message + +# TODO update the JSON string below +json = "{}" +# create an instance of Message from a JSON string +message_instance = Message.from_json(json) +# print the JSON string representation of the object +print Message.to_json() + +# convert the object into a dict +message_dict = message_instance.to_dict() +# create an instance of Message from a dict +message_form_dict = message.from_dict(message_dict) +``` [[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/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md new file mode 100644 index 00000000..61622f89 --- /dev/null +++ b/docs/MessageDeliveredCallback.md @@ -0,0 +1,33 @@ +# MessageDeliveredCallback + +Message Delivered Callback + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | **str** | | +**to** | **str** | | +**description** | **str** | | +**message** | [**MessageDeliveredCallbackMessage**](MessageDeliveredCallbackMessage.md) | | + +## Example + +```python +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageDeliveredCallback from a JSON string +message_delivered_callback_instance = MessageDeliveredCallback.from_json(json) +# print the JSON string representation of the object +print MessageDeliveredCallback.to_json() + +# convert the object into a dict +message_delivered_callback_dict = message_delivered_callback_instance.to_dict() +# create an instance of MessageDeliveredCallback from a dict +message_delivered_callback_form_dict = message_delivered_callback.from_dict(message_delivered_callback_dict) +``` +[[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/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md new file mode 100644 index 00000000..c2211a2a --- /dev/null +++ b/docs/MessageDeliveredCallbackMessage.md @@ -0,0 +1,40 @@ +# MessageDeliveredCallbackMessage + +Message Delivered Callback Message Schema + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**owner** | **str** | | +**application_id** | **str** | | +**time** | **datetime** | | +**segment_count** | **int** | | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | | +**var_from** | **str** | | +**text** | **str** | | +**tag** | **str** | | +**media** | **List[str]** | | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] + +## Example + +```python +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageDeliveredCallbackMessage from a JSON string +message_delivered_callback_message_instance = MessageDeliveredCallbackMessage.from_json(json) +# print the JSON string representation of the object +print MessageDeliveredCallbackMessage.to_json() + +# convert the object into a dict +message_delivered_callback_message_dict = message_delivered_callback_message_instance.to_dict() +# create an instance of MessageDeliveredCallbackMessage from a dict +message_delivered_callback_message_form_dict = message_delivered_callback_message.from_dict(message_delivered_callback_message_dict) +``` +[[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/MessageDirectionEnum.md b/docs/MessageDirectionEnum.md index 8d83d0d2..22d0d608 100644 --- a/docs/MessageDirectionEnum.md +++ b/docs/MessageDirectionEnum.md @@ -5,7 +5,6 @@ The direction of the message. One of in out. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The direction of the message. One of in out. | must be one of ["in", "out", ] [[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/MessageFailedCallback.md b/docs/MessageFailedCallback.md new file mode 100644 index 00000000..984acebe --- /dev/null +++ b/docs/MessageFailedCallback.md @@ -0,0 +1,34 @@ +# MessageFailedCallback + +Message Failed Callback + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | **str** | | +**to** | **str** | | +**description** | **str** | | +**message** | [**MessageFailedCallbackMessage**](MessageFailedCallbackMessage.md) | | +**error_code** | **int** | | + +## Example + +```python +from bandwidth.models.message_failed_callback import MessageFailedCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageFailedCallback from a JSON string +message_failed_callback_instance = MessageFailedCallback.from_json(json) +# print the JSON string representation of the object +print MessageFailedCallback.to_json() + +# convert the object into a dict +message_failed_callback_dict = message_failed_callback_instance.to_dict() +# create an instance of MessageFailedCallback from a dict +message_failed_callback_form_dict = message_failed_callback.from_dict(message_failed_callback_dict) +``` +[[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/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md new file mode 100644 index 00000000..7257e9c0 --- /dev/null +++ b/docs/MessageFailedCallbackMessage.md @@ -0,0 +1,40 @@ +# MessageFailedCallbackMessage + +Message Failed Callback Message Schema + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**owner** | **str** | | +**application_id** | **str** | | +**time** | **datetime** | | +**segment_count** | **int** | | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | | +**var_from** | **str** | | +**text** | **str** | | +**tag** | **str** | | +**media** | **List[str]** | | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | + +## Example + +```python +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageFailedCallbackMessage from a JSON string +message_failed_callback_message_instance = MessageFailedCallbackMessage.from_json(json) +# print the JSON string representation of the object +print MessageFailedCallbackMessage.to_json() + +# convert the object into a dict +message_failed_callback_message_dict = message_failed_callback_message_instance.to_dict() +# create an instance of MessageFailedCallbackMessage from a dict +message_failed_callback_message_form_dict = message_failed_callback_message.from_dict(message_failed_callback_message_dict) +``` +[[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/MessageRequest.md b/docs/MessageRequest.md index b0a6f567..f26039ff 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -5,15 +5,31 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | -**to** | **[str]** | The phone number(s) the message should be sent to in E164 format. | -**_from** | **str** | One of your telephone numbers the message should come from in E164 format. | +**to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. | +**var_from** | **str** | One of your telephone numbers the message should come from in E164 format. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] -**media** | **[str]** | A list of URLs to include as media attachments as part of the message. | [optional] +**media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**expiration** | **str** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] +## Example + +```python +from bandwidth.models.message_request import MessageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageRequest from a JSON string +message_request_instance = MessageRequest.from_json(json) +# print the JSON string representation of the object +print MessageRequest.to_json() + +# convert the object into a dict +message_request_dict = message_request_instance.to_dict() +# create an instance of MessageRequest from a dict +message_request_form_dict = message_request.from_dict(message_request_dict) +``` [[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/MessageSendingCallback.md b/docs/MessageSendingCallback.md new file mode 100644 index 00000000..8d0f2ae8 --- /dev/null +++ b/docs/MessageSendingCallback.md @@ -0,0 +1,33 @@ +# MessageSendingCallback + +Message Sending Callback + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | **str** | | +**to** | **str** | | +**description** | **str** | | +**message** | [**MessageSendingCallbackMessage**](MessageSendingCallbackMessage.md) | | + +## Example + +```python +from bandwidth.models.message_sending_callback import MessageSendingCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageSendingCallback from a JSON string +message_sending_callback_instance = MessageSendingCallback.from_json(json) +# print the JSON string representation of the object +print MessageSendingCallback.to_json() + +# convert the object into a dict +message_sending_callback_dict = message_sending_callback_instance.to_dict() +# create an instance of MessageSendingCallback from a dict +message_sending_callback_form_dict = message_sending_callback.from_dict(message_sending_callback_dict) +``` +[[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/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md new file mode 100644 index 00000000..238bbefe --- /dev/null +++ b/docs/MessageSendingCallbackMessage.md @@ -0,0 +1,40 @@ +# MessageSendingCallbackMessage + +Message Sending Callback Message Schema + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**owner** | **str** | | +**application_id** | **str** | | +**time** | **datetime** | | +**segment_count** | **int** | | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | | +**var_from** | **str** | | +**text** | **str** | | +**tag** | **str** | | [optional] +**media** | **List[str]** | | +**priority** | [**PriorityEnum**](PriorityEnum.md) | | + +## Example + +```python +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageSendingCallbackMessage from a JSON string +message_sending_callback_message_instance = MessageSendingCallbackMessage.from_json(json) +# print the JSON string representation of the object +print MessageSendingCallbackMessage.to_json() + +# convert the object into a dict +message_sending_callback_message_dict = message_sending_callback_message_instance.to_dict() +# create an instance of MessageSendingCallbackMessage from a dict +message_sending_callback_message_form_dict = message_sending_callback_message.from_dict(message_sending_callback_message_dict) +``` +[[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/MessageStatusEnum.md b/docs/MessageStatusEnum.md index dace2d25..9715623d 100644 --- a/docs/MessageStatusEnum.md +++ b/docs/MessageStatusEnum.md @@ -5,7 +5,6 @@ The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | must be one of ["RECEIVED", "QUEUED", "SENDING", "SENT", "FAILED", "DELIVERED", "ACCEPTED", "UNDELIVERED", ] [[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/MessageTypeEnum.md b/docs/MessageTypeEnum.md index 92126d72..908c564a 100644 --- a/docs/MessageTypeEnum.md +++ b/docs/MessageTypeEnum.md @@ -5,7 +5,6 @@ The type of message. Either SMS or MMS. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The type of message. Either SMS or MMS. | must be one of ["sms", "mms", ] [[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/MessagesApi.md b/docs/MessagesApi.md index c481c338..4a32bc57 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -18,16 +18,15 @@ Endpoint for sending text messages and picture messages using V2 messaging. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import messages_api -from bandwidth.model.messaging_request_error import MessagingRequestError -from bandwidth.model.create_message_request_error import CreateMessageRequestError -from bandwidth.model.message_request import MessageRequest -from bandwidth.model.message import Message +from bandwidth.models.message import Message +from bandwidth.models.message_request import MessageRequest +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -41,42 +40,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = messages_api.MessagesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID. - message_request = MessageRequest( - application_id="93de2206-9669-4e07-948d-329f4b722ee2", - to=["+15554443333","+15552223333"], - _from="+15551113333", - text="Hello world", - media=["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - tag="custom string", - priority=PriorityEnum("default"), - expiration="2021-02-01T11:29:18-05:00", - ) # MessageRequest | - - # example passing only required values which don't have defaults set + api_instance = bandwidth.MessagesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + message_request = bandwidth.MessageRequest() # MessageRequest | + try: # Create Message api_response = api_instance.create_message(account_id, message_request) + print("The response of MessagesApi->create_message:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MessagesApi->create_message: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **message_request** | [**MessageRequest**](MessageRequest.md)| | + **account_id** | **str**| Your Bandwidth Account ID. | + **message_request** | [**MessageRequest**](MessageRequest.md)| | ### Return type @@ -91,9 +82,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **202** | Accepted | - | @@ -101,6 +90,7 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | **500** | Internal Server Error | - | @@ -108,7 +98,7 @@ Name | Type | Description | Notes [[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) # **list_messages** -> MessagesList list_messages(account_id) +> MessagesList list_messages(account_id, message_id=message_id, source_tn=source_tn, destination_tn=destination_tn, message_status=message_status, message_direction=message_direction, carrier_name=carrier_name, message_type=message_type, error_code=error_code, from_date_time=from_date_time, to_date_time=to_date_time, campaign_id=campaign_id, sort=sort, page_token=page_token, limit=limit, limit_total_count=limit_total_count) List Messages @@ -117,17 +107,17 @@ Returns a list of messages based on query parameters. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import messages_api -from bandwidth.model.message_status_enum import MessageStatusEnum -from bandwidth.model.messaging_request_error import MessagingRequestError -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum -from bandwidth.model.messages_list import MessagesList -from bandwidth.model.message_type_enum import MessageTypeEnum +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.messages_list import MessagesList +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -141,66 +131,62 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = messages_api.MessagesApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID. - message_id = "9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6" # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) - source_tn = "%2B15554443333" # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - destination_tn = "%2B15554443333" # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - message_status = MessageStatusEnum("RECEIVED") # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) - message_direction = ListMessageDirectionEnum("INBOUND") # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. (optional) - carrier_name = "Verizon" # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) - message_type = MessageTypeEnum("sms") # MessageTypeEnum | The type of message. Either sms or mms. (optional) + api_instance = bandwidth.MessagesApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) + source_tn = '%2B15554443333' # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + destination_tn = '%2B15554443333' # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + message_status = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) + message_direction = bandwidth.ListMessageDirectionEnum() # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. (optional) + carrier_name = 'Verizon' # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) + message_type = bandwidth.MessageTypeEnum() # MessageTypeEnum | The type of message. Either sms or mms. (optional) error_code = 9902 # int | The error code of the message. (optional) - from_date_time = "2022-09-14T18:20:16.000Z" # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) - to_date_time = "2022-09-14T18:20:16.000Z" # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) - sort = "sourceTn:desc" # str | The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) - page_token = "gdEewhcJLQRB5" # str | A base64 encoded value used for pagination of results. (optional) + from_date_time = '2022-09-14T18:20:16.000Z' # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + to_date_time = '2022-09-14T18:20:16.000Z' # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + campaign_id = 'CJEUMDK' # str | The campaign ID of the message. (optional) + sort = 'sourceTn:desc' # str | The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) + page_token = 'gdEewhcJLQRB5' # str | A base64 encoded value used for pagination of results. (optional) limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) + limit_total_count = true # bool | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional) - # example passing only required values which don't have defaults set try: # List Messages - api_response = api_instance.list_messages(account_id) + api_response = api_instance.list_messages(account_id, message_id=message_id, source_tn=source_tn, destination_tn=destination_tn, message_status=message_status, message_direction=message_direction, carrier_name=carrier_name, message_type=message_type, error_code=error_code, from_date_time=from_date_time, to_date_time=to_date_time, campaign_id=campaign_id, sort=sort, page_token=page_token, limit=limit, limit_total_count=limit_total_count) + print("The response of MessagesApi->list_messages:\n") pprint(api_response) - except bandwidth.ApiException as e: - print("Exception when calling MessagesApi->list_messages: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # List Messages - api_response = api_instance.list_messages(account_id, message_id=message_id, source_tn=source_tn, destination_tn=destination_tn, message_status=message_status, message_direction=message_direction, carrier_name=carrier_name, message_type=message_type, error_code=error_code, from_date_time=from_date_time, to_date_time=to_date_time, sort=sort, page_token=page_token, limit=limit) - pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling MessagesApi->list_messages: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID. | - **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] - **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **message_status** | **MessageStatusEnum**| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] - **message_direction** | **ListMessageDirectionEnum**| The direction of the message. One of INBOUND OUTBOUND. | [optional] - **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] - **message_type** | **MessageTypeEnum**| The type of message. Either sms or mms. | [optional] - **error_code** | **int**| The error code of the message. | [optional] - **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] - **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] - **sort** | **str**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] - **page_token** | **str**| A base64 encoded value used for pagination of results. | [optional] - **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] + **account_id** | **str**| Your Bandwidth Account ID. | + **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] + **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **message_status** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] + **message_direction** | [**ListMessageDirectionEnum**](.md)| The direction of the message. One of INBOUND OUTBOUND. | [optional] + **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] + **message_type** | [**MessageTypeEnum**](.md)| The type of message. Either sms or mms. | [optional] + **error_code** | **int**| The error code of the message. | [optional] + **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **campaign_id** | **str**| The campaign ID of the message. | [optional] + **sort** | **str**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] + **page_token** | **str**| A base64 encoded value used for pagination of results. | [optional] + **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] + **limit_total_count** | **bool**| When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] ### Return type @@ -215,9 +201,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/MessagesList.md b/docs/MessagesList.md index 594d25ee..25fdcc3f 100644 --- a/docs/MessagesList.md +++ b/docs/MessagesList.md @@ -4,11 +4,27 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total_count** | **int** | Total number of messages matched by the search. | [optional] +**total_count** | **int** | The total number of messages matched by the search. When the request has limitTotalCount set to true this value is limited to 10,000. | [optional] **page_info** | [**PageInfo**](PageInfo.md) | | [optional] -**messages** | [**[ListMessageItem]**](ListMessageItem.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**messages** | [**List[ListMessageItem]**](ListMessageItem.md) | | [optional] +## Example + +```python +from bandwidth.models.messages_list import MessagesList + +# TODO update the JSON string below +json = "{}" +# create an instance of MessagesList from a JSON string +messages_list_instance = MessagesList.from_json(json) +# print the JSON string representation of the object +print MessagesList.to_json() + +# convert the object into a dict +messages_list_dict = messages_list_instance.to_dict() +# create an instance of MessagesList from a dict +messages_list_form_dict = messages_list.from_dict(messages_list_dict) +``` [[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/MessagingCodeResponse.md b/docs/MessagingCodeResponse.md index 103b4c50..52832cb4 100644 --- a/docs/MessagingCodeResponse.md +++ b/docs/MessagingCodeResponse.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message_id** | **str** | Messaging API Message ID. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.messaging_code_response import MessagingCodeResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of MessagingCodeResponse from a JSON string +messaging_code_response_instance = MessagingCodeResponse.from_json(json) +# print the JSON string representation of the object +print MessagingCodeResponse.to_json() + +# convert the object into a dict +messaging_code_response_dict = messaging_code_response_instance.to_dict() +# create an instance of MessagingCodeResponse from a dict +messaging_code_response_form_dict = messaging_code_response.from_dict(messaging_code_response_dict) +``` [[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/MessagingRequestError.md b/docs/MessagingRequestError.md index 5544a0bf..419cca76 100644 --- a/docs/MessagingRequestError.md +++ b/docs/MessagingRequestError.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | **description** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.messaging_request_error import MessagingRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of MessagingRequestError from a JSON string +messaging_request_error_instance = MessagingRequestError.from_json(json) +# print the JSON string representation of the object +print MessagingRequestError.to_json() + +# convert the object into a dict +messaging_request_error_dict = messaging_request_error_instance.to_dict() +# create an instance of MessagingRequestError from a dict +messaging_request_error_form_dict = messaging_request_error.from_dict(messaging_request_error_dict) +``` [[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/MfaForbiddenRequestError.md b/docs/MfaForbiddenRequestError.md index 047ee4be..8730b69f 100644 --- a/docs/MfaForbiddenRequestError.md +++ b/docs/MfaForbiddenRequestError.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | The message containing the reason behind the request being forbidden. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of MfaForbiddenRequestError from a JSON string +mfa_forbidden_request_error_instance = MfaForbiddenRequestError.from_json(json) +# print the JSON string representation of the object +print MfaForbiddenRequestError.to_json() + +# convert the object into a dict +mfa_forbidden_request_error_dict = mfa_forbidden_request_error_instance.to_dict() +# create an instance of MfaForbiddenRequestError from a dict +mfa_forbidden_request_error_form_dict = mfa_forbidden_request_error.from_dict(mfa_forbidden_request_error_dict) +``` [[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/MfaRequestError.md b/docs/MfaRequestError.md index 656e813c..da6060a3 100644 --- a/docs/MfaRequestError.md +++ b/docs/MfaRequestError.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **str** | A message describing the error with your request. | [optional] **request_id** | **str** | The associated requestId from AWS. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.mfa_request_error import MfaRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of MfaRequestError from a JSON string +mfa_request_error_instance = MfaRequestError.from_json(json) +# print the JSON string representation of the object +print MfaRequestError.to_json() + +# convert the object into a dict +mfa_request_error_dict = mfa_request_error_instance.to_dict() +# create an instance of MfaRequestError from a dict +mfa_request_error_form_dict = mfa_request_error.from_dict(mfa_request_error_dict) +``` [[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/MfaUnauthorizedRequestError.md b/docs/MfaUnauthorizedRequestError.md index 18eb6362..b4ca631b 100644 --- a/docs/MfaUnauthorizedRequestError.md +++ b/docs/MfaUnauthorizedRequestError.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Unauthorized | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of MfaUnauthorizedRequestError from a JSON string +mfa_unauthorized_request_error_instance = MfaUnauthorizedRequestError.from_json(json) +# print the JSON string representation of the object +print MfaUnauthorizedRequestError.to_json() + +# convert the object into a dict +mfa_unauthorized_request_error_dict = mfa_unauthorized_request_error_instance.to_dict() +# create an instance of MfaUnauthorizedRequestError from a dict +mfa_unauthorized_request_error_form_dict = mfa_unauthorized_request_error.from_dict(mfa_unauthorized_request_error_dict) +``` [[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/PageInfo.md b/docs/PageInfo.md index 54f93dcb..f7027dc3 100644 --- a/docs/PageInfo.md +++ b/docs/PageInfo.md @@ -8,8 +8,24 @@ Name | Type | Description | Notes **next_page** | **str** | The link to the next page for pagination. | [optional] **prev_page_token** | **str** | The isolated pagination token for the previous page. | [optional] **next_page_token** | **str** | The isolated pagination token for the next page. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.page_info import PageInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of PageInfo from a JSON string +page_info_instance = PageInfo.from_json(json) +# print the JSON string representation of the object +print PageInfo.to_json() + +# convert the object into a dict +page_info_dict = page_info_instance.to_dict() +# create an instance of PageInfo from a dict +page_info_form_dict = page_info.from_dict(page_info_dict) +``` [[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/PhoneNumberLookupApi.md b/docs/PhoneNumberLookupApi.md index 66144727..6bacc173 100644 --- a/docs/PhoneNumberLookupApi.md +++ b/docs/PhoneNumberLookupApi.md @@ -18,15 +18,15 @@ Create a Phone Number Lookup Request. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import phone_number_lookup_api -from bandwidth.model.create_lookup_response import CreateLookupResponse -from bandwidth.model.lookup_request import LookupRequest -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -40,37 +40,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = phone_number_lookup_api.PhoneNumberLookupApi(api_client) - account_id = "9900000" # str | The ID of the Bandwidth account that the user belongs to. - lookup_request = LookupRequest( - tns=[ - "tns_example", - ], - ) # LookupRequest | Phone number lookup request. - - # example passing only required values which don't have defaults set + api_instance = bandwidth.PhoneNumberLookupApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + lookup_request = bandwidth.LookupRequest() # LookupRequest | Phone number lookup request. + try: # Create Lookup api_response = api_instance.create_lookup(account_id, lookup_request) + print("The response of PhoneNumberLookupApi->create_lookup:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling PhoneNumberLookupApi->create_lookup: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| The ID of the Bandwidth account that the user belongs to. | - **lookup_request** | [**LookupRequest**](LookupRequest.md)| Phone number lookup request. | + **account_id** | **str**| Your Bandwidth Account ID. | + **lookup_request** | [**LookupRequest**](LookupRequest.md)| Phone number lookup request. | ### Return type @@ -85,9 +82,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **202** | Accepted | - | @@ -110,14 +105,14 @@ Get an existing Phone Number Lookup Request. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import phone_number_lookup_api -from bandwidth.model.lookup_status import LookupStatus -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -131,33 +126,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = phone_number_lookup_api.PhoneNumberLookupApi(api_client) - account_id = "9900000" # str | The ID of the Bandwidth account that the user belongs to. - request_id = "004223a0-8b17-41b1-bf81-20732adf5590" # str | The phone number lookup request ID from Bandwidth. + api_instance = bandwidth.PhoneNumberLookupApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + request_id = '004223a0-8b17-41b1-bf81-20732adf5590' # str | The phone number lookup request ID from Bandwidth. - # example passing only required values which don't have defaults set try: # Get Lookup Request Status api_response = api_instance.get_lookup_status(account_id, request_id) + print("The response of PhoneNumberLookupApi->get_lookup_status:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling PhoneNumberLookupApi->get_lookup_status: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| The ID of the Bandwidth account that the user belongs to. | - **request_id** | **str**| The phone number lookup request ID from Bandwidth. | + **account_id** | **str**| Your Bandwidth Account ID. | + **request_id** | **str**| The phone number lookup request ID from Bandwidth. | ### Return type @@ -172,9 +168,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/PriorityEnum.md b/docs/PriorityEnum.md index cd8fd803..2a560ccc 100644 --- a/docs/PriorityEnum.md +++ b/docs/PriorityEnum.md @@ -1,11 +1,10 @@ # PriorityEnum -The priority specified by the user. +The priority specified by the user. Not supported on MMS. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The priority specified by the user. | must be one of ["default", "high", ] [[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/PublishPermissionsEnum.md b/docs/PublishPermissionsEnum.md deleted file mode 100644 index 3d4761cd..00000000 --- a/docs/PublishPermissionsEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# PublishPermissionsEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["AUDIO", "VIDEO", ] - -[[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/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md index 201fc1f2..eeb59c57 100644 --- a/docs/RecordingAvailableCallback.md +++ b/docs/RecordingAvailableCallback.md @@ -6,29 +6,45 @@ The Recording Available event is sent after a recording has been processed. It i Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **recording_id** | **str** | The unique ID of this recording | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **channels** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.recording_available_callback import RecordingAvailableCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of RecordingAvailableCallback from a JSON string +recording_available_callback_instance = RecordingAvailableCallback.from_json(json) +# print the JSON string representation of the object +print RecordingAvailableCallback.to_json() + +# convert the object into a dict +recording_available_callback_dict = recording_available_callback_instance.to_dict() +# create an instance of RecordingAvailableCallback from a dict +recording_available_callback_form_dict = recording_available_callback.from_dict(recording_available_callback_dict) +``` [[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/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md index d1dfa74a..686fcef6 100644 --- a/docs/RecordingCompleteCallback.md +++ b/docs/RecordingCompleteCallback.md @@ -6,29 +6,45 @@ The Record Complete event is sent after a verb has executed if the call Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **recording_id** | **str** | The unique ID of this recording | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of RecordingCompleteCallback from a JSON string +recording_complete_callback_instance = RecordingCompleteCallback.from_json(json) +# print the JSON string representation of the object +print RecordingCompleteCallback.to_json() + +# convert the object into a dict +recording_complete_callback_dict = recording_complete_callback_instance.to_dict() +# create an instance of RecordingCompleteCallback from a dict +recording_complete_callback_form_dict = recording_complete_callback.from_dict(recording_complete_callback_dict) +``` [[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/RecordingStateEnum.md b/docs/RecordingStateEnum.md index 5662a4be..2e1b4e58 100644 --- a/docs/RecordingStateEnum.md +++ b/docs/RecordingStateEnum.md @@ -5,7 +5,6 @@ The recording state. Possible values: `paused` to pause an active recording `r ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording | must be one of ["paused", "recording", ] [[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/RecordingsApi.md b/docs/RecordingsApi.md index 14530532..35d9eb3f 100644 --- a/docs/RecordingsApi.md +++ b/docs/RecordingsApi.md @@ -26,13 +26,13 @@ Deletes the specified recording's transcription. Note: After the deletion is re ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -46,34 +46,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Delete Transcription api_instance.delete_call_transcription(account_id, call_id, recording_id) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->delete_call_transcription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -88,19 +88,17 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | The transcription was successfully deleted | - | +**204** | The transcription was successfully deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -115,13 +113,13 @@ Delete the recording information, media and transcription. Note: After the dele ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -135,34 +133,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Delete Recording api_instance.delete_recording(account_id, call_id, recording_id) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->delete_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -177,19 +175,17 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Recording Deleted | - | +**204** | Recording was deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -204,13 +200,13 @@ Deletes the specified recording's media. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -224,34 +220,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Delete Recording Media api_instance.delete_recording_media(account_id, call_id, recording_id) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->delete_recording_media: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -266,25 +262,23 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | The recording media was successfully deleted | - | +**204** | The recording media was successfully deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) # **download_call_recording** -> file_type download_call_recording(account_id, call_id, recording_id) +> bytearray download_call_recording(account_id, call_id, recording_id) Download Recording @@ -293,13 +287,13 @@ Downloads the specified recording. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -313,39 +307,40 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Download Recording api_response = api_instance.download_call_recording(account_id, call_id, recording_id) + print("The response of RecordingsApi->download_call_recording:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->download_call_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type -**file_type** +**bytearray** ### Authorization @@ -356,9 +351,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: audio/vnd.wave, audio/mpeg, application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Media found | - | @@ -368,7 +361,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -383,14 +376,14 @@ Returns metadata for the specified recording. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError -from bandwidth.model.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -404,35 +397,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Get Call Recording api_response = api_instance.get_call_recording(account_id, call_id, recording_id) + print("The response of RecordingsApi->get_call_recording:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->get_call_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -447,9 +441,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Recording found | - | @@ -459,7 +451,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -474,14 +466,14 @@ Downloads the specified transcription. If the transcribed recording was multi-c ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.transcription_list import TranscriptionList -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.transcription_list import TranscriptionList +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -495,35 +487,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. - # example passing only required values which don't have defaults set try: # Get Transcription api_response = api_instance.get_call_transcription(account_id, call_id, recording_id) + print("The response of RecordingsApi->get_call_transcription:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->get_call_transcription: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | ### Return type @@ -538,9 +531,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Transcription found | - | @@ -550,13 +541,13 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) # **list_account_call_recordings** -> [CallRecordingMetadata] list_account_call_recordings(account_id) +> List[CallRecordingMetadata] list_account_call_recordings(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time) Get Call Recordings @@ -565,14 +556,14 @@ Returns a list of metadata for the recordings associated with the specified acco ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError -from bandwidth.model.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -586,52 +577,44 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - to = "%2b19195551234" # str | Filter results by the `to` field. (optional) - _from = "%2b19195554321" # str | Filter results by the `from` field. (optional) - min_start_time = "2022-06-21T19:13:21Z" # str | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional) - max_start_time = "2022-06-21T19:13:21Z" # str | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). (optional) - - # example passing only required values which don't have defaults set - try: - # Get Call Recordings - api_response = api_instance.list_account_call_recordings(account_id) - pprint(api_response) - except bandwidth.ApiException as e: - print("Exception when calling RecordingsApi->list_account_call_recordings: %s\n" % e) + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + to = '%2b19195551234' # str | Filter results by the `to` field. (optional) + var_from = '%2b19195554321' # str | Filter results by the `from` field. (optional) + min_start_time = '2022-06-21T19:13:21Z' # str | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional) + max_start_time = '2022-06-21T19:13:21Z' # str | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get Call Recordings - api_response = api_instance.list_account_call_recordings(account_id, to=to, _from=_from, min_start_time=min_start_time, max_start_time=max_start_time) + api_response = api_instance.list_account_call_recordings(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time) + print("The response of RecordingsApi->list_account_call_recordings:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->list_account_call_recordings: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **to** | **str**| Filter results by the `to` field. | [optional] - **_from** | **str**| Filter results by the `from` field. | [optional] - **min_start_time** | **str**| Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] - **max_start_time** | **str**| Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). | [optional] + **account_id** | **str**| Your Bandwidth Account ID. | + **to** | **str**| Filter results by the `to` field. | [optional] + **var_from** | **str**| Filter results by the `from` field. | [optional] + **min_start_time** | **str**| Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] + **max_start_time** | **str**| Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). | [optional] ### Return type -[**[CallRecordingMetadata]**](CallRecordingMetadata.md) +[**List[CallRecordingMetadata]**](CallRecordingMetadata.md) ### Authorization @@ -642,9 +625,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Recordings retrieved successfully | - | @@ -654,13 +635,13 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) # **list_call_recordings** -> [CallRecordingMetadata] list_call_recordings(account_id, call_id) +> List[CallRecordingMetadata] list_call_recordings(account_id, call_id) List Call Recordings @@ -669,14 +650,14 @@ Returns a (potentially empty) list of metadata for the recordings that took plac ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.voice_api_error import VoiceApiError -from bandwidth.model.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -690,37 +671,38 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. - # example passing only required values which don't have defaults set try: # List Call Recordings api_response = api_instance.list_call_recordings(account_id, call_id) + print("The response of RecordingsApi->list_call_recordings:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->list_call_recordings: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | ### Return type -[**[CallRecordingMetadata]**](CallRecordingMetadata.md) +[**List[CallRecordingMetadata]**](CallRecordingMetadata.md) ### Authorization @@ -731,9 +713,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Recordings retrieved successfully | - | @@ -743,7 +723,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -758,14 +738,14 @@ Generate the transcription for a specific recording. Transcription can succeed o ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.transcribe_recording import TranscribeRecording -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.transcribe_recording import TranscribeRecording +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -779,43 +759,36 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - recording_id = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Recording ID - transcribe_recording = TranscribeRecording( - callback_url="https://myServer.com/bandwidth/webhooks/transcriptionAvailable", - callback_method=CallbackMethodEnum("POST"), - username="mySecretUsername", - password="mySecretPassword1!", - tag="exampleTag", - callback_timeout=5.5, - ) # TranscribeRecording | - - # example passing only required values which don't have defaults set + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. + transcribe_recording = bandwidth.TranscribeRecording() # TranscribeRecording | + try: # Create Transcription Request api_instance.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->transcribe_call_recording: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **recording_id** | **str**| Programmable Voice API Recording ID | - **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md)| | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **recording_id** | **str**| Programmable Voice API Recording ID. | + **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md)| | ### Return type @@ -830,19 +803,17 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Transcription successfully requested | - | +**204** | Transcription was successfully requested. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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) @@ -857,14 +828,14 @@ Pause or resume a recording on an active phone call. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import recordings_api -from bandwidth.model.update_call_recording import UpdateCallRecording -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.update_call_recording import UpdateCallRecording +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -878,36 +849,34 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = recordings_api.RecordingsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID - call_id = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85" # str | Programmable Voice API Call ID - update_call_recording = UpdateCallRecording( - state=RecordingStateEnum("paused"), - ) # UpdateCallRecording | - - # example passing only required values which don't have defaults set + api_instance = bandwidth.RecordingsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + update_call_recording = bandwidth.UpdateCallRecording() # UpdateCallRecording | + try: # Update Recording api_instance.update_call_recording_state(account_id, call_id, update_call_recording) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling RecordingsApi->update_call_recording_state: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | - **call_id** | **str**| Programmable Voice API Call ID | - **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md)| | + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md)| | ### Return type @@ -922,19 +891,17 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Recording state successfully modified | - | +**200** | Recording state was successfully modified. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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/RedirectCallback.md b/docs/RedirectCallback.md index 6e678bb5..46489833 100644 --- a/docs/RedirectCallback.md +++ b/docs/RedirectCallback.md @@ -6,23 +6,39 @@ The Redirect event is fired when a verb is executed. Its purpose is t Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.redirect_callback import RedirectCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of RedirectCallback from a JSON string +redirect_callback_instance = RedirectCallback.from_json(json) +# print the JSON string representation of the object +print RedirectCallback.to_json() + +# convert the object into a dict +redirect_callback_dict = redirect_callback_instance.to_dict() +# create an instance of RedirectCallback from a dict +redirect_callback_form_dict = redirect_callback.from_dict(redirect_callback_dict) +``` [[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/RedirectMethodEnum.md b/docs/RedirectMethodEnum.md index c215b9f8..a792f1a1 100644 --- a/docs/RedirectMethodEnum.md +++ b/docs/RedirectMethodEnum.md @@ -1,11 +1,10 @@ # RedirectMethodEnum -The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed` +The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.<br><br>Not allowed if `state` is `completed` | defaults to "POST", must be one of ["GET", "POST", ] [[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/RequestError.md b/docs/RequestError.md deleted file mode 100644 index 65740252..00000000 --- a/docs/RequestError.md +++ /dev/null @@ -1,13 +0,0 @@ -# RequestError - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | **str** | A message describing the error with your request. | [optional] -**request_id** | **str** | The associated requestId from AWS. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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/StatisticsApi.md b/docs/StatisticsApi.md index 0eaed17a..4ab15247 100644 --- a/docs/StatisticsApi.md +++ b/docs/StatisticsApi.md @@ -17,14 +17,14 @@ Returns details about the current state of the account. ### Example * Basic Authentication (Basic): - ```python import time +import os import bandwidth -from bandwidth.api import statistics_api -from bandwidth.model.account_statistics import AccountStatistics -from bandwidth.model.voice_api_error import VoiceApiError +from bandwidth.models.account_statistics import AccountStatistics +from bandwidth.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = bandwidth.Configuration( @@ -38,31 +38,32 @@ configuration = bandwidth.Configuration( # Configure HTTP basic authorization: Basic configuration = bandwidth.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) # Enter a context with an instance of the API client with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = statistics_api.StatisticsApi(api_client) - account_id = "9900000" # str | Your Bandwidth Account ID + api_instance = bandwidth.StatisticsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. - # example passing only required values which don't have defaults set try: # Get Account Statistics api_response = api_instance.get_statistics(account_id) + print("The response of StatisticsApi->get_statistics:\n") pprint(api_response) - except bandwidth.ApiException as e: + except Exception as e: print("Exception when calling StatisticsApi->get_statistics: %s\n" % e) ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_id** | **str**| Your Bandwidth Account ID | + **account_id** | **str**| Your Bandwidth Account ID. | ### Return type @@ -77,9 +78,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details - | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Statistics Found | - | @@ -89,7 +88,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | * Retry-After - When you should try your request again
| +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| **500** | Internal Server Error | - | [[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/StirShaken.md b/docs/StirShaken.md index f9943143..f41a820c 100644 --- a/docs/StirShaken.md +++ b/docs/StirShaken.md @@ -7,8 +7,24 @@ Name | Type | Description | Notes **verstat** | **str** | (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed. | [optional] **attestation_indicator** | **str** | (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). | [optional] **originating_id** | **str** | (optional) A unique origination identifier. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.stir_shaken import StirShaken + +# TODO update the JSON string below +json = "{}" +# create an instance of StirShaken from a JSON string +stir_shaken_instance = StirShaken.from_json(json) +# print the JSON string representation of the object +print StirShaken.to_json() + +# convert the object into a dict +stir_shaken_dict = stir_shaken_instance.to_dict() +# create an instance of StirShaken from a dict +stir_shaken_form_dict = stir_shaken.from_dict(stir_shaken_dict) +``` [[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/Tag.md b/docs/Tag.md index 716a45da..79565e36 100644 --- a/docs/Tag.md +++ b/docs/Tag.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **key** | **str** | | [optional] **value** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.tag import Tag + +# TODO update the JSON string below +json = "{}" +# create an instance of Tag from a JSON string +tag_instance = Tag.from_json(json) +# print the JSON string representation of the object +print Tag.to_json() + +# convert the object into a dict +tag_dict = tag_instance.to_dict() +# create an instance of Tag from a dict +tag_form_dict = tag.from_dict(tag_dict) +``` [[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/TnLookupRequestError.md b/docs/TnLookupRequestError.md index 2c0a48fe..a5180963 100644 --- a/docs/TnLookupRequestError.md +++ b/docs/TnLookupRequestError.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | A description of what validation error occurred. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError + +# TODO update the JSON string below +json = "{}" +# create an instance of TnLookupRequestError from a JSON string +tn_lookup_request_error_instance = TnLookupRequestError.from_json(json) +# print the JSON string representation of the object +print TnLookupRequestError.to_json() + +# convert the object into a dict +tn_lookup_request_error_dict = tn_lookup_request_error_instance.to_dict() +# create an instance of TnLookupRequestError from a dict +tn_lookup_request_error_form_dict = tn_lookup_request_error.from_dict(tn_lookup_request_error_dict) +``` [[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/TranscribeRecording.md b/docs/TranscribeRecording.md index b66cba58..e960b3fa 100644 --- a/docs/TranscribeRecording.md +++ b/docs/TranscribeRecording.md @@ -6,12 +6,29 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **callback_url** | **str** | The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization. | [optional] **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] -**username** | **str, none_type** | Basic auth username. | [optional] -**password** | **str, none_type** | Basic auth password. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**callback_timeout** | **float, none_type** | This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. | [optional] if omitted the server will use the default value of 15 -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**username** | **str** | Basic auth username. | [optional] +**password** | **str** | Basic auth password. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. | [optional] [default to 15] +**detect_language** | **bool** | A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. | [optional] [default to False] +## Example + +```python +from bandwidth.models.transcribe_recording import TranscribeRecording + +# TODO update the JSON string below +json = "{}" +# create an instance of TranscribeRecording from a JSON string +transcribe_recording_instance = TranscribeRecording.from_json(json) +# print the JSON string representation of the object +print TranscribeRecording.to_json() + +# convert the object into a dict +transcribe_recording_dict = transcribe_recording_instance.to_dict() +# create an instance of TranscribeRecording from a dict +transcribe_recording_form_dict = transcribe_recording.from_dict(transcribe_recording_dict) +``` [[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/Transcription.md b/docs/Transcription.md index 2fc6ec98..69614ba6 100644 --- a/docs/Transcription.md +++ b/docs/Transcription.md @@ -6,8 +6,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **str** | The transcribed text | [optional] **confidence** | **float** | The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.transcription import Transcription + +# TODO update the JSON string below +json = "{}" +# create an instance of Transcription from a JSON string +transcription_instance = Transcription.from_json(json) +# print the JSON string representation of the object +print Transcription.to_json() + +# convert the object into a dict +transcription_dict = transcription_instance.to_dict() +# create an instance of Transcription from a dict +transcription_form_dict = transcription.from_dict(transcription_dict) +``` [[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/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md index d7df08dd..f295b071 100644 --- a/docs/TranscriptionAvailableCallback.md +++ b/docs/TranscriptionAvailableCallback.md @@ -6,28 +6,44 @@ The Transcription Available event is sent when the recording transcription is av Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**media_url** | **str, none_type** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] +**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **recording_id** | **str** | The unique ID of this recording | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transcription** | [**Transcription**](Transcription.md) | | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of TranscriptionAvailableCallback from a JSON string +transcription_available_callback_instance = TranscriptionAvailableCallback.from_json(json) +# print the JSON string representation of the object +print TranscriptionAvailableCallback.to_json() + +# convert the object into a dict +transcription_available_callback_dict = transcription_available_callback_instance.to_dict() +# create an instance of TranscriptionAvailableCallback from a dict +transcription_available_callback_form_dict = transcription_available_callback.from_dict(transcription_available_callback_dict) +``` [[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/TranscriptionList.md b/docs/TranscriptionList.md index 7d320bdb..d8ef5f3c 100644 --- a/docs/TranscriptionList.md +++ b/docs/TranscriptionList.md @@ -4,9 +4,25 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**transcripts** | [**[Transcription]**](Transcription.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**transcripts** | [**List[Transcription]**](Transcription.md) | | [optional] +## Example + +```python +from bandwidth.models.transcription_list import TranscriptionList + +# TODO update the JSON string below +json = "{}" +# create an instance of TranscriptionList from a JSON string +transcription_list_instance = TranscriptionList.from_json(json) +# print the JSON string representation of the object +print TranscriptionList.to_json() + +# convert the object into a dict +transcription_list_dict = transcription_list_instance.to_dict() +# create an instance of TranscriptionList from a dict +transcription_list_form_dict = transcription_list.from_dict(transcription_list_dict) +``` [[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/TranscriptionMetadata.md b/docs/TranscriptionMetadata.md index 3328c2b6..8d8a4236 100644 --- a/docs/TranscriptionMetadata.md +++ b/docs/TranscriptionMetadata.md @@ -9,8 +9,24 @@ Name | Type | Description | Notes **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] **completed_time** | **str** | The time that the transcription was completed | [optional] **url** | **str** | The URL of the [transcription](#operation/getCallTranscription) | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.transcription_metadata import TranscriptionMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of TranscriptionMetadata from a JSON string +transcription_metadata_instance = TranscriptionMetadata.from_json(json) +# print the JSON string representation of the object +print TranscriptionMetadata.to_json() + +# convert the object into a dict +transcription_metadata_dict = transcription_metadata_instance.to_dict() +# create an instance of TranscriptionMetadata from a dict +transcription_metadata_form_dict = transcription_metadata.from_dict(transcription_metadata_dict) +``` [[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/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md index 7e1c3539..3cb88fb4 100644 --- a/docs/TransferAnswerCallback.md +++ b/docs/TransferAnswerCallback.md @@ -6,22 +6,38 @@ When processing a verb, this event is sent when a called party (B-leg Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferAnswerCallback from a JSON string +transfer_answer_callback_instance = TransferAnswerCallback.from_json(json) +# print the JSON string representation of the object +print TransferAnswerCallback.to_json() + +# convert the object into a dict +transfer_answer_callback_dict = transfer_answer_callback_instance.to_dict() +# create an instance of TransferAnswerCallback from a dict +transfer_answer_callback_form_dict = transfer_answer_callback.from_dict(transfer_answer_callback_dict) +``` [[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/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md index 8511e1cd..c0cdc051 100644 --- a/docs/TransferCompleteCallback.md +++ b/docs/TransferCompleteCallback.md @@ -6,25 +6,41 @@ This event is sent to the transferCompleteUrl of the A-leg's verb whe Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] -**error_message** | **str, none_type** | Text explaining the reason that caused the call to fail in case of errors. | [optional] -**error_id** | **str, none_type** | Bandwidth's internal id that references the error event. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] +**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional] +## Example + +```python +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferCompleteCallback from a JSON string +transfer_complete_callback_instance = TransferCompleteCallback.from_json(json) +# print the JSON string representation of the object +print TransferCompleteCallback.to_json() + +# convert the object into a dict +transfer_complete_callback_dict = transfer_complete_callback_instance.to_dict() +# create an instance of TransferCompleteCallback from a dict +transfer_complete_callback_form_dict = transfer_complete_callback.from_dict(transfer_complete_callback_dict) +``` [[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/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md index a7c9b0b0..ea743865 100644 --- a/docs/TransferDisconnectCallback.md +++ b/docs/TransferDisconnectCallback.md @@ -6,27 +6,43 @@ This event is sent to the transferDisconnectUrl of each tag when i Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_type** | **str** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] -**event_time** | **str** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] +**event_time** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **call_url** | **str** | The URL of the call associated with the event. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] -**enqueued_time** | **datetime, none_type** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] +**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] -**answer_time** | **datetime, none_type** | Time the call was answered, in ISO 8601 format. | [optional] +**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] -**tag** | **str, none_type** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] +**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] -**error_message** | **str, none_type** | Text explaining the reason that caused the call to fail in case of errors. | [optional] -**error_id** | **str, none_type** | Bandwidth's internal id that references the error event. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] +**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional] +## Example + +```python +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferDisconnectCallback from a JSON string +transfer_disconnect_callback_instance = TransferDisconnectCallback.from_json(json) +# print the JSON string representation of the object +print TransferDisconnectCallback.to_json() + +# convert the object into a dict +transfer_disconnect_callback_dict = transfer_disconnect_callback_instance.to_dict() +# create an instance of TransferDisconnectCallback from a dict +transfer_disconnect_callback_form_dict = transfer_disconnect_callback.from_dict(transfer_disconnect_callback_dict) +``` [[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/UpdateCall.md b/docs/UpdateCall.md index 3f4eaa87..e62c224d 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -5,17 +5,33 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **state** | [**CallStateEnum**](CallStateEnum.md) | | [optional] -**redirect_url** | **str, none_type** | The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`. | [optional] +**redirect_url** | **str** | The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`. | [optional] **redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] -**username** | **str, none_type** | Basic auth username. | [optional] -**password** | **str, none_type** | Basic auth password. | [optional] -**redirect_fallback_url** | **str, none_type** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond | [optional] +**username** | **str** | Basic auth username. | [optional] +**password** | **str** | Basic auth password. | [optional] +**redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. | [optional] **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] -**fallback_username** | **str, none_type** | Basic auth username. | [optional] -**fallback_password** | **str, none_type** | Basic auth password. | [optional] -**tag** | **str, none_type** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**fallback_username** | **str** | Basic auth username. | [optional] +**fallback_password** | **str** | Basic auth password. | [optional] +**tag** | **str** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] +## Example + +```python +from bandwidth.models.update_call import UpdateCall + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCall from a JSON string +update_call_instance = UpdateCall.from_json(json) +# print the JSON string representation of the object +print UpdateCall.to_json() + +# convert the object into a dict +update_call_dict = update_call_instance.to_dict() +# create an instance of UpdateCall from a dict +update_call_form_dict = update_call.from_dict(update_call_dict) +``` [[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/UpdateCallRecording.md b/docs/UpdateCallRecording.md index 3e9aba36..7ae49a70 100644 --- a/docs/UpdateCallRecording.md +++ b/docs/UpdateCallRecording.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **state** | [**RecordingStateEnum**](RecordingStateEnum.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.update_call_recording import UpdateCallRecording + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCallRecording from a JSON string +update_call_recording_instance = UpdateCallRecording.from_json(json) +# print the JSON string representation of the object +print UpdateCallRecording.to_json() + +# convert the object into a dict +update_call_recording_dict = update_call_recording_instance.to_dict() +# create an instance of UpdateCallRecording from a dict +update_call_recording_form_dict = update_call_recording.from_dict(update_call_recording_dict) +``` [[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/UpdateConference.md b/docs/UpdateConference.md index bd81f340..4dff95c3 100644 --- a/docs/UpdateConference.md +++ b/docs/UpdateConference.md @@ -5,16 +5,32 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional] -**redirect_url** | **str, none_type** | The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active` | [optional] +**redirect_url** | **str** | The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. | [optional] **redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] -**username** | **str, none_type** | Basic auth username. | [optional] -**password** | **str, none_type** | Basic auth password. | [optional] -**redirect_fallback_url** | **str, none_type** | A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`. | [optional] +**username** | **str** | Basic auth username. | [optional] +**password** | **str** | Basic auth password. | [optional] +**redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`. | [optional] **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] -**fallback_username** | **str, none_type** | Basic auth username. | [optional] -**fallback_password** | **str, none_type** | Basic auth password. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**fallback_username** | **str** | Basic auth username. | [optional] +**fallback_password** | **str** | Basic auth password. | [optional] +## Example + +```python +from bandwidth.models.update_conference import UpdateConference + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateConference from a JSON string +update_conference_instance = UpdateConference.from_json(json) +# print the JSON string representation of the object +print UpdateConference.to_json() + +# convert the object into a dict +update_conference_dict = update_conference_instance.to_dict() +# create an instance of UpdateConference from a dict +update_conference_form_dict = update_conference.from_dict(update_conference_dict) +``` [[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/UpdateConferenceMember.md b/docs/UpdateConferenceMember.md index 215b5cc3..3306417e 100644 --- a/docs/UpdateConferenceMember.md +++ b/docs/UpdateConferenceMember.md @@ -6,9 +6,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mute** | **bool** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted. | [optional] **hold** | **bool** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted. | [optional] -**call_ids_to_coach** | **[str], none_type** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**call_ids_to_coach** | **List[str]** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] +## Example + +```python +from bandwidth.models.update_conference_member import UpdateConferenceMember + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateConferenceMember from a JSON string +update_conference_member_instance = UpdateConferenceMember.from_json(json) +# print the JSON string representation of the object +print UpdateConferenceMember.to_json() + +# convert the object into a dict +update_conference_member_dict = update_conference_member_instance.to_dict() +# create an instance of UpdateConferenceMember from a dict +update_conference_member_form_dict = update_conference_member.from_dict(update_conference_member_dict) +``` [[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/VerifyCodeRequest.md b/docs/VerifyCodeRequest.md index efa578e2..cf533a0b 100644 --- a/docs/VerifyCodeRequest.md +++ b/docs/VerifyCodeRequest.md @@ -5,11 +5,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **to** | **str** | The phone number to send the mfa code to. | +**scope** | **str** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] **expiration_time_in_minutes** | **float** | The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. | **code** | **str** | The generated mfa code to check if valid. | -**scope** | **str** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.verify_code_request import VerifyCodeRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of VerifyCodeRequest from a JSON string +verify_code_request_instance = VerifyCodeRequest.from_json(json) +# print the JSON string representation of the object +print VerifyCodeRequest.to_json() + +# convert the object into a dict +verify_code_request_dict = verify_code_request_instance.to_dict() +# create an instance of VerifyCodeRequest from a dict +verify_code_request_form_dict = verify_code_request.from_dict(verify_code_request_dict) +``` [[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/VerifyCodeResponse.md b/docs/VerifyCodeResponse.md index 774d0a57..4c1a3ee5 100644 --- a/docs/VerifyCodeResponse.md +++ b/docs/VerifyCodeResponse.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **valid** | **bool** | Whether or not the supplied code is valid. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.verify_code_response import VerifyCodeResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VerifyCodeResponse from a JSON string +verify_code_response_instance = VerifyCodeResponse.from_json(json) +# print the JSON string representation of the object +print VerifyCodeResponse.to_json() + +# convert the object into a dict +verify_code_response_dict = verify_code_response_instance.to_dict() +# create an instance of VerifyCodeResponse from a dict +verify_code_response_form_dict = verify_code_response.from_dict(verify_code_response_dict) +``` [[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/VoiceApiError.md b/docs/VoiceApiError.md index 690e3770..8788cd2c 100644 --- a/docs/VoiceApiError.md +++ b/docs/VoiceApiError.md @@ -6,9 +6,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | [optional] **description** | **str** | | [optional] -**id** | **str, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**id** | **str** | | [optional] +## Example + +```python +from bandwidth.models.voice_api_error import VoiceApiError + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceApiError from a JSON string +voice_api_error_instance = VoiceApiError.from_json(json) +# print the JSON string representation of the object +print VoiceApiError.to_json() + +# convert the object into a dict +voice_api_error_dict = voice_api_error_instance.to_dict() +# create an instance of VoiceApiError from a dict +voice_api_error_form_dict = voice_api_error.from_dict(voice_api_error_dict) +``` [[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/VoiceCodeResponse.md b/docs/VoiceCodeResponse.md index 66e60c2c..01a83c7c 100644 --- a/docs/VoiceCodeResponse.md +++ b/docs/VoiceCodeResponse.md @@ -5,8 +5,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **call_id** | **str** | Programmable Voice API Call ID. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from bandwidth.models.voice_code_response import VoiceCodeResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VoiceCodeResponse from a JSON string +voice_code_response_instance = VoiceCodeResponse.from_json(json) +# print the JSON string representation of the object +print VoiceCodeResponse.to_json() + +# convert the object into a dict +voice_code_response_dict = voice_code_response_instance.to_dict() +# create an instance of VoiceCodeResponse from a dict +voice_code_response_form_dict = voice_code_response.from_dict(voice_code_response_dict) +``` [[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/openapi-config.yml b/openapi-config.yml index 28180263..6e31f7c6 100644 --- a/openapi-config.yml +++ b/openapi-config.yml @@ -1,4 +1,5 @@ projectName: bandwidth-sdk packageName: bandwidth -packageVersion: 1.0.0 +packageVersion: 15.0.0 packageUrl: 'https://dev.bandwidth.com/sdks/python' +disallowAdditionalPropertiesIfNotPresent: false diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..10cf5b7d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "bandwidth" +version = "15.0.0" +description = "Bandwidth" +authors = ["Bandwidth "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Bandwidth"] +include = ["bandwidth/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = "^1.10.5, <2" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/requirements.txt b/requirements.txt index 96947f60..258c179c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 1.10.5, < 2 +aenum >= 3.1.11 diff --git a/test-requirements.txt b/test-requirements.txt index b1941c02..666cad0c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,4 @@ +pytest~=7.1.3 pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 pyhamcrest>=2.0.4 diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 19984e05..7b88e884 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -12,16 +12,16 @@ import bandwidth from bandwidth.api import calls_api -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.call_direction_enum import CallDirectionEnum -from bandwidth.model.callback_method_enum import CallbackMethodEnum -from bandwidth.model.machine_detection_configuration import MachineDetectionConfiguration -from bandwidth.model.machine_detection_mode_enum import MachineDetectionModeEnum -from bandwidth.model.call_state_enum import CallStateEnum -from bandwidth.model.redirect_method_enum import RedirectMethodEnum -from bandwidth.model.call_state import CallState -from bandwidth.model.update_call import UpdateCall +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.call_state import CallState +from bandwidth.models.update_call import UpdateCall from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException class CallsIntegration(unittest.TestCase): diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index ad8dfc2f..2b495a8d 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -12,18 +12,18 @@ import bandwidth from bandwidth.api import calls_api -from bandwidth.model.create_call import CreateCall -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.call_state import CallState -from bandwidth.model.call_state_enum import CallStateEnum -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.update_call import UpdateCall +from bandwidth.models.redirect_method_enum import RedirectMethodEnum from bandwidth.api import conferences_api -from bandwidth.model.conference_state_enum import ConferenceStateEnum -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata -from bandwidth.model.update_conference import UpdateConference -from bandwidth.model.update_conference_member import UpdateConferenceMember -from bandwidth.model.file_format_enum import FileFormatEnum +from bandwidth.models.conference_state_enum import ConferenceStateEnum +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.models.update_conference import UpdateConference +from bandwidth.models.update_conference_member import UpdateConferenceMember +from bandwidth.models.file_format_enum import FileFormatEnum from bandwidth.rest import RESTClientObject, RESTResponse from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException from test.utils.env_variables import * diff --git a/test/integration/test_media_api.py b/test/integration/test_media_api.py index 5a970c60..f4b95d53 100644 --- a/test/integration/test_media_api.py +++ b/test/integration/test_media_api.py @@ -10,7 +10,7 @@ import bandwidth from hamcrest import * from bandwidth.api import media_api -from bandwidth.model.media import Media +from bandwidth.models.media import Media from bandwidth.exceptions import ApiException, NotFoundException from test.utils.env_variables import * diff --git a/test/integration/test_messages_api.py b/test/integration/test_messages_api.py index f3d4c6a7..e41eb6e2 100644 --- a/test/integration/test_messages_api.py +++ b/test/integration/test_messages_api.py @@ -18,14 +18,14 @@ import bandwidth from hamcrest import * from bandwidth.api import messages_api -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum -from bandwidth.model.list_message_item import ListMessageItem -from bandwidth.model.message_request import MessageRequest -from bandwidth.model.message_status_enum import MessageStatusEnum -from bandwidth.model.message_type_enum import MessageTypeEnum -from bandwidth.model.messages_list import MessagesList -from bandwidth.model.priority_enum import PriorityEnum -from bandwidth.model.message import Message +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.list_message_item import ListMessageItem +from bandwidth.models.message_request import MessageRequest +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.messages_list import MessagesList +from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.message import Message from bandwidth.exceptions import ApiException, UnauthorizedException from test.utils.env_variables import * diff --git a/test/integration/test_multi_factor_authentication.py b/test/integration/test_multi_factor_authentication.py index a0e1103b..a983f16a 100644 --- a/test/integration/test_multi_factor_authentication.py +++ b/test/integration/test_multi_factor_authentication.py @@ -10,11 +10,11 @@ import bandwidth from bandwidth.api import mfa_api -from bandwidth.model.code_request import CodeRequest -from bandwidth.model.messaging_code_response import MessagingCodeResponse -from bandwidth.model.verify_code_request import VerifyCodeRequest -from bandwidth.model.verify_code_response import VerifyCodeResponse -from bandwidth.model.voice_code_response import VoiceCodeResponse +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse +from bandwidth.models.voice_code_response import VoiceCodeResponse from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException from test.utils.env_variables import * diff --git a/test/integration/test_phone_number_lookup.py b/test/integration/test_phone_number_lookup.py index d145a479..17a76d79 100644 --- a/test/integration/test_phone_number_lookup.py +++ b/test/integration/test_phone_number_lookup.py @@ -2,19 +2,18 @@ Integration test for Bandwidth's Phone Number Lookup API """ -import os import json import time import unittest import bandwidth from bandwidth.api import phone_number_lookup_api -from bandwidth.model.lookup_request import LookupRequest -from bandwidth.model.create_lookup_response import CreateLookupResponse -from bandwidth.model.lookup_status import LookupStatus -from bandwidth.model.lookup_result import LookupResult -from bandwidth.model.lookup_status_enum import LookupStatusEnum -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.models.lookup_result import LookupResult +from bandwidth.models.lookup_status_enum import LookupStatusEnum +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException from test.utils.env_variables import * @@ -47,7 +46,7 @@ def validateResult(self, result: LookupResult, e_164_format: str) -> None: """ # if result has 1 of these attributes it should have the other - if result.get('mobile_country_code') or result.get('mobile_network_code'): + if result.mobile_country_code or result.mobile_network_code: self.assertIs(type(result.mobile_country_code), str) self.assertIs(type(result.mobile_network_code), str) @@ -117,25 +116,23 @@ def testSuccessfulPhoneNumberLookup(self) -> None: # Create the lookup request and validate the response create_lookup_response: CreateLookupResponse = self.api_instance.create_lookup( self.account_id, lookup_request, _return_http_data_only=False) - - self.assertEqual(create_lookup_response[1], 202) - self.assertIs(type(create_lookup_response[0].status), LookupStatusEnum) - self.assertEqual(create_lookup_response[0].status, LookupStatusEnum("IN_PROGRESS")) - self.assertIs(type(create_lookup_response[0].request_id), str) - self.assertRegex(create_lookup_response[0].request_id, + + self.assertIs(type(create_lookup_response.status), LookupStatusEnum) + self.assertEqual(create_lookup_response.status, LookupStatusEnum("IN_PROGRESS")) + self.assertIs(type(create_lookup_response.request_id), str) + self.assertRegex(create_lookup_response.request_id, r'^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$') # Check the status code for the GET LookupStatus response get_lookup_status_response: LookupStatus = self.api_instance.get_lookup_status( - self.account_id, create_lookup_response[0].request_id, _return_http_data_only=False) - self.assertEqual(get_lookup_status_response[1], 200) + self.account_id, create_lookup_response.request_id, _return_http_data_only=False) # make the request again without _return_http_data_only=False to just get the LookupStatus model get_lookup_status_response: LookupStatus = self.pollLookupStatus( - create_lookup_response[0].request_id) + create_lookup_response.request_id) self.assertEqual(get_lookup_status_response.request_id, - create_lookup_response[0].request_id) + create_lookup_response.request_id) self.assertIs(type(get_lookup_status_response), LookupStatus) # Assert that each result is of type LookupResult @@ -143,7 +140,7 @@ def testSuccessfulPhoneNumberLookup(self) -> None: self.assertIs(type(get_lookup_status_response.result[i]), LookupResult) # Check the information for a Bandwidth TN - bw_lookup_result: LookupResult = get_lookup_status_response.result[0] + bw_lookup_result = get_lookup_status_response.result[0] self.validateResult(bw_lookup_result, BW_NUMBER) # Check the information for a Verizon TN diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index a2c2029f..7b6e494c 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -20,18 +20,18 @@ from bandwidth.api.recordings_api import RecordingsApi from bandwidth.configuration import Configuration from bandwidth.exceptions import ForbiddenException, NotFoundException, UnauthorizedException -from bandwidth.model.call_recording_metadata import CallRecordingMetadata -from bandwidth.model.call_state import CallState -from bandwidth.model.call_state_enum import CallStateEnum +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum from bandwidth.api.calls_api import CallsApi -from bandwidth.model.create_call_response import CreateCallResponse -from bandwidth.model.create_call import CreateCall -from bandwidth.model.file_format_enum import FileFormatEnum -from bandwidth.model.recording_state_enum import RecordingStateEnum -from bandwidth.model.transcribe_recording import TranscribeRecording -from bandwidth.model.transcription import Transcription -from bandwidth.model.update_call import UpdateCall -from bandwidth.model.update_call_recording import UpdateCallRecording +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.create_call import CreateCall +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.transcribe_recording import TranscribeRecording +from bandwidth.models.transcription import Transcription +from bandwidth.models.update_call import UpdateCall +from bandwidth.models.update_call_recording import UpdateCallRecording from bandwidth.rest import RESTClientObject, RESTResponse from test.utils.call_cleanup import callCleanup from test.utils.env_variables import * diff --git a/test/test_account_statistics.py b/test/test_account_statistics.py new file mode 100644 index 00000000..e7038499 --- /dev/null +++ b/test/test_account_statistics.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.account_statistics import AccountStatistics # noqa: E501 +from bandwidth.rest import ApiException + +class TestAccountStatistics(unittest.TestCase): + """AccountStatistics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test AccountStatistics + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountStatistics` + """ + model = bandwidth.models.account_statistics.AccountStatistics() # noqa: E501 + if include_optional : + return AccountStatistics( + current_call_queue_size = 0, + max_call_queue_size = 900 + ) + else : + return AccountStatistics( + ) + """ + + def testAccountStatistics(self): + """Test AccountStatistics""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_answer_callback.py b/test/test_answer_callback.py new file mode 100644 index 00000000..94cb3d04 --- /dev/null +++ b/test/test_answer_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.answer_callback import AnswerCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestAnswerCallback(unittest.TestCase): + """AnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test AnswerCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnswerCallback` + """ + model = bandwidth.models.answer_callback.AnswerCallback() # noqa: E501 + if include_optional : + return AnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else : + return AnswerCallback( + ) + """ + + def testAnswerCallback(self): + """Test AnswerCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bridge_complete_callback.py b/test/test_bridge_complete_callback.py new file mode 100644 index 00000000..38ca08a1 --- /dev/null +++ b/test/test_bridge_complete_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestBridgeCompleteCallback(unittest.TestCase): + """BridgeCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test BridgeCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BridgeCompleteCallback` + """ + model = bandwidth.models.bridge_complete_callback.BridgeCompleteCallback() # noqa: E501 + if include_optional : + return BridgeCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return BridgeCompleteCallback( + ) + """ + + def testBridgeCompleteCallback(self): + """Test BridgeCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bridge_target_complete_callback.py b/test/test_bridge_target_complete_callback.py new file mode 100644 index 00000000..7de38d19 --- /dev/null +++ b/test/test_bridge_target_complete_callback.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestBridgeTargetCompleteCallback(unittest.TestCase): + """BridgeTargetCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test BridgeTargetCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BridgeTargetCompleteCallback` + """ + model = bandwidth.models.bridge_target_complete_callback.BridgeTargetCompleteCallback() # noqa: E501 + if include_optional : + return BridgeTargetCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag' + ) + else : + return BridgeTargetCompleteCallback( + ) + """ + + def testBridgeTargetCompleteCallback(self): + """Test BridgeTargetCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_call_direction_enum.py b/test/test_call_direction_enum.py new file mode 100644 index 00000000..7e7c152f --- /dev/null +++ b/test/test_call_direction_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.call_direction_enum import CallDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestCallDirectionEnum(unittest.TestCase): + """CallDirectionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallDirectionEnum(self): + """Test CallDirectionEnum""" + # inst = CallDirectionEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_call_recording_metadata.py b/test/test_call_recording_metadata.py new file mode 100644 index 00000000..6b3e8d9a --- /dev/null +++ b/test/test_call_recording_metadata.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.call_recording_metadata import CallRecordingMetadata # noqa: E501 +from bandwidth.rest import ApiException + +class TestCallRecordingMetadata(unittest.TestCase): + """CallRecordingMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CallRecordingMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CallRecordingMetadata` + """ + model = bandwidth.models.call_recording_metadata.CallRecordingMetadata() # noqa: E501 + if include_optional : + return CallRecordingMetadata( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '920012', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + to = '+15555555555', + var_from = '+15555555555', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + duration = 'PT13.67S', + direction = 'inbound', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + transcription = bandwidth.models.transcription_metadata.transcriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', ) + ) + else : + return CallRecordingMetadata( + ) + """ + + def testCallRecordingMetadata(self): + """Test CallRecordingMetadata""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_call_state.py b/test/test_call_state.py new file mode 100644 index 00000000..a0bb02d5 --- /dev/null +++ b/test/test_call_state.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.call_state import CallState # noqa: E501 +from bandwidth.rest import ApiException + +class TestCallState(unittest.TestCase): + """CallState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CallState + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CallState` + """ + model = bandwidth.models.call_state.CallState() # noqa: E501 + if include_optional : + return CallState( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '19195554321', + direction = 'inbound', + state = 'disconnected', + stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, + identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken', + enqueued_time = '2022-06-16T13:15:07.160Z', + start_time = '2022-06-16T13:15:07.160Z', + answer_time = '2022-06-16T13:15:18.126Z', + end_time = '2022-06-16T13:15:18.314Z', + disconnect_cause = '', + error_message = '', + error_id = '', + last_update = '2022-06-16T13:15:18.314Z' + ) + else : + return CallState( + ) + """ + + def testCallState(self): + """Test CallState""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_call_state_enum.py b/test/test_call_state_enum.py new file mode 100644 index 00000000..e4eb0653 --- /dev/null +++ b/test/test_call_state_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.call_state_enum import CallStateEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestCallStateEnum(unittest.TestCase): + """CallStateEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallStateEnum(self): + """Test CallStateEnum""" + # inst = CallStateEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_callback_method_enum.py b/test/test_callback_method_enum.py new file mode 100644 index 00000000..a91471a3 --- /dev/null +++ b/test/test_callback_method_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.callback_method_enum import CallbackMethodEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestCallbackMethodEnum(unittest.TestCase): + """CallbackMethodEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallbackMethodEnum(self): + """Test CallbackMethodEnum""" + # inst = CallbackMethodEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_calls_api.py b/test/test_calls_api.py new file mode 100644 index 00000000..09019c0b --- /dev/null +++ b/test/test_calls_api.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.calls_api import CallsApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestCallsApi(unittest.TestCase): + """CallsApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.calls_api.CallsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_call(self): + """Test case for create_call + + Create Call # noqa: E501 + """ + pass + + def test_get_call_state(self): + """Test case for get_call_state + + Get Call State Information # noqa: E501 + """ + pass + + def test_update_call(self): + """Test case for update_call + + Update Call # noqa: E501 + """ + pass + + def test_update_call_bxml(self): + """Test case for update_call_bxml + + Update Call BXML # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_code_request.py b/test/test_code_request.py new file mode 100644 index 00000000..9df98c86 --- /dev/null +++ b/test/test_code_request.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.code_request import CodeRequest # noqa: E501 +from bandwidth.rest import ApiException + +class TestCodeRequest(unittest.TestCase): + """CodeRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CodeRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CodeRequest` + """ + model = bandwidth.models.code_request.CodeRequest() # noqa: E501 + if include_optional : + return CodeRequest( + to = '+19195551234', + var_from = '+19195554321', + application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', + scope = '2FA', + message = 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits = 6 + ) + else : + return CodeRequest( + to = '+19195551234', + var_from = '+19195554321', + application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', + message = 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits = 6, + ) + """ + + def testCodeRequest(self): + """Test CodeRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference.py b/test/test_conference.py new file mode 100644 index 00000000..2e83f298 --- /dev/null +++ b/test/test_conference.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference import Conference # noqa: E501 +from bandwidth.rest import ApiException + +class TestConference(unittest.TestCase): + """Conference unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Conference + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Conference` + """ + model = bandwidth.models.conference.Conference() # noqa: E501 + if include_optional : + return Conference( + id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + created_time = '2022-06-17T22:19:40.375Z', + completed_time = '2022-06-17T22:20Z', + conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent', + conference_event_method = 'POST', + tag = 'my custom tag', + active_members = [ + bandwidth.models.conference_member.conferenceMember( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], ) + ] + ) + else : + return Conference( + ) + """ + + def testConference(self): + """Test Conference""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_completed_callback.py b/test/test_conference_completed_callback.py new file mode 100644 index 00000000..7b4be3bc --- /dev/null +++ b/test/test_conference_completed_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceCompletedCallback(unittest.TestCase): + """ConferenceCompletedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceCompletedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceCompletedCallback` + """ + model = bandwidth.models.conference_completed_callback.ConferenceCompletedCallback() # noqa: E501 + if include_optional : + return ConferenceCompletedCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceCompletedCallback( + ) + """ + + def testConferenceCompletedCallback(self): + """Test ConferenceCompletedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_created_callback.py b/test/test_conference_created_callback.py new file mode 100644 index 00000000..af7eff5b --- /dev/null +++ b/test/test_conference_created_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceCreatedCallback(unittest.TestCase): + """ConferenceCreatedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceCreatedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceCreatedCallback` + """ + model = bandwidth.models.conference_created_callback.ConferenceCreatedCallback() # noqa: E501 + if include_optional : + return ConferenceCreatedCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceCreatedCallback( + ) + """ + + def testConferenceCreatedCallback(self): + """Test ConferenceCreatedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_member.py b/test/test_conference_member.py new file mode 100644 index 00000000..51222320 --- /dev/null +++ b/test/test_conference_member.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_member import ConferenceMember # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceMember(unittest.TestCase): + """ConferenceMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMember` + """ + model = bandwidth.models.conference_member.ConferenceMember() # noqa: E501 + if include_optional : + return ConferenceMember( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] + ) + else : + return ConferenceMember( + ) + """ + + def testConferenceMember(self): + """Test ConferenceMember""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_member_exit_callback.py b/test/test_conference_member_exit_callback.py new file mode 100644 index 00000000..879b1f4e --- /dev/null +++ b/test/test_conference_member_exit_callback.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceMemberExitCallback(unittest.TestCase): + """ConferenceMemberExitCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceMemberExitCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMemberExitCallback` + """ + model = bandwidth.models.conference_member_exit_callback.ConferenceMemberExitCallback() # noqa: E501 + if include_optional : + return ConferenceMemberExitCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else : + return ConferenceMemberExitCallback( + ) + """ + + def testConferenceMemberExitCallback(self): + """Test ConferenceMemberExitCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_member_join_callback.py b/test/test_conference_member_join_callback.py new file mode 100644 index 00000000..be466717 --- /dev/null +++ b/test/test_conference_member_join_callback.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceMemberJoinCallback(unittest.TestCase): + """ConferenceMemberJoinCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceMemberJoinCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMemberJoinCallback` + """ + model = bandwidth.models.conference_member_join_callback.ConferenceMemberJoinCallback() # noqa: E501 + if include_optional : + return ConferenceMemberJoinCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else : + return ConferenceMemberJoinCallback( + ) + """ + + def testConferenceMemberJoinCallback(self): + """Test ConferenceMemberJoinCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_recording_available_callback.py b/test/test_conference_recording_available_callback.py new file mode 100644 index 00000000..91de9b94 --- /dev/null +++ b/test/test_conference_recording_available_callback.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceRecordingAvailableCallback(unittest.TestCase): + """ConferenceRecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceRecordingAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRecordingAvailableCallback` + """ + model = bandwidth.models.conference_recording_available_callback.ConferenceRecordingAvailableCallback() # noqa: E501 + if include_optional : + return ConferenceRecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + account_id = '920012', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + tag = 'exampleTag', + status = 'completed' + ) + else : + return ConferenceRecordingAvailableCallback( + ) + """ + + def testConferenceRecordingAvailableCallback(self): + """Test ConferenceRecordingAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_recording_metadata.py b/test/test_conference_recording_metadata.py new file mode 100644 index 00000000..0538c7d2 --- /dev/null +++ b/test/test_conference_recording_metadata.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceRecordingMetadata(unittest.TestCase): + """ConferenceRecordingMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceRecordingMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRecordingMetadata` + """ + model = bandwidth.models.conference_recording_metadata.ConferenceRecordingMetadata() # noqa: E501 + if include_optional : + return ConferenceRecordingMetadata( + account_id = '920012', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + duration = 'PT13.67S', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + ) + else : + return ConferenceRecordingMetadata( + ) + """ + + def testConferenceRecordingMetadata(self): + """Test ConferenceRecordingMetadata""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_redirect_callback.py b/test/test_conference_redirect_callback.py new file mode 100644 index 00000000..4edd30dd --- /dev/null +++ b/test/test_conference_redirect_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceRedirectCallback(unittest.TestCase): + """ConferenceRedirectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceRedirectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRedirectCallback` + """ + model = bandwidth.models.conference_redirect_callback.ConferenceRedirectCallback() # noqa: E501 + if include_optional : + return ConferenceRedirectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceRedirectCallback( + ) + """ + + def testConferenceRedirectCallback(self): + """Test ConferenceRedirectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conference_state_enum.py b/test/test_conference_state_enum.py new file mode 100644 index 00000000..87caff31 --- /dev/null +++ b/test/test_conference_state_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_state_enum import ConferenceStateEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceStateEnum(unittest.TestCase): + """ConferenceStateEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConferenceStateEnum(self): + """Test ConferenceStateEnum""" + # inst = ConferenceStateEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conferences_api.py b/test/test_conferences_api.py new file mode 100644 index 00000000..40eed969 --- /dev/null +++ b/test/test_conferences_api.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.conferences_api import ConferencesApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestConferencesApi(unittest.TestCase): + """ConferencesApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.conferences_api.ConferencesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_download_conference_recording(self): + """Test case for download_conference_recording + + Download Conference Recording # noqa: E501 + """ + pass + + def test_get_conference(self): + """Test case for get_conference + + Get Conference Information # noqa: E501 + """ + pass + + def test_get_conference_member(self): + """Test case for get_conference_member + + Get Conference Member # noqa: E501 + """ + pass + + def test_get_conference_recording(self): + """Test case for get_conference_recording + + Get Conference Recording Information # noqa: E501 + """ + pass + + def test_list_conference_recordings(self): + """Test case for list_conference_recordings + + Get Conference Recordings # noqa: E501 + """ + pass + + def test_list_conferences(self): + """Test case for list_conferences + + Get Conferences # noqa: E501 + """ + pass + + def test_update_conference(self): + """Test case for update_conference + + Update Conference # noqa: E501 + """ + pass + + def test_update_conference_bxml(self): + """Test case for update_conference_bxml + + Update Conference BXML # noqa: E501 + """ + pass + + def test_update_conference_member(self): + """Test case for update_conference_member + + Update Conference Member # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_call.py b/test/test_create_call.py new file mode 100644 index 00000000..2aa1ef1b --- /dev/null +++ b/test/test_create_call.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.create_call import CreateCall # noqa: E501 +from bandwidth.rest import ApiException + +class TestCreateCall(unittest.TestCase): + """CreateCall unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CreateCall + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCall` + """ + model = bandwidth.models.create_call.CreateCall() # noqa: E501 + if include_optional : + return CreateCall( + to = '+19195551234', + var_from = '+19195554321', + display_name = 'John Doe', + uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + answer_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer', + answer_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect', + disconnect_method = 'POST', + call_timeout = 30, + callback_timeout = 15, + machine_detection = bandwidth.models.machine_detection_configuration.machineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', ), + priority = 5, + tag = 'arbitrary text here' + ) + else : + return CreateCall( + to = '+19195551234', + var_from = '+19195554321', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + ) + """ + + def testCreateCall(self): + """Test CreateCall""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_call_response.py b/test/test_create_call_response.py new file mode 100644 index 00000000..deeb0bd2 --- /dev/null +++ b/test/test_create_call_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.create_call_response import CreateCallResponse # noqa: E501 +from bandwidth.rest import ApiException + +class TestCreateCallResponse(unittest.TestCase): + """CreateCallResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CreateCallResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCallResponse` + """ + model = bandwidth.models.create_call_response.CreateCallResponse() # noqa: E501 + if include_optional : + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + enqueued_time = '2022-06-16T13:15:07.160Z', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_timeout = 30, + callback_timeout = 15, + tag = 'My custom tag value', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + answer_fallback_method = 'POST', + answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + priority = 5 + ) + else : + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + ) + """ + + def testCreateCallResponse(self): + """Test CreateCallResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_lookup_response.py b/test/test_create_lookup_response.py new file mode 100644 index 00000000..73081e2a --- /dev/null +++ b/test/test_create_lookup_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.create_lookup_response import CreateLookupResponse # noqa: E501 +from bandwidth.rest import ApiException + +class TestCreateLookupResponse(unittest.TestCase): + """CreateLookupResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CreateLookupResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLookupResponse` + """ + model = bandwidth.models.create_lookup_response.CreateLookupResponse() # noqa: E501 + if include_optional : + return CreateLookupResponse( + request_id = '', + status = 'COMPLETE' + ) + else : + return CreateLookupResponse( + ) + """ + + def testCreateLookupResponse(self): + """Test CreateLookupResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_message_request_error.py b/test/test_create_message_request_error.py new file mode 100644 index 00000000..031fe199 --- /dev/null +++ b/test/test_create_message_request_error.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.create_message_request_error import CreateMessageRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestCreateMessageRequestError(unittest.TestCase): + """CreateMessageRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CreateMessageRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateMessageRequestError` + """ + model = bandwidth.models.create_message_request_error.CreateMessageRequestError() # noqa: E501 + if include_optional : + return CreateMessageRequestError( + type = '', + description = '', + field_errors = [ + bandwidth.models.field_error.fieldError( + field_name = 'from', + description = ''+invalid' must be replaced with a valid E164 formatted telephone number', ) + ] + ) + else : + return CreateMessageRequestError( + type = '', + description = '', + ) + """ + + def testCreateMessageRequestError(self): + """Test CreateMessageRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_deferred_result.py b/test/test_deferred_result.py new file mode 100644 index 00000000..e9a0fee8 --- /dev/null +++ b/test/test_deferred_result.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.deferred_result import DeferredResult # noqa: E501 +from bandwidth.rest import ApiException + +class TestDeferredResult(unittest.TestCase): + """DeferredResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DeferredResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeferredResult` + """ + model = bandwidth.models.deferred_result.DeferredResult() # noqa: E501 + if include_optional : + return DeferredResult( + result = None, + set_or_expired = True + ) + else : + return DeferredResult( + ) + """ + + def testDeferredResult(self): + """Test DeferredResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_disconnect_callback.py b/test/test_disconnect_callback.py new file mode 100644 index 00000000..7efc4c10 --- /dev/null +++ b/test/test_disconnect_callback.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.disconnect_callback import DisconnectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestDisconnectCallback(unittest.TestCase): + """DisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DisconnectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DisconnectCallback` + """ + model = bandwidth.models.disconnect_callback.DisconnectCallback() # noqa: E501 + if include_optional : + return DisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765', + tag = 'exampleTag' + ) + else : + return DisconnectCallback( + ) + """ + + def testDisconnectCallback(self): + """Test DisconnectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_diversion.py b/test/test_diversion.py new file mode 100644 index 00000000..6109e693 --- /dev/null +++ b/test/test_diversion.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.diversion import Diversion # noqa: E501 +from bandwidth.rest import ApiException + +class TestDiversion(unittest.TestCase): + """Diversion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Diversion + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Diversion` + """ + model = bandwidth.models.diversion.Diversion() # noqa: E501 + if include_optional : + return Diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444' + ) + else : + return Diversion( + ) + """ + + def testDiversion(self): + """Test Diversion""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_dtmf_callback.py b/test/test_dtmf_callback.py new file mode 100644 index 00000000..10091a99 --- /dev/null +++ b/test/test_dtmf_callback.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.dtmf_callback import DtmfCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestDtmfCallback(unittest.TestCase): + """DtmfCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DtmfCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DtmfCallback` + """ + model = bandwidth.models.dtmf_callback.DtmfCallback() # noqa: E501 + if include_optional : + return DtmfCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + digit = '2', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + tag = 'exampleTag' + ) + else : + return DtmfCallback( + ) + """ + + def testDtmfCallback(self): + """Test DtmfCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_field_error.py b/test/test_field_error.py new file mode 100644 index 00000000..77e049c6 --- /dev/null +++ b/test/test_field_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.field_error import FieldError # noqa: E501 +from bandwidth.rest import ApiException + +class TestFieldError(unittest.TestCase): + """FieldError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test FieldError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FieldError` + """ + model = bandwidth.models.field_error.FieldError() # noqa: E501 + if include_optional : + return FieldError( + field_name = 'from', + description = ''+invalid' must be replaced with a valid E164 formatted telephone number' + ) + else : + return FieldError( + ) + """ + + def testFieldError(self): + """Test FieldError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_file_format_enum.py b/test/test_file_format_enum.py new file mode 100644 index 00000000..40cf27e0 --- /dev/null +++ b/test/test_file_format_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.file_format_enum import FileFormatEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestFileFormatEnum(unittest.TestCase): + """FileFormatEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileFormatEnum(self): + """Test FileFormatEnum""" + # inst = FileFormatEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_gather_callback.py b/test/test_gather_callback.py new file mode 100644 index 00000000..dae61d55 --- /dev/null +++ b/test/test_gather_callback.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.gather_callback import GatherCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestGatherCallback(unittest.TestCase): + """GatherCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test GatherCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GatherCallback` + """ + model = bandwidth.models.gather_callback.GatherCallback() # noqa: E501 + if include_optional : + return GatherCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + digits = '123', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + terminating_digit = '#', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + tag = 'exampleTag' + ) + else : + return GatherCallback( + ) + """ + + def testGatherCallback(self): + """Test GatherCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_inbound_message_callback.py b/test/test_inbound_message_callback.py new file mode 100644 index 00000000..d0264bc2 --- /dev/null +++ b/test/test_inbound_message_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.inbound_message_callback import InboundMessageCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestInboundMessageCallback(unittest.TestCase): + """InboundMessageCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InboundMessageCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InboundMessageCallback` + """ + model = bandwidth.models.inbound_message_callback.InboundMessageCallback() # noqa: E501 + if include_optional : + return InboundMessageCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return InboundMessageCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testInboundMessageCallback(self): + """Test InboundMessageCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_inbound_message_callback_message.py b/test/test_inbound_message_callback_message.py new file mode 100644 index 00000000..35126e7d --- /dev/null +++ b/test/test_inbound_message_callback_message.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestInboundMessageCallbackMessage(unittest.TestCase): + """InboundMessageCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InboundMessageCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InboundMessageCallbackMessage` + """ + model = bandwidth.models.inbound_message_callback_message.InboundMessageCallbackMessage() # noqa: E501 + if include_optional : + return InboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return InboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + ) + """ + + def testInboundMessageCallbackMessage(self): + """Test InboundMessageCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_initiate_callback.py b/test/test_initiate_callback.py new file mode 100644 index 00000000..49014cae --- /dev/null +++ b/test/test_initiate_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.initiate_callback import InitiateCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestInitiateCallback(unittest.TestCase): + """InitiateCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InitiateCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InitiateCallback` + """ + model = bandwidth.models.initiate_callback.InitiateCallback() # noqa: E501 + if include_optional : + return InitiateCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + start_time = '2022-06-17T22:19:40.375Z', + diversion = bandwidth.models.diversion.diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444', ), + stir_shaken = bandwidth.models.stir_shaken.stirShaken( + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', + originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', ) + ) + else : + return InitiateCallback( + ) + """ + + def testInitiateCallback(self): + """Test InitiateCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_message_direction_enum.py b/test/test_list_message_direction_enum.py new file mode 100644 index 00000000..72ac6efe --- /dev/null +++ b/test/test_list_message_direction_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestListMessageDirectionEnum(unittest.TestCase): + """ListMessageDirectionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testListMessageDirectionEnum(self): + """Test ListMessageDirectionEnum""" + # inst = ListMessageDirectionEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_message_item.py b/test/test_list_message_item.py new file mode 100644 index 00000000..9b549595 --- /dev/null +++ b/test/test_list_message_item.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.list_message_item import ListMessageItem # noqa: E501 +from bandwidth.rest import ApiException + +class TestListMessageItem(unittest.TestCase): + """ListMessageItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ListMessageItem + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListMessageItem` + """ + model = bandwidth.models.list_message_item.ListMessageItem() # noqa: E501 + if include_optional : + return ListMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK' + ) + else : + return ListMessageItem( + ) + """ + + def testListMessageItem(self): + """Test ListMessageItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_lookup_request.py b/test/test_lookup_request.py new file mode 100644 index 00000000..b9d21bce --- /dev/null +++ b/test/test_lookup_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.lookup_request import LookupRequest # noqa: E501 +from bandwidth.rest import ApiException + +class TestLookupRequest(unittest.TestCase): + """LookupRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LookupRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupRequest` + """ + model = bandwidth.models.lookup_request.LookupRequest() # noqa: E501 + if include_optional : + return LookupRequest( + tns = [ + '' + ] + ) + else : + return LookupRequest( + tns = [ + '' + ], + ) + """ + + def testLookupRequest(self): + """Test LookupRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_lookup_result.py b/test/test_lookup_result.py new file mode 100644 index 00000000..38fd0a33 --- /dev/null +++ b/test/test_lookup_result.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.lookup_result import LookupResult # noqa: E501 +from bandwidth.rest import ApiException + +class TestLookupResult(unittest.TestCase): + """LookupResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LookupResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupResult` + """ + model = bandwidth.models.lookup_result.LookupResult() # noqa: E501 + if include_optional : + return LookupResult( + response_code = 0, + message = 'NOERROR', + e_164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010' + ) + else : + return LookupResult( + ) + """ + + def testLookupResult(self): + """Test LookupResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_lookup_status.py b/test/test_lookup_status.py new file mode 100644 index 00000000..8be65daf --- /dev/null +++ b/test/test_lookup_status.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.lookup_status import LookupStatus # noqa: E501 +from bandwidth.rest import ApiException + +class TestLookupStatus(unittest.TestCase): + """LookupStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LookupStatus + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupStatus` + """ + model = bandwidth.models.lookup_status.LookupStatus() # noqa: E501 + if include_optional : + return LookupStatus( + request_id = '004223a0-8b17-41b1-bf81-20732adf5590', + status = 'COMPLETE', + result = [ + bandwidth.models.lookup_result.lookupResult( + response_code = 0, + message = 'NOERROR', + e/164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010', ) + ], + failed_telephone_numbers = ["+191955512345"] + ) + else : + return LookupStatus( + ) + """ + + def testLookupStatus(self): + """Test LookupStatus""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_lookup_status_enum.py b/test/test_lookup_status_enum.py new file mode 100644 index 00000000..abb4208e --- /dev/null +++ b/test/test_lookup_status_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.lookup_status_enum import LookupStatusEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestLookupStatusEnum(unittest.TestCase): + """LookupStatusEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLookupStatusEnum(self): + """Test LookupStatusEnum""" + # inst = LookupStatusEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_machine_detection_complete_callback.py b/test/test_machine_detection_complete_callback.py new file mode 100644 index 00000000..f39febb4 --- /dev/null +++ b/test/test_machine_detection_complete_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionCompleteCallback(unittest.TestCase): + """MachineDetectionCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MachineDetectionCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionCompleteCallback` + """ + model = bandwidth.models.machine_detection_complete_callback.MachineDetectionCompleteCallback() # noqa: E501 + if include_optional : + return MachineDetectionCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else : + return MachineDetectionCompleteCallback( + ) + """ + + def testMachineDetectionCompleteCallback(self): + """Test MachineDetectionCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_machine_detection_configuration.py b/test/test_machine_detection_configuration.py new file mode 100644 index 00000000..2bb49ef7 --- /dev/null +++ b/test/test_machine_detection_configuration.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionConfiguration(unittest.TestCase): + """MachineDetectionConfiguration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MachineDetectionConfiguration + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionConfiguration` + """ + model = bandwidth.models.machine_detection_configuration.MachineDetectionConfiguration() # noqa: E501 + if include_optional : + return MachineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else : + return MachineDetectionConfiguration( + ) + """ + + def testMachineDetectionConfiguration(self): + """Test MachineDetectionConfiguration""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_machine_detection_mode_enum.py b/test/test_machine_detection_mode_enum.py new file mode 100644 index 00000000..78928e99 --- /dev/null +++ b/test/test_machine_detection_mode_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionModeEnum(unittest.TestCase): + """MachineDetectionModeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMachineDetectionModeEnum(self): + """Test MachineDetectionModeEnum""" + # inst = MachineDetectionModeEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_machine_detection_result.py b/test/test_machine_detection_result.py new file mode 100644 index 00000000..845d3360 --- /dev/null +++ b/test/test_machine_detection_result.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_result import MachineDetectionResult # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionResult(unittest.TestCase): + """MachineDetectionResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MachineDetectionResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionResult` + """ + model = bandwidth.models.machine_detection_result.MachineDetectionResult() # noqa: E501 + if include_optional : + return MachineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S' + ) + else : + return MachineDetectionResult( + ) + """ + + def testMachineDetectionResult(self): + """Test MachineDetectionResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_media.py b/test/test_media.py new file mode 100644 index 00000000..62011240 --- /dev/null +++ b/test/test_media.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.media import Media # noqa: E501 +from bandwidth.rest import ApiException + +class TestMedia(unittest.TestCase): + """Media unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Media + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Media` + """ + model = bandwidth.models.media.Media() # noqa: E501 + if include_optional : + return Media( + content = '', + content_length = 56, + media_name = '' + ) + else : + return Media( + ) + """ + + def testMedia(self): + """Test Media""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_media_api.py b/test/test_media_api.py new file mode 100644 index 00000000..2b6ae425 --- /dev/null +++ b/test/test_media_api.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.media_api import MediaApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestMediaApi(unittest.TestCase): + """MediaApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.media_api.MediaApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_media(self): + """Test case for delete_media + + Delete Media # noqa: E501 + """ + pass + + def test_get_media(self): + """Test case for get_media + + Get Media # noqa: E501 + """ + pass + + def test_list_media(self): + """Test case for list_media + + List Media # noqa: E501 + """ + pass + + def test_upload_media(self): + """Test case for upload_media + + Upload Media # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message.py b/test/test_message.py new file mode 100644 index 00000000..b441fda4 --- /dev/null +++ b/test/test_message.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message import Message # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessage(unittest.TestCase): + """Message unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Message + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Message` + """ + model = bandwidth.models.message.Message() # noqa: E501 + if include_optional : + return Message( + id = '1589228074636lm4k2je7j7jklbn2', + owner = '+15554443333', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2022-09-14T18:20:16Z', + segment_count = 2, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"], + text = 'Hello world', + tag = 'custom tag', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else : + return Message( + ) + """ + + def testMessage(self): + """Test Message""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_delivered_callback.py b/test/test_message_delivered_callback.py new file mode 100644 index 00000000..28a9f494 --- /dev/null +++ b/test/test_message_delivered_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageDeliveredCallback(unittest.TestCase): + """MessageDeliveredCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageDeliveredCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageDeliveredCallback` + """ + model = bandwidth.models.message_delivered_callback.MessageDeliveredCallback() # noqa: E501 + if include_optional : + return MessageDeliveredCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return MessageDeliveredCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testMessageDeliveredCallback(self): + """Test MessageDeliveredCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_delivered_callback_message.py b/test/test_message_delivered_callback_message.py new file mode 100644 index 00000000..b7b31569 --- /dev/null +++ b/test/test_message_delivered_callback_message.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageDeliveredCallbackMessage(unittest.TestCase): + """MessageDeliveredCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageDeliveredCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageDeliveredCallbackMessage` + """ + model = bandwidth.models.message_delivered_callback_message.MessageDeliveredCallbackMessage() # noqa: E501 + if include_optional : + return MessageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + ) + """ + + def testMessageDeliveredCallbackMessage(self): + """Test MessageDeliveredCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_direction_enum.py b/test/test_message_direction_enum.py new file mode 100644 index 00000000..d29a5719 --- /dev/null +++ b/test/test_message_direction_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_direction_enum import MessageDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageDirectionEnum(unittest.TestCase): + """MessageDirectionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageDirectionEnum(self): + """Test MessageDirectionEnum""" + # inst = MessageDirectionEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_failed_callback.py b/test/test_message_failed_callback.py new file mode 100644 index 00000000..08699c8b --- /dev/null +++ b/test/test_message_failed_callback.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_failed_callback import MessageFailedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageFailedCallback(unittest.TestCase): + """MessageFailedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageFailedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageFailedCallback` + """ + model = bandwidth.models.message_failed_callback.MessageFailedCallback() # noqa: E501 + if include_optional : + return MessageFailedCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-failed', + to = '+15552223333', + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + error_code = 9902 + ) + else : + return MessageFailedCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-failed', + to = '+15552223333', + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + error_code = 9902, + ) + """ + + def testMessageFailedCallback(self): + """Test MessageFailedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_failed_callback_message.py b/test/test_message_failed_callback_message.py new file mode 100644 index 00000000..71c42fb5 --- /dev/null +++ b/test/test_message_failed_callback_message.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageFailedCallbackMessage(unittest.TestCase): + """MessageFailedCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageFailedCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageFailedCallbackMessage` + """ + model = bandwidth.models.message_failed_callback_message.MessageFailedCallbackMessage() # noqa: E501 + if include_optional : + return MessageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + priority = 'default', + ) + """ + + def testMessageFailedCallbackMessage(self): + """Test MessageFailedCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_request.py b/test/test_message_request.py new file mode 100644 index 00000000..950d437a --- /dev/null +++ b/test/test_message_request.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_request import MessageRequest # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageRequest(unittest.TestCase): + """MessageRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageRequest` + """ + model = bandwidth.models.message_request.MessageRequest() # noqa: E501 + if include_optional : + return MessageRequest( + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + to = ["+15554443333","+15552223333"], + var_from = '+15551113333', + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + tag = 'custom string', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else : + return MessageRequest( + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + to = ["+15554443333","+15552223333"], + var_from = '+15551113333', + ) + """ + + def testMessageRequest(self): + """Test MessageRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_sending_callback.py b/test/test_message_sending_callback.py new file mode 100644 index 00000000..b2ab77f3 --- /dev/null +++ b/test/test_message_sending_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_sending_callback import MessageSendingCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageSendingCallback(unittest.TestCase): + """MessageSendingCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageSendingCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageSendingCallback` + """ + model = bandwidth.models.message_sending_callback.MessageSendingCallback() # noqa: E501 + if include_optional : + return MessageSendingCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-sending', + to = '+15552223333', + description = 'Message is sending to carrier', + message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return MessageSendingCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-sending', + to = '+15552223333', + description = 'Message is sending to carrier', + message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testMessageSendingCallback(self): + """Test MessageSendingCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_sending_callback_message.py b/test/test_message_sending_callback_message.py new file mode 100644 index 00000000..9899720f --- /dev/null +++ b/test/test_message_sending_callback_message.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageSendingCallbackMessage(unittest.TestCase): + """MessageSendingCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageSendingCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageSendingCallbackMessage` + """ + model = bandwidth.models.message_sending_callback_message.MessageSendingCallbackMessage() # noqa: E501 + if include_optional : + return MessageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', + ) + """ + + def testMessageSendingCallbackMessage(self): + """Test MessageSendingCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_status_enum.py b/test/test_message_status_enum.py new file mode 100644 index 00000000..91d85764 --- /dev/null +++ b/test/test_message_status_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_status_enum import MessageStatusEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageStatusEnum(unittest.TestCase): + """MessageStatusEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageStatusEnum(self): + """Test MessageStatusEnum""" + # inst = MessageStatusEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_type_enum.py b/test/test_message_type_enum.py new file mode 100644 index 00000000..05699d58 --- /dev/null +++ b/test/test_message_type_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_type_enum import MessageTypeEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageTypeEnum(unittest.TestCase): + """MessageTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageTypeEnum(self): + """Test MessageTypeEnum""" + # inst = MessageTypeEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_messages_api.py b/test/test_messages_api.py new file mode 100644 index 00000000..17f59e9a --- /dev/null +++ b/test/test_messages_api.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.messages_api import MessagesApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestMessagesApi(unittest.TestCase): + """MessagesApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.messages_api.MessagesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_message(self): + """Test case for create_message + + Create Message # noqa: E501 + """ + pass + + def test_list_messages(self): + """Test case for list_messages + + List Messages # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_messages_list.py b/test/test_messages_list.py new file mode 100644 index 00000000..f2a556db --- /dev/null +++ b/test/test_messages_list.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.messages_list import MessagesList # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessagesList(unittest.TestCase): + """MessagesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessagesList + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagesList` + """ + model = bandwidth.models.messages_list.MessagesList() # noqa: E501 + if include_optional : + return MessagesList( + total_count = 100, + page_info = bandwidth.models.page_info.PageInfo( + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', + next_page_token = 'GL83PD3C', ), + messages = [ + bandwidth.models.list_message_item.listMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK', ) + ] + ) + else : + return MessagesList( + ) + """ + + def testMessagesList(self): + """Test MessagesList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_messaging_code_response.py b/test/test_messaging_code_response.py new file mode 100644 index 00000000..53578365 --- /dev/null +++ b/test/test_messaging_code_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.messaging_code_response import MessagingCodeResponse # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessagingCodeResponse(unittest.TestCase): + """MessagingCodeResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessagingCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagingCodeResponse` + """ + model = bandwidth.models.messaging_code_response.MessagingCodeResponse() # noqa: E501 + if include_optional : + return MessagingCodeResponse( + message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' + ) + else : + return MessagingCodeResponse( + ) + """ + + def testMessagingCodeResponse(self): + """Test MessagingCodeResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_messaging_request_error.py b/test/test_messaging_request_error.py new file mode 100644 index 00000000..ec14fc51 --- /dev/null +++ b/test/test_messaging_request_error.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.messaging_request_error import MessagingRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessagingRequestError(unittest.TestCase): + """MessagingRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessagingRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagingRequestError` + """ + model = bandwidth.models.messaging_request_error.MessagingRequestError() # noqa: E501 + if include_optional : + return MessagingRequestError( + type = '', + description = '' + ) + else : + return MessagingRequestError( + type = '', + description = '', + ) + """ + + def testMessagingRequestError(self): + """Test MessagingRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_mfa_api.py b/test/test_mfa_api.py new file mode 100644 index 00000000..7559e2d8 --- /dev/null +++ b/test/test_mfa_api.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.mfa_api import MFAApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestMFAApi(unittest.TestCase): + """MFAApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.mfa_api.MFAApi() # noqa: E501 + + def tearDown(self): + pass + + def test_generate_messaging_code(self): + """Test case for generate_messaging_code + + Messaging Authentication Code # noqa: E501 + """ + pass + + def test_generate_voice_code(self): + """Test case for generate_voice_code + + Voice Authentication Code # noqa: E501 + """ + pass + + def test_verify_code(self): + """Test case for verify_code + + Verify Authentication Code # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_mfa_forbidden_request_error.py b/test/test_mfa_forbidden_request_error.py new file mode 100644 index 00000000..5a754be2 --- /dev/null +++ b/test/test_mfa_forbidden_request_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestMfaForbiddenRequestError(unittest.TestCase): + """MfaForbiddenRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MfaForbiddenRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaForbiddenRequestError` + """ + model = bandwidth.models.mfa_forbidden_request_error.MfaForbiddenRequestError() # noqa: E501 + if include_optional : + return MfaForbiddenRequestError( + message = 'Missing Authentication Token' + ) + else : + return MfaForbiddenRequestError( + ) + """ + + def testMfaForbiddenRequestError(self): + """Test MfaForbiddenRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_mfa_request_error.py b/test/test_mfa_request_error.py new file mode 100644 index 00000000..2e5423b9 --- /dev/null +++ b/test/test_mfa_request_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.mfa_request_error import MfaRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestMfaRequestError(unittest.TestCase): + """MfaRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MfaRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaRequestError` + """ + model = bandwidth.models.mfa_request_error.MfaRequestError() # noqa: E501 + if include_optional : + return MfaRequestError( + error = '400 Request is malformed or invalid', + request_id = '354cc8a3-6701-461e-8fa7-8671703dd898' + ) + else : + return MfaRequestError( + ) + """ + + def testMfaRequestError(self): + """Test MfaRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_mfa_unauthorized_request_error.py b/test/test_mfa_unauthorized_request_error.py new file mode 100644 index 00000000..c6e719ce --- /dev/null +++ b/test/test_mfa_unauthorized_request_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestMfaUnauthorizedRequestError(unittest.TestCase): + """MfaUnauthorizedRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MfaUnauthorizedRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaUnauthorizedRequestError` + """ + model = bandwidth.models.mfa_unauthorized_request_error.MfaUnauthorizedRequestError() # noqa: E501 + if include_optional : + return MfaUnauthorizedRequestError( + message = 'Unauthorized' + ) + else : + return MfaUnauthorizedRequestError( + ) + """ + + def testMfaUnauthorizedRequestError(self): + """Test MfaUnauthorizedRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_page_info.py b/test/test_page_info.py new file mode 100644 index 00000000..07dc573a --- /dev/null +++ b/test/test_page_info.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.page_info import PageInfo # noqa: E501 +from bandwidth.rest import ApiException + +class TestPageInfo(unittest.TestCase): + """PageInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test PageInfo + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageInfo` + """ + model = bandwidth.models.page_info.PageInfo() # noqa: E501 + if include_optional : + return PageInfo( + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', + next_page_token = 'GL83PD3C' + ) + else : + return PageInfo( + ) + """ + + def testPageInfo(self): + """Test PageInfo""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_phone_number_lookup_api.py b/test/test_phone_number_lookup_api.py new file mode 100644 index 00000000..bf70014c --- /dev/null +++ b/test/test_phone_number_lookup_api.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestPhoneNumberLookupApi(unittest.TestCase): + """PhoneNumberLookupApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.phone_number_lookup_api.PhoneNumberLookupApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_lookup(self): + """Test case for create_lookup + + Create Lookup # noqa: E501 + """ + pass + + def test_get_lookup_status(self): + """Test case for get_lookup_status + + Get Lookup Request Status # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_priority_enum.py b/test/test_priority_enum.py new file mode 100644 index 00000000..6111bb1d --- /dev/null +++ b/test/test_priority_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.priority_enum import PriorityEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestPriorityEnum(unittest.TestCase): + """PriorityEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPriorityEnum(self): + """Test PriorityEnum""" + # inst = PriorityEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_recording_available_callback.py b/test/test_recording_available_callback.py new file mode 100644 index 00000000..09bc1902 --- /dev/null +++ b/test/test_recording_available_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.recording_available_callback import RecordingAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRecordingAvailableCallback(unittest.TestCase): + """RecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RecordingAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RecordingAvailableCallback` + """ + model = bandwidth.models.recording_available_callback.RecordingAvailableCallback() # noqa: E501 + if include_optional : + return RecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 'completed', + tag = 'exampleTag', + status = 'completed', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RecordingAvailableCallback( + ) + """ + + def testRecordingAvailableCallback(self): + """Test RecordingAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_recording_complete_callback.py b/test/test_recording_complete_callback.py new file mode 100644 index 00000000..c8a4c403 --- /dev/null +++ b/test/test_recording_complete_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRecordingCompleteCallback(unittest.TestCase): + """RecordingCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RecordingCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RecordingCompleteCallback` + """ + model = bandwidth.models.recording_complete_callback.RecordingCompleteCallback() # noqa: E501 + if include_optional : + return RecordingCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 1, + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RecordingCompleteCallback( + ) + """ + + def testRecordingCompleteCallback(self): + """Test RecordingCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_recording_state_enum.py b/test/test_recording_state_enum.py new file mode 100644 index 00000000..de388697 --- /dev/null +++ b/test/test_recording_state_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.recording_state_enum import RecordingStateEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestRecordingStateEnum(unittest.TestCase): + """RecordingStateEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRecordingStateEnum(self): + """Test RecordingStateEnum""" + # inst = RecordingStateEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_recordings_api.py b/test/test_recordings_api.py new file mode 100644 index 00000000..c0eb20b4 --- /dev/null +++ b/test/test_recordings_api.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.recordings_api import RecordingsApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestRecordingsApi(unittest.TestCase): + """RecordingsApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.recordings_api.RecordingsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_call_transcription(self): + """Test case for delete_call_transcription + + Delete Transcription # noqa: E501 + """ + pass + + def test_delete_recording(self): + """Test case for delete_recording + + Delete Recording # noqa: E501 + """ + pass + + def test_delete_recording_media(self): + """Test case for delete_recording_media + + Delete Recording Media # noqa: E501 + """ + pass + + def test_download_call_recording(self): + """Test case for download_call_recording + + Download Recording # noqa: E501 + """ + pass + + def test_get_call_recording(self): + """Test case for get_call_recording + + Get Call Recording # noqa: E501 + """ + pass + + def test_get_call_transcription(self): + """Test case for get_call_transcription + + Get Transcription # noqa: E501 + """ + pass + + def test_list_account_call_recordings(self): + """Test case for list_account_call_recordings + + Get Call Recordings # noqa: E501 + """ + pass + + def test_list_call_recordings(self): + """Test case for list_call_recordings + + List Call Recordings # noqa: E501 + """ + pass + + def test_transcribe_call_recording(self): + """Test case for transcribe_call_recording + + Create Transcription Request # noqa: E501 + """ + pass + + def test_update_call_recording_state(self): + """Test case for update_call_recording_state + + Update Recording # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_redirect_callback.py b/test/test_redirect_callback.py new file mode 100644 index 00000000..83df0c06 --- /dev/null +++ b/test/test_redirect_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.redirect_callback import RedirectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRedirectCallback(unittest.TestCase): + """RedirectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RedirectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RedirectCallback` + """ + model = bandwidth.models.redirect_callback.RedirectCallback() # noqa: E501 + if include_optional : + return RedirectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RedirectCallback( + ) + """ + + def testRedirectCallback(self): + """Test RedirectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_redirect_method_enum.py b/test/test_redirect_method_enum.py new file mode 100644 index 00000000..b1908a31 --- /dev/null +++ b/test/test_redirect_method_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.redirect_method_enum import RedirectMethodEnum # noqa: E501 +from bandwidth.rest import ApiException + +class TestRedirectMethodEnum(unittest.TestCase): + """RedirectMethodEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRedirectMethodEnum(self): + """Test RedirectMethodEnum""" + # inst = RedirectMethodEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_statistics_api.py b/test/test_statistics_api.py new file mode 100644 index 00000000..103f3da2 --- /dev/null +++ b/test/test_statistics_api.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +import bandwidth +from bandwidth.api.statistics_api import StatisticsApi # noqa: E501 +from bandwidth.rest import ApiException + + +class TestStatisticsApi(unittest.TestCase): + """StatisticsApi unit test stubs""" + + def setUp(self): + self.api = bandwidth.api.statistics_api.StatisticsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_statistics(self): + """Test case for get_statistics + + Get Account Statistics # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_stir_shaken.py b/test/test_stir_shaken.py new file mode 100644 index 00000000..17fff122 --- /dev/null +++ b/test/test_stir_shaken.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.stir_shaken import StirShaken # noqa: E501 +from bandwidth.rest import ApiException + +class TestStirShaken(unittest.TestCase): + """StirShaken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test StirShaken + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StirShaken` + """ + model = bandwidth.models.stir_shaken.StirShaken() # noqa: E501 + if include_optional : + return StirShaken( + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', + originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af' + ) + else : + return StirShaken( + ) + """ + + def testStirShaken(self): + """Test StirShaken""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tag.py b/test/test_tag.py new file mode 100644 index 00000000..c773cad7 --- /dev/null +++ b/test/test_tag.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.tag import Tag # noqa: E501 +from bandwidth.rest import ApiException + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Tag + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tag` + """ + model = bandwidth.models.tag.Tag() # noqa: E501 + if include_optional : + return Tag( + key = '', + value = '' + ) + else : + return Tag( + ) + """ + + def testTag(self): + """Test Tag""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tn_lookup_request_error.py b/test/test_tn_lookup_request_error.py new file mode 100644 index 00000000..ae62fa79 --- /dev/null +++ b/test/test_tn_lookup_request_error.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestTnLookupRequestError(unittest.TestCase): + """TnLookupRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TnLookupRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TnLookupRequestError` + """ + model = bandwidth.models.tn_lookup_request_error.TnLookupRequestError() # noqa: E501 + if include_optional : + return TnLookupRequestError( + message = 'example error message' + ) + else : + return TnLookupRequestError( + ) + """ + + def testTnLookupRequestError(self): + """Test TnLookupRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transcribe_recording.py b/test/test_transcribe_recording.py new file mode 100644 index 00000000..6bc69901 --- /dev/null +++ b/test/test_transcribe_recording.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcribe_recording import TranscribeRecording # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscribeRecording(unittest.TestCase): + """TranscribeRecording unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TranscribeRecording + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscribeRecording` + """ + model = bandwidth.models.transcribe_recording.TranscribeRecording() # noqa: E501 + if include_optional : + return TranscribeRecording( + callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + tag = 'exampleTag', + callback_timeout = 5.5, + detect_language = True + ) + else : + return TranscribeRecording( + ) + """ + + def testTranscribeRecording(self): + """Test TranscribeRecording""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transcription.py b/test/test_transcription.py new file mode 100644 index 00000000..0913bc68 --- /dev/null +++ b/test/test_transcription.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcription import Transcription # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscription(unittest.TestCase): + """Transcription unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test Transcription + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Transcription` + """ + model = bandwidth.models.transcription.Transcription() # noqa: E501 + if include_optional : + return Transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9 + ) + else : + return Transcription( + ) + """ + + def testTranscription(self): + """Test Transcription""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transcription_available_callback.py b/test/test_transcription_available_callback.py new file mode 100644 index 00000000..2cd8ea3e --- /dev/null +++ b/test/test_transcription_available_callback.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscriptionAvailableCallback(unittest.TestCase): + """TranscriptionAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TranscriptionAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionAvailableCallback` + """ + model = bandwidth.models.transcription_available_callback.TranscriptionAvailableCallback() # noqa: E501 + if include_optional : + return TranscriptionAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + tag = 'exampleTag', + transcription = bandwidth.models.transcription.transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ), + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return TranscriptionAvailableCallback( + ) + """ + + def testTranscriptionAvailableCallback(self): + """Test TranscriptionAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transcription_list.py b/test/test_transcription_list.py new file mode 100644 index 00000000..cba18c12 --- /dev/null +++ b/test/test_transcription_list.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcription_list import TranscriptionList # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscriptionList(unittest.TestCase): + """TranscriptionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TranscriptionList + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionList` + """ + model = bandwidth.models.transcription_list.TranscriptionList() # noqa: E501 + if include_optional : + return TranscriptionList( + transcripts = [ + bandwidth.models.transcription.transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ) + ] + ) + else : + return TranscriptionList( + ) + """ + + def testTranscriptionList(self): + """Test TranscriptionList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transcription_metadata.py b/test/test_transcription_metadata.py new file mode 100644 index 00000000..721ecb71 --- /dev/null +++ b/test/test_transcription_metadata.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcription_metadata import TranscriptionMetadata # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscriptionMetadata(unittest.TestCase): + """TranscriptionMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TranscriptionMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionMetadata` + """ + model = bandwidth.models.transcription_metadata.TranscriptionMetadata() # noqa: E501 + if include_optional : + return TranscriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' + ) + else : + return TranscriptionMetadata( + ) + """ + + def testTranscriptionMetadata(self): + """Test TranscriptionMetadata""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transfer_answer_callback.py b/test/test_transfer_answer_callback.py new file mode 100644 index 00000000..b010211f --- /dev/null +++ b/test/test_transfer_answer_callback.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferAnswerCallback(unittest.TestCase): + """TransferAnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferAnswerCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferAnswerCallback` + """ + model = bandwidth.models.transfer_answer_callback.TransferAnswerCallback() # noqa: E501 + if include_optional : + return TransferAnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return TransferAnswerCallback( + ) + """ + + def testTransferAnswerCallback(self): + """Test TransferAnswerCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transfer_complete_callback.py b/test/test_transfer_complete_callback.py new file mode 100644 index 00000000..70dab471 --- /dev/null +++ b/test/test_transfer_complete_callback.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferCompleteCallback(unittest.TestCase): + """TransferCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferCompleteCallback` + """ + model = bandwidth.models.transfer_complete_callback.TransferCompleteCallback() # noqa: E501 + if include_optional : + return TransferCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return TransferCompleteCallback( + ) + """ + + def testTransferCompleteCallback(self): + """Test TransferCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transfer_disconnect_callback.py b/test/test_transfer_disconnect_callback.py new file mode 100644 index 00000000..5fcf35d6 --- /dev/null +++ b/test/test_transfer_disconnect_callback.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferDisconnectCallback(unittest.TestCase): + """TransferDisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferDisconnectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferDisconnectCallback` + """ + model = bandwidth.models.transfer_disconnect_callback.TransferDisconnectCallback() # noqa: E501 + if include_optional : + return TransferDisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return TransferDisconnectCallback( + ) + """ + + def testTransferDisconnectCallback(self): + """Test TransferDisconnectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_call.py b/test/test_update_call.py new file mode 100644 index 00000000..a9ed57bd --- /dev/null +++ b/test/test_update_call.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.update_call import UpdateCall # noqa: E501 +from bandwidth.rest import ApiException + +class TestUpdateCall(unittest.TestCase): + """UpdateCall unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test UpdateCall + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCall` + """ + model = bandwidth.models.update_call.UpdateCall() # noqa: E501 + if include_optional : + return UpdateCall( + state = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + tag = 'My Custom Tag' + ) + else : + return UpdateCall( + ) + """ + + def testUpdateCall(self): + """Test UpdateCall""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_call_recording.py b/test/test_update_call_recording.py new file mode 100644 index 00000000..a853acac --- /dev/null +++ b/test/test_update_call_recording.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.update_call_recording import UpdateCallRecording # noqa: E501 +from bandwidth.rest import ApiException + +class TestUpdateCallRecording(unittest.TestCase): + """UpdateCallRecording unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test UpdateCallRecording + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCallRecording` + """ + model = bandwidth.models.update_call_recording.UpdateCallRecording() # noqa: E501 + if include_optional : + return UpdateCallRecording( + state = 'paused' + ) + else : + return UpdateCallRecording( + state = 'paused', + ) + """ + + def testUpdateCallRecording(self): + """Test UpdateCallRecording""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_conference.py b/test/test_update_conference.py new file mode 100644 index 00000000..ddf8509e --- /dev/null +++ b/test/test_update_conference.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.update_conference import UpdateConference # noqa: E501 +from bandwidth.rest import ApiException + +class TestUpdateConference(unittest.TestCase): + """UpdateConference unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test UpdateConference + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateConference` + """ + model = bandwidth.models.update_conference.UpdateConference() # noqa: E501 + if include_optional : + return UpdateConference( + status = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else : + return UpdateConference( + ) + """ + + def testUpdateConference(self): + """Test UpdateConference""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_conference_member.py b/test/test_update_conference_member.py new file mode 100644 index 00000000..0f153ff4 --- /dev/null +++ b/test/test_update_conference_member.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.update_conference_member import UpdateConferenceMember # noqa: E501 +from bandwidth.rest import ApiException + +class TestUpdateConferenceMember(unittest.TestCase): + """UpdateConferenceMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test UpdateConferenceMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateConferenceMember` + """ + model = bandwidth.models.update_conference_member.UpdateConferenceMember() # noqa: E501 + if include_optional : + return UpdateConferenceMember( + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] + ) + else : + return UpdateConferenceMember( + ) + """ + + def testUpdateConferenceMember(self): + """Test UpdateConferenceMember""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_verify_code_request.py b/test/test_verify_code_request.py new file mode 100644 index 00000000..5cefb99a --- /dev/null +++ b/test/test_verify_code_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.verify_code_request import VerifyCodeRequest # noqa: E501 +from bandwidth.rest import ApiException + +class TestVerifyCodeRequest(unittest.TestCase): + """VerifyCodeRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test VerifyCodeRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VerifyCodeRequest` + """ + model = bandwidth.models.verify_code_request.VerifyCodeRequest() # noqa: E501 + if include_optional : + return VerifyCodeRequest( + to = '+19195551234', + scope = '2FA', + expiration_time_in_minutes = 3, + code = '123456' + ) + else : + return VerifyCodeRequest( + to = '+19195551234', + expiration_time_in_minutes = 3, + code = '123456', + ) + """ + + def testVerifyCodeRequest(self): + """Test VerifyCodeRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_verify_code_response.py b/test/test_verify_code_response.py new file mode 100644 index 00000000..e335d611 --- /dev/null +++ b/test/test_verify_code_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.verify_code_response import VerifyCodeResponse # noqa: E501 +from bandwidth.rest import ApiException + +class TestVerifyCodeResponse(unittest.TestCase): + """VerifyCodeResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test VerifyCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VerifyCodeResponse` + """ + model = bandwidth.models.verify_code_response.VerifyCodeResponse() # noqa: E501 + if include_optional : + return VerifyCodeResponse( + valid = True + ) + else : + return VerifyCodeResponse( + ) + """ + + def testVerifyCodeResponse(self): + """Test VerifyCodeResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_voice_api_error.py b/test/test_voice_api_error.py new file mode 100644 index 00000000..837b75c6 --- /dev/null +++ b/test/test_voice_api_error.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.voice_api_error import VoiceApiError # noqa: E501 +from bandwidth.rest import ApiException + +class TestVoiceApiError(unittest.TestCase): + """VoiceApiError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test VoiceApiError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceApiError` + """ + model = bandwidth.models.voice_api_error.VoiceApiError() # noqa: E501 + if include_optional : + return VoiceApiError( + type = '', + description = '', + id = '' + ) + else : + return VoiceApiError( + ) + """ + + def testVoiceApiError(self): + """Test VoiceApiError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_voice_code_response.py b/test/test_voice_code_response.py new file mode 100644 index 00000000..71950960 --- /dev/null +++ b/test/test_voice_code_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.voice_code_response import VoiceCodeResponse # noqa: E501 +from bandwidth.rest import ApiException + +class TestVoiceCodeResponse(unittest.TestCase): + """VoiceCodeResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test VoiceCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceCodeResponse` + """ + model = bandwidth.models.voice_code_response.VoiceCodeResponse() # noqa: E501 + if include_optional : + return VoiceCodeResponse( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + ) + else : + return VoiceCodeResponse( + ) + """ + + def testVoiceCodeResponse(self): + """Test VoiceCodeResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/bxml/test_base_classes.py b/test/unit/bxml/test_base_classes.py index d7f67ba4..6528c2ec 100644 --- a/test/unit/bxml/test_base_classes.py +++ b/test/unit/bxml/test_base_classes.py @@ -9,9 +9,9 @@ import pytest import unittest -from bandwidth.model.bxml.root import Root -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.terminal_verb import TerminalVerb +from bandwidth.models.bxml import Root +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import TerminalVerb class TestBaseClasses(unittest.TestCase): diff --git a/test/unit/bxml/test_bridge.py b/test/unit/bxml/test_bridge.py index 493c9f88..c41e9be7 100644 --- a/test/unit/bxml/test_bridge.py +++ b/test/unit/bxml/test_bridge.py @@ -5,12 +5,10 @@ @copyright Bandwidth Inc. """ -import os -import pytest import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.bridge import Bridge +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Bridge class TestBridge(unittest.TestCase): diff --git a/test/unit/bxml/test_bxml.py b/test/unit/bxml/test_bxml.py index 748a4f30..77d1a577 100644 --- a/test/unit/bxml/test_bxml.py +++ b/test/unit/bxml/test_bxml.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.model.bxml.bxml import Bxml +from bandwidth.models.bxml import Bxml class TestBxml(unittest.TestCase): diff --git a/test/unit/bxml/test_conference.py b/test/unit/bxml/test_conference.py index 58718b94..35d9733b 100644 --- a/test/unit/bxml/test_conference.py +++ b/test/unit/bxml/test_conference.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs import Conference +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Conference class TestConference(unittest.TestCase): diff --git a/test/unit/bxml/test_forward.py b/test/unit/bxml/test_forward.py index c6d5b6a8..17a0d2b1 100644 --- a/test/unit/bxml/test_forward.py +++ b/test/unit/bxml/test_forward.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.forward import Forward +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml.verbs.forward import Forward class TestForward(unittest.TestCase): diff --git a/test/unit/bxml/test_gather.py b/test/unit/bxml/test_gather.py index 0ab939f9..a4b624c2 100644 --- a/test/unit/bxml/test_gather.py +++ b/test/unit/bxml/test_gather.py @@ -5,11 +5,9 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs import PlayAudio,SpeakSentence,Gather +from bandwidth.models.bxml import PlayAudio,SpeakSentence,Gather class TestGather(unittest.TestCase): diff --git a/test/unit/bxml/test_hangup.py b/test/unit/bxml/test_hangup.py index 8ca1d8b3..9e2edb0f 100644 --- a/test/unit/bxml/test_hangup.py +++ b/test/unit/bxml/test_hangup.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.hangup import Hangup +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml.verbs.hangup import Hangup class TestHangup(unittest.TestCase): diff --git a/test/unit/bxml/test_pause.py b/test/unit/bxml/test_pause.py index bc40a392..ae9d8471 100644 --- a/test/unit/bxml/test_pause.py +++ b/test/unit/bxml/test_pause.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.pause import Pause +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Pause class TestPause(unittest.TestCase): diff --git a/test/unit/bxml/test_pause_recording.py b/test/unit/bxml/test_pause_recording.py index 97f1d94a..ce20eca6 100644 --- a/test/unit/bxml/test_pause_recording.py +++ b/test/unit/bxml/test_pause_recording.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.pause_recording import PauseRecording +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import PauseRecording class TestPauseRecording(unittest.TestCase): diff --git a/test/unit/bxml/test_phone_number.py b/test/unit/bxml/test_phone_number.py index 16db660b..3c4cff5e 100644 --- a/test/unit/bxml/test_phone_number.py +++ b/test/unit/bxml/test_phone_number.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.phone_number import PhoneNumber +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import PhoneNumber class TestPhoneNumber(unittest.TestCase): diff --git a/test/unit/bxml/test_play_audio.py b/test/unit/bxml/test_play_audio.py index ca195c50..e430719b 100644 --- a/test/unit/bxml/test_play_audio.py +++ b/test/unit/bxml/test_play_audio.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs import PlayAudio +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import PlayAudio class TestPlayAudio(unittest.TestCase): diff --git a/test/unit/bxml/test_record.py b/test/unit/bxml/test_record.py index 9e5a46ea..3b08a7a5 100644 --- a/test/unit/bxml/test_record.py +++ b/test/unit/bxml/test_record.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.record import Record +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Record class TestRecord(unittest.TestCase): diff --git a/test/unit/bxml/test_redirect.py b/test/unit/bxml/test_redirect.py index 9acb4bf0..192446f6 100644 --- a/test/unit/bxml/test_redirect.py +++ b/test/unit/bxml/test_redirect.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.redirect import Redirect +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Redirect class TestRedirect(unittest.TestCase): diff --git a/test/unit/bxml/test_response.py b/test/unit/bxml/test_response.py index 218c2cc5..b90b9b41 100644 --- a/test/unit/bxml/test_response.py +++ b/test/unit/bxml/test_response.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.model.bxml.response import Response +from bandwidth.models.bxml import Response class TestResponse(unittest.TestCase): diff --git a/test/unit/bxml/test_resume_recording.py b/test/unit/bxml/test_resume_recording.py index 04afc904..bc7a3bf2 100644 --- a/test/unit/bxml/test_resume_recording.py +++ b/test/unit/bxml/test_resume_recording.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.resume_recording import ResumeRecording +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import ResumeRecording class TestResumeRecording(unittest.TestCase): diff --git a/test/unit/bxml/test_ring.py b/test/unit/bxml/test_ring.py index 1358b878..613fc71c 100644 --- a/test/unit/bxml/test_ring.py +++ b/test/unit/bxml/test_ring.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.ring import Ring +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml.verbs.ring import Ring class TestRing(unittest.TestCase): diff --git a/test/unit/bxml/test_send_dtmf.py b/test/unit/bxml/test_send_dtmf.py index c362a3eb..ebe51035 100644 --- a/test/unit/bxml/test_send_dtmf.py +++ b/test/unit/bxml/test_send_dtmf.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.send_dtmf import SendDtmf +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml.verbs.send_dtmf import SendDtmf class TestSendDtmf(unittest.TestCase): diff --git a/test/unit/bxml/test_sip_uri.py b/test/unit/bxml/test_sip_uri.py index d5409638..f4f78c21 100644 --- a/test/unit/bxml/test_sip_uri.py +++ b/test/unit/bxml/test_sip_uri.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.sip_uri import SipUri +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import SipUri class TestSipUri(unittest.TestCase): diff --git a/test/unit/bxml/test_speak_sentence.py b/test/unit/bxml/test_speak_sentence.py index bd98d31a..eb0a15d5 100644 --- a/test/unit/bxml/test_speak_sentence.py +++ b/test/unit/bxml/test_speak_sentence.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs import SpeakSentence +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import SpeakSentence class TestSpeakSentence(unittest.TestCase): diff --git a/test/unit/bxml/test_start_gather.py b/test/unit/bxml/test_start_gather.py index 2cef1c7e..a4766c1b 100644 --- a/test/unit/bxml/test_start_gather.py +++ b/test/unit/bxml/test_start_gather.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.start_gather import StartGather +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import StartGather class TestStartGather(unittest.TestCase): diff --git a/test/unit/bxml/test_start_recording.py b/test/unit/bxml/test_start_recording.py index 88e2bd4d..d298fc07 100644 --- a/test/unit/bxml/test_start_recording.py +++ b/test/unit/bxml/test_start_recording.py @@ -5,11 +5,10 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.start_recording import StartRecording +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import StartRecording class TestStartRecording(unittest.TestCase): diff --git a/test/unit/bxml/test_start_stream.py b/test/unit/bxml/test_start_stream.py index 758ba0e5..8f1f3825 100644 --- a/test/unit/bxml/test_start_stream.py +++ b/test/unit/bxml/test_start_stream.py @@ -5,10 +5,9 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verbs import StartStream, StreamParam +from bandwidth.models.bxml import StartStream, StreamParam class TestStartStream(unittest.TestCase): diff --git a/test/unit/bxml/test_stop_gather.py b/test/unit/bxml/test_stop_gather.py index b42637c7..dca837eb 100644 --- a/test/unit/bxml/test_stop_gather.py +++ b/test/unit/bxml/test_stop_gather.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.stop_gather import StopGather +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import StopGather class TestStopGather(unittest.TestCase): diff --git a/test/unit/bxml/test_stop_recording.py b/test/unit/bxml/test_stop_recording.py index 80af056a..57ede215 100644 --- a/test/unit/bxml/test_stop_recording.py +++ b/test/unit/bxml/test_stop_recording.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.stop_recording import StopRecording +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml.verbs.stop_recording import StopRecording class TestStopRecording(unittest.TestCase): diff --git a/test/unit/bxml/test_stop_stream.py b/test/unit/bxml/test_stop_stream.py index 22916c66..93772d08 100644 --- a/test/unit/bxml/test_stop_stream.py +++ b/test/unit/bxml/test_stop_stream.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.stop_stream import StopStream +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import StopStream class TestStopStream(unittest.TestCase): diff --git a/test/unit/bxml/test_stream_param.py b/test/unit/bxml/test_stream_param.py index 277df0c6..1fed11dc 100644 --- a/test/unit/bxml/test_stream_param.py +++ b/test/unit/bxml/test_stream_param.py @@ -8,8 +8,8 @@ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs import StreamParam +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import StreamParam class TestStreamParam(unittest.TestCase): diff --git a/test/unit/bxml/test_tag.py b/test/unit/bxml/test_tag.py index d8fd55cf..32679eee 100644 --- a/test/unit/bxml/test_tag.py +++ b/test/unit/bxml/test_tag.py @@ -7,8 +7,8 @@ """ import unittest -from bandwidth.model.bxml.verb import Verb -from bandwidth.model.bxml.verbs.tag import Tag +from bandwidth.models.bxml import Verb +from bandwidth.models.bxml import Tag class TestTag(unittest.TestCase): diff --git a/test/unit/bxml/test_transfer.py b/test/unit/bxml/test_transfer.py index 80949935..3f5124ef 100644 --- a/test/unit/bxml/test_transfer.py +++ b/test/unit/bxml/test_transfer.py @@ -5,12 +5,11 @@ @copyright Bandwidth Inc. """ -import os import unittest -from bandwidth.model.bxml.verbs.transfer import Transfer -from bandwidth.model.bxml.verbs.phone_number import PhoneNumber -from bandwidth.model.bxml.verbs.sip_uri import SipUri +from bandwidth.models.bxml.verbs.transfer import Transfer +from bandwidth.models.bxml import PhoneNumber +from bandwidth.models.bxml import SipUri class TestTransfer(unittest.TestCase): diff --git a/test/unit/test_account_statistics.py b/test/unit/test_account_statistics.py index 6d05c11d..e7038499 100644 --- a/test/unit/test_account_statistics.py +++ b/test/unit/test_account_statistics.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.account_statistics import AccountStatistics - +from bandwidth.models.account_statistics import AccountStatistics # noqa: E501 +from bandwidth.rest import ApiException class TestAccountStatistics(unittest.TestCase): """AccountStatistics unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test AccountStatistics + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountStatistics` + """ + model = bandwidth.models.account_statistics.AccountStatistics() # noqa: E501 + if include_optional : + return AccountStatistics( + current_call_queue_size = 0, + max_call_queue_size = 900 + ) + else : + return AccountStatistics( + ) + """ + def testAccountStatistics(self): """Test AccountStatistics""" - # FIXME: construct object with mandatory attributes with example values - # model = AccountStatistics() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_answer_callback.py b/test/unit/test_answer_callback.py new file mode 100644 index 00000000..94cb3d04 --- /dev/null +++ b/test/unit/test_answer_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.answer_callback import AnswerCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestAnswerCallback(unittest.TestCase): + """AnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test AnswerCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnswerCallback` + """ + model = bandwidth.models.answer_callback.AnswerCallback() # noqa: E501 + if include_optional : + return AnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else : + return AnswerCallback( + ) + """ + + def testAnswerCallback(self): + """Test AnswerCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_bridge_complete_callback.py b/test/unit/test_bridge_complete_callback.py new file mode 100644 index 00000000..38ca08a1 --- /dev/null +++ b/test/unit/test_bridge_complete_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestBridgeCompleteCallback(unittest.TestCase): + """BridgeCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test BridgeCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BridgeCompleteCallback` + """ + model = bandwidth.models.bridge_complete_callback.BridgeCompleteCallback() # noqa: E501 + if include_optional : + return BridgeCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return BridgeCompleteCallback( + ) + """ + + def testBridgeCompleteCallback(self): + """Test BridgeCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_bridge_target_complete_callback.py b/test/unit/test_bridge_target_complete_callback.py new file mode 100644 index 00000000..7de38d19 --- /dev/null +++ b/test/unit/test_bridge_target_complete_callback.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestBridgeTargetCompleteCallback(unittest.TestCase): + """BridgeTargetCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test BridgeTargetCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BridgeTargetCompleteCallback` + """ + model = bandwidth.models.bridge_target_complete_callback.BridgeTargetCompleteCallback() # noqa: E501 + if include_optional : + return BridgeTargetCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag' + ) + else : + return BridgeTargetCompleteCallback( + ) + """ + + def testBridgeTargetCompleteCallback(self): + """Test BridgeTargetCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_call_callback.py b/test/unit/test_call_callback.py deleted file mode 100644 index 6177e87a..00000000 --- a/test/unit/test_call_callback.py +++ /dev/null @@ -1,40 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import bandwidth -from bandwidth.model.diversion import Diversion -from bandwidth.model.transcription import Transcription -globals()['Diversion'] = Diversion -globals()['Transcription'] = Transcription -from bandwidth.model.call_callback import CallCallback - - -class TestCallCallback(unittest.TestCase): - """CallCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCallCallback(self): - """Test CallCallback""" - # FIXME: construct object with mandatory attributes with example values - # model = CallCallback() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_call_direction_enum.py b/test/unit/test_call_direction_enum.py index 8bd61fdc..7e7c152f 100644 --- a/test/unit/test_call_direction_enum.py +++ b/test/unit/test_call_direction_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.call_direction_enum import CallDirectionEnum - +from bandwidth.models.call_direction_enum import CallDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException class TestCallDirectionEnum(unittest.TestCase): """CallDirectionEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testCallDirectionEnum(self): """Test CallDirectionEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = CallDirectionEnum() # noqa: E501 - pass - + # inst = CallDirectionEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_call_recording_metadata.py b/test/unit/test_call_recording_metadata.py index 3a8b6cf1..6b3e8d9a 100644 --- a/test/unit/test_call_recording_metadata.py +++ b/test/unit/test_call_recording_metadata.py @@ -1,26 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.call_direction_enum import CallDirectionEnum -from bandwidth.model.file_format_enum import FileFormatEnum -from bandwidth.model.transcription_metadata import TranscriptionMetadata -globals()['CallDirectionEnum'] = CallDirectionEnum -globals()['FileFormatEnum'] = FileFormatEnum -globals()['TranscriptionMetadata'] = TranscriptionMetadata -from bandwidth.model.call_recording_metadata import CallRecordingMetadata - +from bandwidth.models.call_recording_metadata import CallRecordingMetadata # noqa: E501 +from bandwidth.rest import ApiException class TestCallRecordingMetadata(unittest.TestCase): """CallRecordingMetadata unit test stubs""" @@ -31,12 +29,48 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CallRecordingMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CallRecordingMetadata` + """ + model = bandwidth.models.call_recording_metadata.CallRecordingMetadata() # noqa: E501 + if include_optional : + return CallRecordingMetadata( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '920012', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + to = '+15555555555', + var_from = '+15555555555', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + duration = 'PT13.67S', + direction = 'inbound', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + transcription = bandwidth.models.transcription_metadata.transcriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', ) + ) + else : + return CallRecordingMetadata( + ) + """ + def testCallRecordingMetadata(self): """Test CallRecordingMetadata""" - # FIXME: construct object with mandatory attributes with example values - # model = CallRecordingMetadata() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_call_state.py b/test/unit/test_call_state.py index e4cd1901..a0bb02d5 100644 --- a/test/unit/test_call_state.py +++ b/test/unit/test_call_state.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.call_direction_enum import CallDirectionEnum -globals()['CallDirectionEnum'] = CallDirectionEnum -from bandwidth.model.call_state import CallState - +from bandwidth.models.call_state import CallState # noqa: E501 +from bandwidth.rest import ApiException class TestCallState(unittest.TestCase): """CallState unit test stubs""" @@ -27,12 +29,44 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CallState + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CallState` + """ + model = bandwidth.models.call_state.CallState() # noqa: E501 + if include_optional : + return CallState( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '19195554321', + direction = 'inbound', + state = 'disconnected', + stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, + identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken', + enqueued_time = '2022-06-16T13:15:07.160Z', + start_time = '2022-06-16T13:15:07.160Z', + answer_time = '2022-06-16T13:15:18.126Z', + end_time = '2022-06-16T13:15:18.314Z', + disconnect_cause = '', + error_message = '', + error_id = '', + last_update = '2022-06-16T13:15:18.314Z' + ) + else : + return CallState( + ) + """ + def testCallState(self): """Test CallState""" - # FIXME: construct object with mandatory attributes with example values - # model = CallState() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_call_state_enum.py b/test/unit/test_call_state_enum.py index a9079c54..e4eb0653 100644 --- a/test/unit/test_call_state_enum.py +++ b/test/unit/test_call_state_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.call_state_enum import CallStateEnum - +from bandwidth.models.call_state_enum import CallStateEnum # noqa: E501 +from bandwidth.rest import ApiException class TestCallStateEnum(unittest.TestCase): """CallStateEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testCallStateEnum(self): """Test CallStateEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = CallStateEnum() # noqa: E501 - pass - + # inst = CallStateEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_callback_method_enum.py b/test/unit/test_callback_method_enum.py index ba9ab4d9..a91471a3 100644 --- a/test/unit/test_callback_method_enum.py +++ b/test/unit/test_callback_method_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum - +from bandwidth.models.callback_method_enum import CallbackMethodEnum # noqa: E501 +from bandwidth.rest import ApiException class TestCallbackMethodEnum(unittest.TestCase): """CallbackMethodEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testCallbackMethodEnum(self): """Test CallbackMethodEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = CallbackMethodEnum() # noqa: E501 - pass - + # inst = CallbackMethodEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_calls_api.py b/test/unit/test_calls_api.py index 23b5a76f..09019c0b 100644 --- a/test/unit/test_calls_api.py +++ b/test/unit/test_calls_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.calls_api import CallsApi # noqa: E501 +from bandwidth.rest import ApiException class TestCallsApi(unittest.TestCase): """CallsApi unit test stubs""" def setUp(self): - self.api = CallsApi() # noqa: E501 + self.api = bandwidth.api.calls_api.CallsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_code_request.py b/test/unit/test_code_request.py index e17ada3d..9df98c86 100644 --- a/test/unit/test_code_request.py +++ b/test/unit/test_code_request.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.code_request import CodeRequest - +from bandwidth.models.code_request import CodeRequest # noqa: E501 +from bandwidth.rest import ApiException class TestCodeRequest(unittest.TestCase): """CodeRequest unit test stubs""" @@ -25,12 +29,37 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CodeRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CodeRequest` + """ + model = bandwidth.models.code_request.CodeRequest() # noqa: E501 + if include_optional : + return CodeRequest( + to = '+19195551234', + var_from = '+19195554321', + application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', + scope = '2FA', + message = 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits = 6 + ) + else : + return CodeRequest( + to = '+19195551234', + var_from = '+19195554321', + application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', + message = 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits = 6, + ) + """ + def testCodeRequest(self): """Test CodeRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = CodeRequest() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference.py b/test/unit/test_conference.py index c95662de..2e83f298 100644 --- a/test/unit/test_conference.py +++ b/test/unit/test_conference.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum -from bandwidth.model.conference_member import ConferenceMember -globals()['CallbackMethodEnum'] = CallbackMethodEnum -globals()['ConferenceMember'] = ConferenceMember -from bandwidth.model.conference import Conference - +from bandwidth.models.conference import Conference # noqa: E501 +from bandwidth.rest import ApiException class TestConference(unittest.TestCase): """Conference unit test stubs""" @@ -29,12 +29,42 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Conference + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Conference` + """ + model = bandwidth.models.conference.Conference() # noqa: E501 + if include_optional : + return Conference( + id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + created_time = '2022-06-17T22:19:40.375Z', + completed_time = '2022-06-17T22:20Z', + conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent', + conference_event_method = 'POST', + tag = 'my custom tag', + active_members = [ + bandwidth.models.conference_member.conferenceMember( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], ) + ] + ) + else : + return Conference( + ) + """ + def testConference(self): """Test Conference""" - # FIXME: construct object with mandatory attributes with example values - # model = Conference() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_callback.py b/test/unit/test_conference_callback.py deleted file mode 100644 index bfd9cd16..00000000 --- a/test/unit/test_conference_callback.py +++ /dev/null @@ -1,36 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import bandwidth -from bandwidth.model.conference_callback import ConferenceCallback - - -class TestConferenceCallback(unittest.TestCase): - """ConferenceCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testConferenceCallback(self): - """Test ConferenceCallback""" - # FIXME: construct object with mandatory attributes with example values - # model = ConferenceCallback() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference_completed_callback.py b/test/unit/test_conference_completed_callback.py new file mode 100644 index 00000000..7b4be3bc --- /dev/null +++ b/test/unit/test_conference_completed_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceCompletedCallback(unittest.TestCase): + """ConferenceCompletedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceCompletedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceCompletedCallback` + """ + model = bandwidth.models.conference_completed_callback.ConferenceCompletedCallback() # noqa: E501 + if include_optional : + return ConferenceCompletedCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceCompletedCallback( + ) + """ + + def testConferenceCompletedCallback(self): + """Test ConferenceCompletedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_created_callback.py b/test/unit/test_conference_created_callback.py new file mode 100644 index 00000000..af7eff5b --- /dev/null +++ b/test/unit/test_conference_created_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceCreatedCallback(unittest.TestCase): + """ConferenceCreatedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceCreatedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceCreatedCallback` + """ + model = bandwidth.models.conference_created_callback.ConferenceCreatedCallback() # noqa: E501 + if include_optional : + return ConferenceCreatedCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceCreatedCallback( + ) + """ + + def testConferenceCreatedCallback(self): + """Test ConferenceCreatedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_member.py b/test/unit/test_conference_member.py index 54344fb4..51222320 100644 --- a/test/unit/test_conference_member.py +++ b/test/unit/test_conference_member.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.conference_member import ConferenceMember - +from bandwidth.models.conference_member import ConferenceMember # noqa: E501 +from bandwidth.rest import ApiException class TestConferenceMember(unittest.TestCase): """ConferenceMember unit test stubs""" @@ -25,12 +29,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test ConferenceMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMember` + """ + model = bandwidth.models.conference_member.ConferenceMember() # noqa: E501 + if include_optional : + return ConferenceMember( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] + ) + else : + return ConferenceMember( + ) + """ + def testConferenceMember(self): """Test ConferenceMember""" - # FIXME: construct object with mandatory attributes with example values - # model = ConferenceMember() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_member_exit_callback.py b/test/unit/test_conference_member_exit_callback.py new file mode 100644 index 00000000..879b1f4e --- /dev/null +++ b/test/unit/test_conference_member_exit_callback.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceMemberExitCallback(unittest.TestCase): + """ConferenceMemberExitCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceMemberExitCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMemberExitCallback` + """ + model = bandwidth.models.conference_member_exit_callback.ConferenceMemberExitCallback() # noqa: E501 + if include_optional : + return ConferenceMemberExitCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else : + return ConferenceMemberExitCallback( + ) + """ + + def testConferenceMemberExitCallback(self): + """Test ConferenceMemberExitCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_member_join_callback.py b/test/unit/test_conference_member_join_callback.py new file mode 100644 index 00000000..be466717 --- /dev/null +++ b/test/unit/test_conference_member_join_callback.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceMemberJoinCallback(unittest.TestCase): + """ConferenceMemberJoinCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceMemberJoinCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceMemberJoinCallback` + """ + model = bandwidth.models.conference_member_join_callback.ConferenceMemberJoinCallback() # noqa: E501 + if include_optional : + return ConferenceMemberJoinCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else : + return ConferenceMemberJoinCallback( + ) + """ + + def testConferenceMemberJoinCallback(self): + """Test ConferenceMemberJoinCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_recording_available_callback.py b/test/unit/test_conference_recording_available_callback.py new file mode 100644 index 00000000..91de9b94 --- /dev/null +++ b/test/unit/test_conference_recording_available_callback.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceRecordingAvailableCallback(unittest.TestCase): + """ConferenceRecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceRecordingAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRecordingAvailableCallback` + """ + model = bandwidth.models.conference_recording_available_callback.ConferenceRecordingAvailableCallback() # noqa: E501 + if include_optional : + return ConferenceRecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + account_id = '920012', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + tag = 'exampleTag', + status = 'completed' + ) + else : + return ConferenceRecordingAvailableCallback( + ) + """ + + def testConferenceRecordingAvailableCallback(self): + """Test ConferenceRecordingAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_recording_metadata.py b/test/unit/test_conference_recording_metadata.py index 7ce51745..0538c7d2 100644 --- a/test/unit/test_conference_recording_metadata.py +++ b/test/unit/test_conference_recording_metadata.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.file_format_enum import FileFormatEnum -globals()['FileFormatEnum'] = FileFormatEnum -from bandwidth.model.conference_recording_metadata import ConferenceRecordingMetadata - +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata # noqa: E501 +from bandwidth.rest import ApiException class TestConferenceRecordingMetadata(unittest.TestCase): """ConferenceRecordingMetadata unit test stubs""" @@ -27,12 +29,37 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test ConferenceRecordingMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRecordingMetadata` + """ + model = bandwidth.models.conference_recording_metadata.ConferenceRecordingMetadata() # noqa: E501 + if include_optional : + return ConferenceRecordingMetadata( + account_id = '920012', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + duration = 'PT13.67S', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + ) + else : + return ConferenceRecordingMetadata( + ) + """ + def testConferenceRecordingMetadata(self): """Test ConferenceRecordingMetadata""" - # FIXME: construct object with mandatory attributes with example values - # model = ConferenceRecordingMetadata() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_redirect_callback.py b/test/unit/test_conference_redirect_callback.py new file mode 100644 index 00000000..4edd30dd --- /dev/null +++ b/test/unit/test_conference_redirect_callback.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestConferenceRedirectCallback(unittest.TestCase): + """ConferenceRedirectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ConferenceRedirectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ConferenceRedirectCallback` + """ + model = bandwidth.models.conference_redirect_callback.ConferenceRedirectCallback() # noqa: E501 + if include_optional : + return ConferenceRedirectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + tag = 'exampleTag' + ) + else : + return ConferenceRedirectCallback( + ) + """ + + def testConferenceRedirectCallback(self): + """Test ConferenceRedirectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_state_enum.py b/test/unit/test_conference_state_enum.py index fd376a61..87caff31 100644 --- a/test/unit/test_conference_state_enum.py +++ b/test/unit/test_conference_state_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.conference_state_enum import ConferenceStateEnum - +from bandwidth.models.conference_state_enum import ConferenceStateEnum # noqa: E501 +from bandwidth.rest import ApiException class TestConferenceStateEnum(unittest.TestCase): """ConferenceStateEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testConferenceStateEnum(self): """Test ConferenceStateEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = ConferenceStateEnum() # noqa: E501 - pass - + # inst = ConferenceStateEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conferences_api.py b/test/unit/test_conferences_api.py index 3e52ed9b..40eed969 100644 --- a/test/unit/test_conferences_api.py +++ b/test/unit/test_conferences_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.conferences_api import ConferencesApi # noqa: E501 +from bandwidth.rest import ApiException class TestConferencesApi(unittest.TestCase): """ConferencesApi unit test stubs""" def setUp(self): - self.api = ConferencesApi() # noqa: E501 + self.api = bandwidth.api.conferences_api.ConferencesApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_create_call.py b/test/unit/test_create_call.py index 4fc34f2b..2aa1ef1b 100644 --- a/test/unit/test_create_call.py +++ b/test/unit/test_create_call.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum -from bandwidth.model.machine_detection_configuration import MachineDetectionConfiguration -globals()['CallbackMethodEnum'] = CallbackMethodEnum -globals()['MachineDetectionConfiguration'] = MachineDetectionConfiguration -from bandwidth.model.create_call import CreateCall - +from bandwidth.models.create_call import CreateCall # noqa: E501 +from bandwidth.rest import ApiException class TestCreateCall(unittest.TestCase): """CreateCall unit test stubs""" @@ -29,12 +29,65 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CreateCall + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCall` + """ + model = bandwidth.models.create_call.CreateCall() # noqa: E501 + if include_optional : + return CreateCall( + to = '+19195551234', + var_from = '+19195554321', + display_name = 'John Doe', + uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + answer_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer', + answer_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect', + disconnect_method = 'POST', + call_timeout = 30, + callback_timeout = 15, + machine_detection = bandwidth.models.machine_detection_configuration.machineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', ), + priority = 5, + tag = 'arbitrary text here' + ) + else : + return CreateCall( + to = '+19195551234', + var_from = '+19195554321', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + ) + """ + def testCreateCall(self): """Test CreateCall""" - # FIXME: construct object with mandatory attributes with example values - # model = CreateCall() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_create_call_response.py b/test/unit/test_create_call_response.py index d20947e2..deeb0bd2 100644 --- a/test/unit/test_create_call_response.py +++ b/test/unit/test_create_call_response.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum -globals()['CallbackMethodEnum'] = CallbackMethodEnum -from bandwidth.model.create_call_response import CreateCallResponse - +from bandwidth.models.create_call_response import CreateCallResponse # noqa: E501 +from bandwidth.rest import ApiException class TestCreateCallResponse(unittest.TestCase): """CreateCallResponse unit test stubs""" @@ -27,12 +29,56 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CreateCallResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCallResponse` + """ + model = bandwidth.models.create_call_response.CreateCallResponse() # noqa: E501 + if include_optional : + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + enqueued_time = '2022-06-16T13:15:07.160Z', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_timeout = 30, + callback_timeout = 15, + tag = 'My custom tag value', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + answer_fallback_method = 'POST', + answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + priority = 5 + ) + else : + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + ) + """ + def testCreateCallResponse(self): """Test CreateCallResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = CreateCallResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_create_lookup_response.py b/test/unit/test_create_lookup_response.py index 959004fb..73081e2a 100644 --- a/test/unit/test_create_lookup_response.py +++ b/test/unit/test_create_lookup_response.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.create_lookup_response import CreateLookupResponse - +from bandwidth.models.create_lookup_response import CreateLookupResponse # noqa: E501 +from bandwidth.rest import ApiException class TestCreateLookupResponse(unittest.TestCase): """CreateLookupResponse unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test CreateLookupResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateLookupResponse` + """ + model = bandwidth.models.create_lookup_response.CreateLookupResponse() # noqa: E501 + if include_optional : + return CreateLookupResponse( + request_id = '', + status = 'COMPLETE' + ) + else : + return CreateLookupResponse( + ) + """ + def testCreateLookupResponse(self): """Test CreateLookupResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = CreateLookupResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_create_message_request_error.py b/test/unit/test_create_message_request_error.py new file mode 100644 index 00000000..031fe199 --- /dev/null +++ b/test/unit/test_create_message_request_error.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.create_message_request_error import CreateMessageRequestError # noqa: E501 +from bandwidth.rest import ApiException + +class TestCreateMessageRequestError(unittest.TestCase): + """CreateMessageRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CreateMessageRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateMessageRequestError` + """ + model = bandwidth.models.create_message_request_error.CreateMessageRequestError() # noqa: E501 + if include_optional : + return CreateMessageRequestError( + type = '', + description = '', + field_errors = [ + bandwidth.models.field_error.fieldError( + field_name = 'from', + description = ''+invalid' must be replaced with a valid E164 formatted telephone number', ) + ] + ) + else : + return CreateMessageRequestError( + type = '', + description = '', + ) + """ + + def testCreateMessageRequestError(self): + """Test CreateMessageRequestError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_deferred_result.py b/test/unit/test_deferred_result.py index 27ddd2de..e9a0fee8 100644 --- a/test/unit/test_deferred_result.py +++ b/test/unit/test_deferred_result.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.deferred_result import DeferredResult - +from bandwidth.models.deferred_result import DeferredResult # noqa: E501 +from bandwidth.rest import ApiException class TestDeferredResult(unittest.TestCase): """DeferredResult unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test DeferredResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeferredResult` + """ + model = bandwidth.models.deferred_result.DeferredResult() # noqa: E501 + if include_optional : + return DeferredResult( + result = None, + set_or_expired = True + ) + else : + return DeferredResult( + ) + """ + def testDeferredResult(self): """Test DeferredResult""" - # FIXME: construct object with mandatory attributes with example values - # model = DeferredResult() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_disconnect_callback.py b/test/unit/test_disconnect_callback.py new file mode 100644 index 00000000..7efc4c10 --- /dev/null +++ b/test/unit/test_disconnect_callback.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.disconnect_callback import DisconnectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestDisconnectCallback(unittest.TestCase): + """DisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DisconnectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DisconnectCallback` + """ + model = bandwidth.models.disconnect_callback.DisconnectCallback() # noqa: E501 + if include_optional : + return DisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765', + tag = 'exampleTag' + ) + else : + return DisconnectCallback( + ) + """ + + def testDisconnectCallback(self): + """Test DisconnectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_diversion.py b/test/unit/test_diversion.py index 11a6094d..6109e693 100644 --- a/test/unit/test_diversion.py +++ b/test/unit/test_diversion.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.diversion import Diversion - +from bandwidth.models.diversion import Diversion # noqa: E501 +from bandwidth.rest import ApiException class TestDiversion(unittest.TestCase): """Diversion unit test stubs""" @@ -25,12 +29,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Diversion + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Diversion` + """ + model = bandwidth.models.diversion.Diversion() # noqa: E501 + if include_optional : + return Diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444' + ) + else : + return Diversion( + ) + """ + def testDiversion(self): """Test Diversion""" - # FIXME: construct object with mandatory attributes with example values - # model = Diversion() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_dtmf_callback.py b/test/unit/test_dtmf_callback.py new file mode 100644 index 00000000..10091a99 --- /dev/null +++ b/test/unit/test_dtmf_callback.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.dtmf_callback import DtmfCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestDtmfCallback(unittest.TestCase): + """DtmfCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test DtmfCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DtmfCallback` + """ + model = bandwidth.models.dtmf_callback.DtmfCallback() # noqa: E501 + if include_optional : + return DtmfCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + digit = '2', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + tag = 'exampleTag' + ) + else : + return DtmfCallback( + ) + """ + + def testDtmfCallback(self): + """Test DtmfCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_field_error.py b/test/unit/test_field_error.py new file mode 100644 index 00000000..77e049c6 --- /dev/null +++ b/test/unit/test_field_error.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.field_error import FieldError # noqa: E501 +from bandwidth.rest import ApiException + +class TestFieldError(unittest.TestCase): + """FieldError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test FieldError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FieldError` + """ + model = bandwidth.models.field_error.FieldError() # noqa: E501 + if include_optional : + return FieldError( + field_name = 'from', + description = ''+invalid' must be replaced with a valid E164 formatted telephone number' + ) + else : + return FieldError( + ) + """ + + def testFieldError(self): + """Test FieldError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_file_format_enum.py b/test/unit/test_file_format_enum.py index d798513d..40cf27e0 100644 --- a/test/unit/test_file_format_enum.py +++ b/test/unit/test_file_format_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.file_format_enum import FileFormatEnum - +from bandwidth.models.file_format_enum import FileFormatEnum # noqa: E501 +from bandwidth.rest import ApiException class TestFileFormatEnum(unittest.TestCase): """FileFormatEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testFileFormatEnum(self): """Test FileFormatEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = FileFormatEnum() # noqa: E501 - pass - + # inst = FileFormatEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_gather_callback.py b/test/unit/test_gather_callback.py new file mode 100644 index 00000000..dae61d55 --- /dev/null +++ b/test/unit/test_gather_callback.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.gather_callback import GatherCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestGatherCallback(unittest.TestCase): + """GatherCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test GatherCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GatherCallback` + """ + model = bandwidth.models.gather_callback.GatherCallback() # noqa: E501 + if include_optional : + return GatherCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + digits = '123', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + terminating_digit = '#', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + tag = 'exampleTag' + ) + else : + return GatherCallback( + ) + """ + + def testGatherCallback(self): + """Test GatherCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_inbound_message_callback.py b/test/unit/test_inbound_message_callback.py new file mode 100644 index 00000000..d0264bc2 --- /dev/null +++ b/test/unit/test_inbound_message_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.inbound_message_callback import InboundMessageCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestInboundMessageCallback(unittest.TestCase): + """InboundMessageCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InboundMessageCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InboundMessageCallback` + """ + model = bandwidth.models.inbound_message_callback.InboundMessageCallback() # noqa: E501 + if include_optional : + return InboundMessageCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return InboundMessageCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testInboundMessageCallback(self): + """Test InboundMessageCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_inbound_message_callback_message.py b/test/unit/test_inbound_message_callback_message.py new file mode 100644 index 00000000..35126e7d --- /dev/null +++ b/test/unit/test_inbound_message_callback_message.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestInboundMessageCallbackMessage(unittest.TestCase): + """InboundMessageCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InboundMessageCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InboundMessageCallbackMessage` + """ + model = bandwidth.models.inbound_message_callback_message.InboundMessageCallbackMessage() # noqa: E501 + if include_optional : + return InboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return InboundMessageCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + ) + """ + + def testInboundMessageCallbackMessage(self): + """Test InboundMessageCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_initiate_callback.py b/test/unit/test_initiate_callback.py new file mode 100644 index 00000000..49014cae --- /dev/null +++ b/test/unit/test_initiate_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.initiate_callback import InitiateCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestInitiateCallback(unittest.TestCase): + """InitiateCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InitiateCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InitiateCallback` + """ + model = bandwidth.models.initiate_callback.InitiateCallback() # noqa: E501 + if include_optional : + return InitiateCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + start_time = '2022-06-17T22:19:40.375Z', + diversion = bandwidth.models.diversion.diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444', ), + stir_shaken = bandwidth.models.stir_shaken.stirShaken( + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', + originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', ) + ) + else : + return InitiateCallback( + ) + """ + + def testInitiateCallback(self): + """Test InitiateCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_list_message_direction_enum.py b/test/unit/test_list_message_direction_enum.py index 58944ae0..72ac6efe 100644 --- a/test/unit/test_list_message_direction_enum.py +++ b/test/unit/test_list_message_direction_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum - +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException class TestListMessageDirectionEnum(unittest.TestCase): """ListMessageDirectionEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testListMessageDirectionEnum(self): """Test ListMessageDirectionEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = ListMessageDirectionEnum() # noqa: E501 - pass - + # inst = ListMessageDirectionEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_list_message_item.py b/test/unit/test_list_message_item.py index 2e56b650..9b549595 100644 --- a/test/unit/test_list_message_item.py +++ b/test/unit/test_list_message_item.py @@ -1,26 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.list_message_direction_enum import ListMessageDirectionEnum -from bandwidth.model.message_status_enum import MessageStatusEnum -from bandwidth.model.message_type_enum import MessageTypeEnum -globals()['ListMessageDirectionEnum'] = ListMessageDirectionEnum -globals()['MessageStatusEnum'] = MessageStatusEnum -globals()['MessageTypeEnum'] = MessageTypeEnum -from bandwidth.model.list_message_item import ListMessageItem - +from bandwidth.models.list_message_item import ListMessageItem # noqa: E501 +from bandwidth.rest import ApiException class TestListMessageItem(unittest.TestCase): """ListMessageItem unit test stubs""" @@ -31,12 +29,43 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test ListMessageItem + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListMessageItem` + """ + model = bandwidth.models.list_message_item.ListMessageItem() # noqa: E501 + if include_optional : + return ListMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK' + ) + else : + return ListMessageItem( + ) + """ + def testListMessageItem(self): """Test ListMessageItem""" - # FIXME: construct object with mandatory attributes with example values - # model = ListMessageItem() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_lookup_request.py b/test/unit/test_lookup_request.py index 93df721c..b9d21bce 100644 --- a/test/unit/test_lookup_request.py +++ b/test/unit/test_lookup_request.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.lookup_request import LookupRequest - +from bandwidth.models.lookup_request import LookupRequest # noqa: E501 +from bandwidth.rest import ApiException class TestLookupRequest(unittest.TestCase): """LookupRequest unit test stubs""" @@ -25,12 +29,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test LookupRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupRequest` + """ + model = bandwidth.models.lookup_request.LookupRequest() # noqa: E501 + if include_optional : + return LookupRequest( + tns = [ + '' + ] + ) + else : + return LookupRequest( + tns = [ + '' + ], + ) + """ + def testLookupRequest(self): """Test LookupRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = LookupRequest() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_lookup_result.py b/test/unit/test_lookup_result.py new file mode 100644 index 00000000..38fd0a33 --- /dev/null +++ b/test/unit/test_lookup_result.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.lookup_result import LookupResult # noqa: E501 +from bandwidth.rest import ApiException + +class TestLookupResult(unittest.TestCase): + """LookupResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LookupResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupResult` + """ + model = bandwidth.models.lookup_result.LookupResult() # noqa: E501 + if include_optional : + return LookupResult( + response_code = 0, + message = 'NOERROR', + e_164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010' + ) + else : + return LookupResult( + ) + """ + + def testLookupResult(self): + """Test LookupResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_lookup_status.py b/test/unit/test_lookup_status.py index 5ea33d3a..8be65daf 100644 --- a/test/unit/test_lookup_status.py +++ b/test/unit/test_lookup_status.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.lookup_status_enum import LookupStatusEnum -from bandwidth.model.lookup_status_result_inner import LookupStatusResultInner -globals()['LookupStatusEnum'] = LookupStatusEnum -globals()['LookupStatusResultInner'] = LookupStatusResultInner -from bandwidth.model.lookup_status import LookupStatus - +from bandwidth.models.lookup_status import LookupStatus # noqa: E501 +from bandwidth.rest import ApiException class TestLookupStatus(unittest.TestCase): """LookupStatus unit test stubs""" @@ -29,12 +29,41 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test LookupStatus + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LookupStatus` + """ + model = bandwidth.models.lookup_status.LookupStatus() # noqa: E501 + if include_optional : + return LookupStatus( + request_id = '004223a0-8b17-41b1-bf81-20732adf5590', + status = 'COMPLETE', + result = [ + bandwidth.models.lookup_result.lookupResult( + response_code = 0, + message = 'NOERROR', + e/164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010', ) + ], + failed_telephone_numbers = ["+191955512345"] + ) + else : + return LookupStatus( + ) + """ + def testLookupStatus(self): """Test LookupStatus""" - # FIXME: construct object with mandatory attributes with example values - # model = LookupStatus() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_lookup_status_enum.py b/test/unit/test_lookup_status_enum.py index e525d99b..abb4208e 100644 --- a/test/unit/test_lookup_status_enum.py +++ b/test/unit/test_lookup_status_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.lookup_status_enum import LookupStatusEnum - +from bandwidth.models.lookup_status_enum import LookupStatusEnum # noqa: E501 +from bandwidth.rest import ApiException class TestLookupStatusEnum(unittest.TestCase): """LookupStatusEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testLookupStatusEnum(self): """Test LookupStatusEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = LookupStatusEnum() # noqa: E501 - pass - + # inst = LookupStatusEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_lookup_status_result_inner.py b/test/unit/test_lookup_status_result_inner.py deleted file mode 100644 index a0cab6c2..00000000 --- a/test/unit/test_lookup_status_result_inner.py +++ /dev/null @@ -1,36 +0,0 @@ -""" - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import bandwidth -from bandwidth.model.lookup_status_result_inner import LookupStatusResultInner - - -class TestLookupStatusResultInner(unittest.TestCase): - """LookupStatusResultInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLookupStatusResultInner(self): - """Test LookupStatusResultInner""" - # FIXME: construct object with mandatory attributes with example values - # model = LookupStatusResultInner() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_machine_detection_complete_callback.py b/test/unit/test_machine_detection_complete_callback.py new file mode 100644 index 00000000..f39febb4 --- /dev/null +++ b/test/unit/test_machine_detection_complete_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionCompleteCallback(unittest.TestCase): + """MachineDetectionCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MachineDetectionCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionCompleteCallback` + """ + model = bandwidth.models.machine_detection_complete_callback.MachineDetectionCompleteCallback() # noqa: E501 + if include_optional : + return MachineDetectionCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else : + return MachineDetectionCompleteCallback( + ) + """ + + def testMachineDetectionCompleteCallback(self): + """Test MachineDetectionCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_machine_detection_configuration.py b/test/unit/test_machine_detection_configuration.py index 0fd86014..2bb49ef7 100644 --- a/test/unit/test_machine_detection_configuration.py +++ b/test/unit/test_machine_detection_configuration.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum -from bandwidth.model.machine_detection_mode_enum import MachineDetectionModeEnum -globals()['CallbackMethodEnum'] = CallbackMethodEnum -globals()['MachineDetectionModeEnum'] = MachineDetectionModeEnum -from bandwidth.model.machine_detection_configuration import MachineDetectionConfiguration - +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration # noqa: E501 +from bandwidth.rest import ApiException class TestMachineDetectionConfiguration(unittest.TestCase): """MachineDetectionConfiguration unit test stubs""" @@ -29,12 +29,41 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MachineDetectionConfiguration + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionConfiguration` + """ + model = bandwidth.models.machine_detection_configuration.MachineDetectionConfiguration() # noqa: E501 + if include_optional : + return MachineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else : + return MachineDetectionConfiguration( + ) + """ + def testMachineDetectionConfiguration(self): """Test MachineDetectionConfiguration""" - # FIXME: construct object with mandatory attributes with example values - # model = MachineDetectionConfiguration() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_machine_detection_mode_enum.py b/test/unit/test_machine_detection_mode_enum.py index 81bb1d4c..78928e99 100644 --- a/test/unit/test_machine_detection_mode_enum.py +++ b/test/unit/test_machine_detection_mode_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.machine_detection_mode_enum import MachineDetectionModeEnum - +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum # noqa: E501 +from bandwidth.rest import ApiException class TestMachineDetectionModeEnum(unittest.TestCase): """MachineDetectionModeEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testMachineDetectionModeEnum(self): """Test MachineDetectionModeEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = MachineDetectionModeEnum() # noqa: E501 - pass - + # inst = MachineDetectionModeEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_machine_detection_result.py b/test/unit/test_machine_detection_result.py new file mode 100644 index 00000000..845d3360 --- /dev/null +++ b/test/unit/test_machine_detection_result.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.machine_detection_result import MachineDetectionResult # noqa: E501 +from bandwidth.rest import ApiException + +class TestMachineDetectionResult(unittest.TestCase): + """MachineDetectionResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MachineDetectionResult + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MachineDetectionResult` + """ + model = bandwidth.models.machine_detection_result.MachineDetectionResult() # noqa: E501 + if include_optional : + return MachineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S' + ) + else : + return MachineDetectionResult( + ) + """ + + def testMachineDetectionResult(self): + """Test MachineDetectionResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_media.py b/test/unit/test_media.py index a95380c0..62011240 100644 --- a/test/unit/test_media.py +++ b/test/unit/test_media.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.media import Media - +from bandwidth.models.media import Media # noqa: E501 +from bandwidth.rest import ApiException class TestMedia(unittest.TestCase): """Media unit test stubs""" @@ -25,12 +29,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Media + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Media` + """ + model = bandwidth.models.media.Media() # noqa: E501 + if include_optional : + return Media( + content = '', + content_length = 56, + media_name = '' + ) + else : + return Media( + ) + """ + def testMedia(self): """Test Media""" - # FIXME: construct object with mandatory attributes with example values - # model = Media() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_media_api.py b/test/unit/test_media_api.py index 10907877..2b6ae425 100644 --- a/test/unit/test_media_api.py +++ b/test/unit/test_media_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.media_api import MediaApi # noqa: E501 +from bandwidth.rest import ApiException class TestMediaApi(unittest.TestCase): """MediaApi unit test stubs""" def setUp(self): - self.api = MediaApi() # noqa: E501 + self.api = bandwidth.api.media_api.MediaApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_message.py b/test/unit/test_message.py index 12f87686..b441fda4 100644 --- a/test/unit/test_message.py +++ b/test/unit/test_message.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.message_direction_enum import MessageDirectionEnum -from bandwidth.model.priority_enum import PriorityEnum -globals()['MessageDirectionEnum'] = MessageDirectionEnum -globals()['PriorityEnum'] = PriorityEnum -from bandwidth.model.message import Message - +from bandwidth.models.message import Message # noqa: E501 +from bandwidth.rest import ApiException class TestMessage(unittest.TestCase): """Message unit test stubs""" @@ -29,12 +29,39 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Message + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Message` + """ + model = bandwidth.models.message.Message() # noqa: E501 + if include_optional : + return Message( + id = '1589228074636lm4k2je7j7jklbn2', + owner = '+15554443333', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2022-09-14T18:20:16Z', + segment_count = 2, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"], + text = 'Hello world', + tag = 'custom tag', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else : + return Message( + ) + """ + def testMessage(self): """Test Message""" - # FIXME: construct object with mandatory attributes with example values - # model = Message() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_delivered_callback.py b/test/unit/test_message_delivered_callback.py new file mode 100644 index 00000000..28a9f494 --- /dev/null +++ b/test/unit/test_message_delivered_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageDeliveredCallback(unittest.TestCase): + """MessageDeliveredCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageDeliveredCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageDeliveredCallback` + """ + model = bandwidth.models.message_delivered_callback.MessageDeliveredCallback() # noqa: E501 + if include_optional : + return MessageDeliveredCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return MessageDeliveredCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testMessageDeliveredCallback(self): + """Test MessageDeliveredCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_delivered_callback_message.py b/test/unit/test_message_delivered_callback_message.py new file mode 100644 index 00000000..b7b31569 --- /dev/null +++ b/test/unit/test_message_delivered_callback_message.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageDeliveredCallbackMessage(unittest.TestCase): + """MessageDeliveredCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageDeliveredCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageDeliveredCallbackMessage` + """ + model = bandwidth.models.message_delivered_callback_message.MessageDeliveredCallbackMessage() # noqa: E501 + if include_optional : + return MessageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageDeliveredCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + ) + """ + + def testMessageDeliveredCallbackMessage(self): + """Test MessageDeliveredCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_direction_enum.py b/test/unit/test_message_direction_enum.py index 152eb83a..d29a5719 100644 --- a/test/unit/test_message_direction_enum.py +++ b/test/unit/test_message_direction_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.message_direction_enum import MessageDirectionEnum - +from bandwidth.models.message_direction_enum import MessageDirectionEnum # noqa: E501 +from bandwidth.rest import ApiException class TestMessageDirectionEnum(unittest.TestCase): """MessageDirectionEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testMessageDirectionEnum(self): """Test MessageDirectionEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = MessageDirectionEnum() # noqa: E501 - pass - + # inst = MessageDirectionEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_failed_callback.py b/test/unit/test_message_failed_callback.py new file mode 100644 index 00000000..08699c8b --- /dev/null +++ b/test/unit/test_message_failed_callback.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_failed_callback import MessageFailedCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageFailedCallback(unittest.TestCase): + """MessageFailedCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageFailedCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageFailedCallback` + """ + model = bandwidth.models.message_failed_callback.MessageFailedCallback() # noqa: E501 + if include_optional : + return MessageFailedCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-failed', + to = '+15552223333', + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + error_code = 9902 + ) + else : + return MessageFailedCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-failed', + to = '+15552223333', + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + error_code = 9902, + ) + """ + + def testMessageFailedCallback(self): + """Test MessageFailedCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_failed_callback_message.py b/test/unit/test_message_failed_callback_message.py new file mode 100644 index 00000000..71c42fb5 --- /dev/null +++ b/test/unit/test_message_failed_callback_message.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageFailedCallbackMessage(unittest.TestCase): + """MessageFailedCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageFailedCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageFailedCallbackMessage` + """ + model = bandwidth.models.message_failed_callback_message.MessageFailedCallbackMessage() # noqa: E501 + if include_optional : + return MessageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageFailedCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + priority = 'default', + ) + """ + + def testMessageFailedCallbackMessage(self): + """Test MessageFailedCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_request.py b/test/unit/test_message_request.py index 6816f670..950d437a 100644 --- a/test/unit/test_message_request.py +++ b/test/unit/test_message_request.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.priority_enum import PriorityEnum -globals()['PriorityEnum'] = PriorityEnum -from bandwidth.model.message_request import MessageRequest - +from bandwidth.models.message_request import MessageRequest # noqa: E501 +from bandwidth.rest import ApiException class TestMessageRequest(unittest.TestCase): """MessageRequest unit test stubs""" @@ -27,12 +29,37 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MessageRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageRequest` + """ + model = bandwidth.models.message_request.MessageRequest() # noqa: E501 + if include_optional : + return MessageRequest( + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + to = ["+15554443333","+15552223333"], + var_from = '+15551113333', + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + tag = 'custom string', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else : + return MessageRequest( + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + to = ["+15554443333","+15552223333"], + var_from = '+15551113333', + ) + """ + def testMessageRequest(self): """Test MessageRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = MessageRequest() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_sending_callback.py b/test/unit/test_message_sending_callback.py new file mode 100644 index 00000000..b2ab77f3 --- /dev/null +++ b/test/unit/test_message_sending_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_sending_callback import MessageSendingCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageSendingCallback(unittest.TestCase): + """MessageSendingCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageSendingCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageSendingCallback` + """ + model = bandwidth.models.message_sending_callback.MessageSendingCallback() # noqa: E501 + if include_optional : + return MessageSendingCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-sending', + to = '+15552223333', + description = 'Message is sending to carrier', + message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ) + ) + else : + return MessageSendingCallback( + time = '2016-09-14T18:20:16Z', + type = 'message-sending', + to = '+15552223333', + description = 'Message is sending to carrier', + message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', ), + ) + """ + + def testMessageSendingCallback(self): + """Test MessageSendingCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_sending_callback_message.py b/test/unit/test_message_sending_callback_message.py new file mode 100644 index 00000000..9899720f --- /dev/null +++ b/test/unit/test_message_sending_callback_message.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage # noqa: E501 +from bandwidth.rest import ApiException + +class TestMessageSendingCallbackMessage(unittest.TestCase): + """MessageSendingCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test MessageSendingCallbackMessage + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessageSendingCallbackMessage` + """ + model = bandwidth.models.message_sending_callback_message.MessageSendingCallbackMessage() # noqa: E501 + if include_optional : + return MessageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default' + ) + else : + return MessageSendingCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + priority = 'default', + ) + """ + + def testMessageSendingCallbackMessage(self): + """Test MessageSendingCallbackMessage""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_status_enum.py b/test/unit/test_message_status_enum.py index 69448596..91d85764 100644 --- a/test/unit/test_message_status_enum.py +++ b/test/unit/test_message_status_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.message_status_enum import MessageStatusEnum - +from bandwidth.models.message_status_enum import MessageStatusEnum # noqa: E501 +from bandwidth.rest import ApiException class TestMessageStatusEnum(unittest.TestCase): """MessageStatusEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testMessageStatusEnum(self): """Test MessageStatusEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = MessageStatusEnum() # noqa: E501 - pass - + # inst = MessageStatusEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_type_enum.py b/test/unit/test_message_type_enum.py index 40bd8d84..05699d58 100644 --- a/test/unit/test_message_type_enum.py +++ b/test/unit/test_message_type_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.message_type_enum import MessageTypeEnum - +from bandwidth.models.message_type_enum import MessageTypeEnum # noqa: E501 +from bandwidth.rest import ApiException class TestMessageTypeEnum(unittest.TestCase): """MessageTypeEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testMessageTypeEnum(self): """Test MessageTypeEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = MessageTypeEnum() # noqa: E501 - pass - + # inst = MessageTypeEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_messages_api.py b/test/unit/test_messages_api.py index 9f9cca47..17f59e9a 100644 --- a/test/unit/test_messages_api.py +++ b/test/unit/test_messages_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.messages_api import MessagesApi # noqa: E501 +from bandwidth.rest import ApiException class TestMessagesApi(unittest.TestCase): """MessagesApi unit test stubs""" def setUp(self): - self.api = MessagesApi() # noqa: E501 + self.api = bandwidth.api.messages_api.MessagesApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_messages_list.py b/test/unit/test_messages_list.py index 2b02288e..f2a556db 100644 --- a/test/unit/test_messages_list.py +++ b/test/unit/test_messages_list.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.list_message_item import ListMessageItem -from bandwidth.model.page_info import PageInfo -globals()['ListMessageItem'] = ListMessageItem -globals()['PageInfo'] = PageInfo -from bandwidth.model.messages_list import MessagesList - +from bandwidth.models.messages_list import MessagesList # noqa: E501 +from bandwidth.rest import ApiException class TestMessagesList(unittest.TestCase): """MessagesList unit test stubs""" @@ -29,12 +29,52 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MessagesList + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagesList` + """ + model = bandwidth.models.messages_list.MessagesList() # noqa: E501 + if include_optional : + return MessagesList( + total_count = 100, + page_info = bandwidth.models.page_info.PageInfo( + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', + next_page_token = 'GL83PD3C', ), + messages = [ + bandwidth.models.list_message_item.listMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK', ) + ] + ) + else : + return MessagesList( + ) + """ + def testMessagesList(self): """Test MessagesList""" - # FIXME: construct object with mandatory attributes with example values - # model = MessagesList() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_messaging_code_response.py b/test/unit/test_messaging_code_response.py index 39dff1a4..53578365 100644 --- a/test/unit/test_messaging_code_response.py +++ b/test/unit/test_messaging_code_response.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.messaging_code_response import MessagingCodeResponse - +from bandwidth.models.messaging_code_response import MessagingCodeResponse # noqa: E501 +from bandwidth.rest import ApiException class TestMessagingCodeResponse(unittest.TestCase): """MessagingCodeResponse unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MessagingCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagingCodeResponse` + """ + model = bandwidth.models.messaging_code_response.MessagingCodeResponse() # noqa: E501 + if include_optional : + return MessagingCodeResponse( + message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' + ) + else : + return MessagingCodeResponse( + ) + """ + def testMessagingCodeResponse(self): """Test MessagingCodeResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = MessagingCodeResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_messaging_request_error.py b/test/unit/test_messaging_request_error.py index 60cfcb9c..ec14fc51 100644 --- a/test/unit/test_messaging_request_error.py +++ b/test/unit/test_messaging_request_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.messaging_request_error import MessagingRequestError - +from bandwidth.models.messaging_request_error import MessagingRequestError # noqa: E501 +from bandwidth.rest import ApiException class TestMessagingRequestError(unittest.TestCase): """MessagingRequestError unit test stubs""" @@ -25,12 +29,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MessagingRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MessagingRequestError` + """ + model = bandwidth.models.messaging_request_error.MessagingRequestError() # noqa: E501 + if include_optional : + return MessagingRequestError( + type = '', + description = '' + ) + else : + return MessagingRequestError( + type = '', + description = '', + ) + """ + def testMessagingRequestError(self): """Test MessagingRequestError""" - # FIXME: construct object with mandatory attributes with example values - # model = MessagingRequestError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_api.py b/test/unit/test_mfa_api.py index 892d60d3..7559e2d8 100644 --- a/test/unit/test_mfa_api.py +++ b/test/unit/test_mfa_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.mfa_api import MFAApi # noqa: E501 +from bandwidth.rest import ApiException class TestMFAApi(unittest.TestCase): """MFAApi unit test stubs""" def setUp(self): - self.api = MFAApi() # noqa: E501 + self.api = bandwidth.api.mfa_api.MFAApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_mfa_forbidden_request_error.py b/test/unit/test_mfa_forbidden_request_error.py index 137b8016..5a754be2 100644 --- a/test/unit/test_mfa_forbidden_request_error.py +++ b/test/unit/test_mfa_forbidden_request_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.mfa_forbidden_request_error import MfaForbiddenRequestError - +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError # noqa: E501 +from bandwidth.rest import ApiException class TestMfaForbiddenRequestError(unittest.TestCase): """MfaForbiddenRequestError unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MfaForbiddenRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaForbiddenRequestError` + """ + model = bandwidth.models.mfa_forbidden_request_error.MfaForbiddenRequestError() # noqa: E501 + if include_optional : + return MfaForbiddenRequestError( + message = 'Missing Authentication Token' + ) + else : + return MfaForbiddenRequestError( + ) + """ + def testMfaForbiddenRequestError(self): """Test MfaForbiddenRequestError""" - # FIXME: construct object with mandatory attributes with example values - # model = MfaForbiddenRequestError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_request_error.py b/test/unit/test_mfa_request_error.py index 18200387..2e5423b9 100644 --- a/test/unit/test_mfa_request_error.py +++ b/test/unit/test_mfa_request_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.mfa_request_error import MfaRequestError - +from bandwidth.models.mfa_request_error import MfaRequestError # noqa: E501 +from bandwidth.rest import ApiException class TestMfaRequestError(unittest.TestCase): """MfaRequestError unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MfaRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaRequestError` + """ + model = bandwidth.models.mfa_request_error.MfaRequestError() # noqa: E501 + if include_optional : + return MfaRequestError( + error = '400 Request is malformed or invalid', + request_id = '354cc8a3-6701-461e-8fa7-8671703dd898' + ) + else : + return MfaRequestError( + ) + """ + def testMfaRequestError(self): """Test MfaRequestError""" - # FIXME: construct object with mandatory attributes with example values - # model = MfaRequestError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_unauthorized_request_error.py b/test/unit/test_mfa_unauthorized_request_error.py index 1ab14041..c6e719ce 100644 --- a/test/unit/test_mfa_unauthorized_request_error.py +++ b/test/unit/test_mfa_unauthorized_request_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.mfa_unauthorized_request_error import MfaUnauthorizedRequestError - +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError # noqa: E501 +from bandwidth.rest import ApiException class TestMfaUnauthorizedRequestError(unittest.TestCase): """MfaUnauthorizedRequestError unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MfaUnauthorizedRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MfaUnauthorizedRequestError` + """ + model = bandwidth.models.mfa_unauthorized_request_error.MfaUnauthorizedRequestError() # noqa: E501 + if include_optional : + return MfaUnauthorizedRequestError( + message = 'Unauthorized' + ) + else : + return MfaUnauthorizedRequestError( + ) + """ + def testMfaUnauthorizedRequestError(self): """Test MfaUnauthorizedRequestError""" - # FIXME: construct object with mandatory attributes with example values - # model = MfaUnauthorizedRequestError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_page_info.py b/test/unit/test_page_info.py index 1ec2b17a..07dc573a 100644 --- a/test/unit/test_page_info.py +++ b/test/unit/test_page_info.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.page_info import PageInfo - +from bandwidth.models.page_info import PageInfo # noqa: E501 +from bandwidth.rest import ApiException class TestPageInfo(unittest.TestCase): """PageInfo unit test stubs""" @@ -25,12 +29,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test PageInfo + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageInfo` + """ + model = bandwidth.models.page_info.PageInfo() # noqa: E501 + if include_optional : + return PageInfo( + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', + next_page_token = 'GL83PD3C' + ) + else : + return PageInfo( + ) + """ + def testPageInfo(self): """Test PageInfo""" - # FIXME: construct object with mandatory attributes with example values - # model = PageInfo() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_phone_number_lookup_api.py b/test/unit/test_phone_number_lookup_api.py index 949efe9c..bf70014c 100644 --- a/test/unit/test_phone_number_lookup_api.py +++ b/test/unit/test_phone_number_lookup_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi # noqa: E501 +from bandwidth.rest import ApiException class TestPhoneNumberLookupApi(unittest.TestCase): """PhoneNumberLookupApi unit test stubs""" def setUp(self): - self.api = PhoneNumberLookupApi() # noqa: E501 + self.api = bandwidth.api.phone_number_lookup_api.PhoneNumberLookupApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_priority_enum.py b/test/unit/test_priority_enum.py index ed736c25..6111bb1d 100644 --- a/test/unit/test_priority_enum.py +++ b/test/unit/test_priority_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.priority_enum import PriorityEnum - +from bandwidth.models.priority_enum import PriorityEnum # noqa: E501 +from bandwidth.rest import ApiException class TestPriorityEnum(unittest.TestCase): """PriorityEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testPriorityEnum(self): """Test PriorityEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = PriorityEnum() # noqa: E501 - pass - + # inst = PriorityEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_recording_available_callback.py b/test/unit/test_recording_available_callback.py new file mode 100644 index 00000000..09bc1902 --- /dev/null +++ b/test/unit/test_recording_available_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.recording_available_callback import RecordingAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRecordingAvailableCallback(unittest.TestCase): + """RecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RecordingAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RecordingAvailableCallback` + """ + model = bandwidth.models.recording_available_callback.RecordingAvailableCallback() # noqa: E501 + if include_optional : + return RecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 'completed', + tag = 'exampleTag', + status = 'completed', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RecordingAvailableCallback( + ) + """ + + def testRecordingAvailableCallback(self): + """Test RecordingAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_recording_complete_callback.py b/test/unit/test_recording_complete_callback.py new file mode 100644 index 00000000..c8a4c403 --- /dev/null +++ b/test/unit/test_recording_complete_callback.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRecordingCompleteCallback(unittest.TestCase): + """RecordingCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RecordingCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RecordingCompleteCallback` + """ + model = bandwidth.models.recording_complete_callback.RecordingCompleteCallback() # noqa: E501 + if include_optional : + return RecordingCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 1, + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RecordingCompleteCallback( + ) + """ + + def testRecordingCompleteCallback(self): + """Test RecordingCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_recording_state_enum.py b/test/unit/test_recording_state_enum.py index 6abb67f2..de388697 100644 --- a/test/unit/test_recording_state_enum.py +++ b/test/unit/test_recording_state_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.recording_state_enum import RecordingStateEnum - +from bandwidth.models.recording_state_enum import RecordingStateEnum # noqa: E501 +from bandwidth.rest import ApiException class TestRecordingStateEnum(unittest.TestCase): """RecordingStateEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testRecordingStateEnum(self): """Test RecordingStateEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = RecordingStateEnum() # noqa: E501 - pass - + # inst = RecordingStateEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_recordings_api.py b/test/unit/test_recordings_api.py index 55c1ae42..c0eb20b4 100644 --- a/test/unit/test_recordings_api.py +++ b/test/unit/test_recordings_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.recordings_api import RecordingsApi # noqa: E501 +from bandwidth.rest import ApiException class TestRecordingsApi(unittest.TestCase): """RecordingsApi unit test stubs""" def setUp(self): - self.api = RecordingsApi() # noqa: E501 + self.api = bandwidth.api.recordings_api.RecordingsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_redirect_callback.py b/test/unit/test_redirect_callback.py new file mode 100644 index 00000000..83df0c06 --- /dev/null +++ b/test/unit/test_redirect_callback.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.redirect_callback import RedirectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestRedirectCallback(unittest.TestCase): + """RedirectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test RedirectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RedirectCallback` + """ + model = bandwidth.models.redirect_callback.RedirectCallback() # noqa: E501 + if include_optional : + return RedirectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return RedirectCallback( + ) + """ + + def testRedirectCallback(self): + """Test RedirectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_redirect_method_enum.py b/test/unit/test_redirect_method_enum.py index b0bc9091..b1908a31 100644 --- a/test/unit/test_redirect_method_enum.py +++ b/test/unit/test_redirect_method_enum.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.redirect_method_enum import RedirectMethodEnum - +from bandwidth.models.redirect_method_enum import RedirectMethodEnum # noqa: E501 +from bandwidth.rest import ApiException class TestRedirectMethodEnum(unittest.TestCase): """RedirectMethodEnum unit test stubs""" @@ -27,10 +31,7 @@ def tearDown(self): def testRedirectMethodEnum(self): """Test RedirectMethodEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = RedirectMethodEnum() # noqa: E501 - pass - + # inst = RedirectMethodEnum() if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_statistics_api.py b/test/unit/test_statistics_api.py index 98b8a461..103f3da2 100644 --- a/test/unit/test_statistics_api.py +++ b/test/unit/test_statistics_api.py @@ -1,25 +1,30 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import unittest import bandwidth from bandwidth.api.statistics_api import StatisticsApi # noqa: E501 +from bandwidth.rest import ApiException class TestStatisticsApi(unittest.TestCase): """StatisticsApi unit test stubs""" def setUp(self): - self.api = StatisticsApi() # noqa: E501 + self.api = bandwidth.api.statistics_api.StatisticsApi() # noqa: E501 def tearDown(self): pass diff --git a/test/unit/test_stir_shaken.py b/test/unit/test_stir_shaken.py new file mode 100644 index 00000000..17fff122 --- /dev/null +++ b/test/unit/test_stir_shaken.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.stir_shaken import StirShaken # noqa: E501 +from bandwidth.rest import ApiException + +class TestStirShaken(unittest.TestCase): + """StirShaken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test StirShaken + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StirShaken` + """ + model = bandwidth.models.stir_shaken.StirShaken() # noqa: E501 + if include_optional : + return StirShaken( + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', + originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af' + ) + else : + return StirShaken( + ) + """ + + def testStirShaken(self): + """Test StirShaken""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_tag.py b/test/unit/test_tag.py index 96807329..c773cad7 100644 --- a/test/unit/test_tag.py +++ b/test/unit/test_tag.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.tag import Tag - +from bandwidth.models.tag import Tag # noqa: E501 +from bandwidth.rest import ApiException class TestTag(unittest.TestCase): """Tag unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Tag + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tag` + """ + model = bandwidth.models.tag.Tag() # noqa: E501 + if include_optional : + return Tag( + key = '', + value = '' + ) + else : + return Tag( + ) + """ + def testTag(self): """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = Tag() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_tn_lookup_request_error.py b/test/unit/test_tn_lookup_request_error.py index 42f68659..ae62fa79 100644 --- a/test/unit/test_tn_lookup_request_error.py +++ b/test/unit/test_tn_lookup_request_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.tn_lookup_request_error import TnLookupRequestError - +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError # noqa: E501 +from bandwidth.rest import ApiException class TestTnLookupRequestError(unittest.TestCase): """TnLookupRequestError unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test TnLookupRequestError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TnLookupRequestError` + """ + model = bandwidth.models.tn_lookup_request_error.TnLookupRequestError() # noqa: E501 + if include_optional : + return TnLookupRequestError( + message = 'example error message' + ) + else : + return TnLookupRequestError( + ) + """ + def testTnLookupRequestError(self): """Test TnLookupRequestError""" - # FIXME: construct object with mandatory attributes with example values - # model = TnLookupRequestError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcribe_recording.py b/test/unit/test_transcribe_recording.py index 0923abfc..6bc69901 100644 --- a/test/unit/test_transcribe_recording.py +++ b/test/unit/test_transcribe_recording.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.callback_method_enum import CallbackMethodEnum -globals()['CallbackMethodEnum'] = CallbackMethodEnum -from bandwidth.model.transcribe_recording import TranscribeRecording - +from bandwidth.models.transcribe_recording import TranscribeRecording # noqa: E501 +from bandwidth.rest import ApiException class TestTranscribeRecording(unittest.TestCase): """TranscribeRecording unit test stubs""" @@ -27,12 +29,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test TranscribeRecording + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscribeRecording` + """ + model = bandwidth.models.transcribe_recording.TranscribeRecording() # noqa: E501 + if include_optional : + return TranscribeRecording( + callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + tag = 'exampleTag', + callback_timeout = 5.5, + detect_language = True + ) + else : + return TranscribeRecording( + ) + """ + def testTranscribeRecording(self): """Test TranscribeRecording""" - # FIXME: construct object with mandatory attributes with example values - # model = TranscribeRecording() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcription.py b/test/unit/test_transcription.py index 070d98aa..0913bc68 100644 --- a/test/unit/test_transcription.py +++ b/test/unit/test_transcription.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.transcription import Transcription - +from bandwidth.models.transcription import Transcription # noqa: E501 +from bandwidth.rest import ApiException class TestTranscription(unittest.TestCase): """Transcription unit test stubs""" @@ -25,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Transcription + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Transcription` + """ + model = bandwidth.models.transcription.Transcription() # noqa: E501 + if include_optional : + return Transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9 + ) + else : + return Transcription( + ) + """ + def testTranscription(self): """Test Transcription""" - # FIXME: construct object with mandatory attributes with example values - # model = Transcription() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcription_available_callback.py b/test/unit/test_transcription_available_callback.py new file mode 100644 index 00000000..2cd8ea3e --- /dev/null +++ b/test/unit/test_transcription_available_callback.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTranscriptionAvailableCallback(unittest.TestCase): + """TranscriptionAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TranscriptionAvailableCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionAvailableCallback` + """ + model = bandwidth.models.transcription_available_callback.TranscriptionAvailableCallback() # noqa: E501 + if include_optional : + return TranscriptionAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + tag = 'exampleTag', + transcription = bandwidth.models.transcription.transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ), + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return TranscriptionAvailableCallback( + ) + """ + + def testTranscriptionAvailableCallback(self): + """Test TranscriptionAvailableCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_transcription_list.py b/test/unit/test_transcription_list.py index cf940843..cba18c12 100644 --- a/test/unit/test_transcription_list.py +++ b/test/unit/test_transcription_list.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.transcription import Transcription -globals()['Transcription'] = Transcription -from bandwidth.model.transcription_list import TranscriptionList - +from bandwidth.models.transcription_list import TranscriptionList # noqa: E501 +from bandwidth.rest import ApiException class TestTranscriptionList(unittest.TestCase): """TranscriptionList unit test stubs""" @@ -27,12 +29,31 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test TranscriptionList + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionList` + """ + model = bandwidth.models.transcription_list.TranscriptionList() # noqa: E501 + if include_optional : + return TranscriptionList( + transcripts = [ + bandwidth.models.transcription.transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ) + ] + ) + else : + return TranscriptionList( + ) + """ + def testTranscriptionList(self): """Test TranscriptionList""" - # FIXME: construct object with mandatory attributes with example values - # model = TranscriptionList() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcription_metadata.py b/test/unit/test_transcription_metadata.py index 586b8299..721ecb71 100644 --- a/test/unit/test_transcription_metadata.py +++ b/test/unit/test_transcription_metadata.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.transcription_metadata import TranscriptionMetadata - +from bandwidth.models.transcription_metadata import TranscriptionMetadata # noqa: E501 +from bandwidth.rest import ApiException class TestTranscriptionMetadata(unittest.TestCase): """TranscriptionMetadata unit test stubs""" @@ -25,12 +29,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test TranscriptionMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TranscriptionMetadata` + """ + model = bandwidth.models.transcription_metadata.TranscriptionMetadata() # noqa: E501 + if include_optional : + return TranscriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' + ) + else : + return TranscriptionMetadata( + ) + """ + def testTranscriptionMetadata(self): """Test TranscriptionMetadata""" - # FIXME: construct object with mandatory attributes with example values - # model = TranscriptionMetadata() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transfer_answer_callback.py b/test/unit/test_transfer_answer_callback.py new file mode 100644 index 00000000..b010211f --- /dev/null +++ b/test/unit/test_transfer_answer_callback.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferAnswerCallback(unittest.TestCase): + """TransferAnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferAnswerCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferAnswerCallback` + """ + model = bandwidth.models.transfer_answer_callback.TransferAnswerCallback() # noqa: E501 + if include_optional : + return TransferAnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)' + ) + else : + return TransferAnswerCallback( + ) + """ + + def testTransferAnswerCallback(self): + """Test TransferAnswerCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_transfer_complete_callback.py b/test/unit/test_transfer_complete_callback.py new file mode 100644 index 00000000..70dab471 --- /dev/null +++ b/test/unit/test_transfer_complete_callback.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferCompleteCallback(unittest.TestCase): + """TransferCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferCompleteCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferCompleteCallback` + """ + model = bandwidth.models.transfer_complete_callback.TransferCompleteCallback() # noqa: E501 + if include_optional : + return TransferCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return TransferCompleteCallback( + ) + """ + + def testTransferCompleteCallback(self): + """Test TransferCompleteCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_transfer_disconnect_callback.py b/test/unit/test_transfer_disconnect_callback.py new file mode 100644 index 00000000..5fcf35d6 --- /dev/null +++ b/test/unit/test_transfer_disconnect_callback.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +import bandwidth +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback # noqa: E501 +from bandwidth.rest import ApiException + +class TestTransferDisconnectCallback(unittest.TestCase): + """TransferDisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test TransferDisconnectCallback + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TransferDisconnectCallback` + """ + model = bandwidth.models.transfer_disconnect_callback.TransferDisconnectCallback() # noqa: E501 + if include_optional : + return TransferDisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '920012', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555)', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else : + return TransferDisconnectCallback( + ) + """ + + def testTransferDisconnectCallback(self): + """Test TransferDisconnectCallback""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_update_call.py b/test/unit/test_update_call.py index 66f0c2ab..a9ed57bd 100644 --- a/test/unit/test_update_call.py +++ b/test/unit/test_update_call.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.call_state_enum import CallStateEnum -from bandwidth.model.redirect_method_enum import RedirectMethodEnum -globals()['CallStateEnum'] = CallStateEnum -globals()['RedirectMethodEnum'] = RedirectMethodEnum -from bandwidth.model.update_call import UpdateCall - +from bandwidth.models.update_call import UpdateCall # noqa: E501 +from bandwidth.rest import ApiException class TestUpdateCall(unittest.TestCase): """UpdateCall unit test stubs""" @@ -29,12 +29,36 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test UpdateCall + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCall` + """ + model = bandwidth.models.update_call.UpdateCall() # noqa: E501 + if include_optional : + return UpdateCall( + state = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + tag = 'My Custom Tag' + ) + else : + return UpdateCall( + ) + """ + def testUpdateCall(self): """Test UpdateCall""" - # FIXME: construct object with mandatory attributes with example values - # model = UpdateCall() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_update_call_recording.py b/test/unit/test_update_call_recording.py index 018224e1..a853acac 100644 --- a/test/unit/test_update_call_recording.py +++ b/test/unit/test_update_call_recording.py @@ -1,22 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.recording_state_enum import RecordingStateEnum -globals()['RecordingStateEnum'] = RecordingStateEnum -from bandwidth.model.update_call_recording import UpdateCallRecording - +from bandwidth.models.update_call_recording import UpdateCallRecording # noqa: E501 +from bandwidth.rest import ApiException class TestUpdateCallRecording(unittest.TestCase): """UpdateCallRecording unit test stubs""" @@ -27,12 +29,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test UpdateCallRecording + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCallRecording` + """ + model = bandwidth.models.update_call_recording.UpdateCallRecording() # noqa: E501 + if include_optional : + return UpdateCallRecording( + state = 'paused' + ) + else : + return UpdateCallRecording( + state = 'paused', + ) + """ + def testUpdateCallRecording(self): """Test UpdateCallRecording""" - # FIXME: construct object with mandatory attributes with example values - # model = UpdateCallRecording() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_update_conference.py b/test/unit/test_update_conference.py index 7589500b..ddf8509e 100644 --- a/test/unit/test_update_conference.py +++ b/test/unit/test_update_conference.py @@ -1,24 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.conference_state_enum import ConferenceStateEnum -from bandwidth.model.redirect_method_enum import RedirectMethodEnum -globals()['ConferenceStateEnum'] = ConferenceStateEnum -globals()['RedirectMethodEnum'] = RedirectMethodEnum -from bandwidth.model.update_conference import UpdateConference - +from bandwidth.models.update_conference import UpdateConference # noqa: E501 +from bandwidth.rest import ApiException class TestUpdateConference(unittest.TestCase): """UpdateConference unit test stubs""" @@ -29,12 +29,35 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test UpdateConference + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateConference` + """ + model = bandwidth.models.update_conference.UpdateConference() # noqa: E501 + if include_optional : + return UpdateConference( + status = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else : + return UpdateConference( + ) + """ + def testUpdateConference(self): """Test UpdateConference""" - # FIXME: construct object with mandatory attributes with example values - # model = UpdateConference() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_update_conference_member.py b/test/unit/test_update_conference_member.py index 0c1f0496..0f153ff4 100644 --- a/test/unit/test_update_conference_member.py +++ b/test/unit/test_update_conference_member.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.update_conference_member import UpdateConferenceMember - +from bandwidth.models.update_conference_member import UpdateConferenceMember # noqa: E501 +from bandwidth.rest import ApiException class TestUpdateConferenceMember(unittest.TestCase): """UpdateConferenceMember unit test stubs""" @@ -25,12 +29,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test UpdateConferenceMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateConferenceMember` + """ + model = bandwidth.models.update_conference_member.UpdateConferenceMember() # noqa: E501 + if include_optional : + return UpdateConferenceMember( + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] + ) + else : + return UpdateConferenceMember( + ) + """ + def testUpdateConferenceMember(self): """Test UpdateConferenceMember""" - # FIXME: construct object with mandatory attributes with example values - # model = UpdateConferenceMember() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_verify_code_request.py b/test/unit/test_verify_code_request.py index f5400b91..5cefb99a 100644 --- a/test/unit/test_verify_code_request.py +++ b/test/unit/test_verify_code_request.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.verify_code_request import VerifyCodeRequest - +from bandwidth.models.verify_code_request import VerifyCodeRequest # noqa: E501 +from bandwidth.rest import ApiException class TestVerifyCodeRequest(unittest.TestCase): """VerifyCodeRequest unit test stubs""" @@ -25,12 +29,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test VerifyCodeRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VerifyCodeRequest` + """ + model = bandwidth.models.verify_code_request.VerifyCodeRequest() # noqa: E501 + if include_optional : + return VerifyCodeRequest( + to = '+19195551234', + scope = '2FA', + expiration_time_in_minutes = 3, + code = '123456' + ) + else : + return VerifyCodeRequest( + to = '+19195551234', + expiration_time_in_minutes = 3, + code = '123456', + ) + """ + def testVerifyCodeRequest(self): """Test VerifyCodeRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = VerifyCodeRequest() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_verify_code_response.py b/test/unit/test_verify_code_response.py index 5ebd3c5e..e335d611 100644 --- a/test/unit/test_verify_code_response.py +++ b/test/unit/test_verify_code_response.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.verify_code_response import VerifyCodeResponse - +from bandwidth.models.verify_code_response import VerifyCodeResponse # noqa: E501 +from bandwidth.rest import ApiException class TestVerifyCodeResponse(unittest.TestCase): """VerifyCodeResponse unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test VerifyCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VerifyCodeResponse` + """ + model = bandwidth.models.verify_code_response.VerifyCodeResponse() # noqa: E501 + if include_optional : + return VerifyCodeResponse( + valid = True + ) + else : + return VerifyCodeResponse( + ) + """ + def testVerifyCodeResponse(self): """Test VerifyCodeResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = VerifyCodeResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_voice_api_error.py b/test/unit/test_voice_api_error.py index 26f97946..837b75c6 100644 --- a/test/unit/test_voice_api_error.py +++ b/test/unit/test_voice_api_error.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.voice_api_error import VoiceApiError - +from bandwidth.models.voice_api_error import VoiceApiError # noqa: E501 +from bandwidth.rest import ApiException class TestVoiceApiError(unittest.TestCase): """VoiceApiError unit test stubs""" @@ -25,12 +29,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test VoiceApiError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceApiError` + """ + model = bandwidth.models.voice_api_error.VoiceApiError() # noqa: E501 + if include_optional : + return VoiceApiError( + type = '', + description = '', + id = '' + ) + else : + return VoiceApiError( + ) + """ + def testVoiceApiError(self): """Test VoiceApiError""" - # FIXME: construct object with mandatory attributes with example values - # model = VoiceApiError() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_voice_code_response.py b/test/unit/test_voice_code_response.py index 887040d7..71950960 100644 --- a/test/unit/test_voice_code_response.py +++ b/test/unit/test_voice_code_response.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ Bandwidth - Bandwidth's Communication APIs # noqa: E501 + Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -import sys import unittest +import datetime import bandwidth -from bandwidth.model.voice_code_response import VoiceCodeResponse - +from bandwidth.models.voice_code_response import VoiceCodeResponse # noqa: E501 +from bandwidth.rest import ApiException class TestVoiceCodeResponse(unittest.TestCase): """VoiceCodeResponse unit test stubs""" @@ -25,12 +29,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional): + """Test VoiceCodeResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VoiceCodeResponse` + """ + model = bandwidth.models.voice_code_response.VoiceCodeResponse() # noqa: E501 + if include_optional : + return VoiceCodeResponse( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + ) + else : + return VoiceCodeResponse( + ) + """ + def testVoiceCodeResponse(self): """Test VoiceCodeResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = VoiceCodeResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/utils/call_cleanup.py b/test/utils/call_cleanup.py index d63f38b6..e5ceb56b 100644 --- a/test/utils/call_cleanup.py +++ b/test/utils/call_cleanup.py @@ -1,9 +1,9 @@ import time from bandwidth.exceptions import NotFoundException from test.utils.env_variables import * -from bandwidth.model.call_state import CallState -from bandwidth.model.call_state_enum import CallStateEnum -from bandwidth.model.update_call import UpdateCall +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.update_call import UpdateCall TEST_SLEEP = 3 MAX_RETRIES = 10 From 4bfb4a8d8987bf5a208595190bd1214ce60ab666 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:05:12 -0400 Subject: [PATCH 03/29] Remove autogenerated linter workflow --- .github/workflows/python.yml | 37 ------------------------------------ .openapi-generator-ignore | 1 + 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index f2f0e990..00000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,37 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator. -# URL: https://openapi-generator.tech -# -# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: bandwidth Python package - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 895bb936..818bd90f 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -27,3 +27,4 @@ setup.cfg setup.py #*requirements.txt test/* +.github/workflows/python.yml From b7fb17e57ac204d3f0c8c26cf8403159ca574231 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:11:12 -0400 Subject: [PATCH 04/29] Fix `_from` + test on Python 3.11 --- .github/workflows/test.yaml | 2 +- test/integration/test_calls.py | 8 ++++---- test/integration/test_conferences.py | 2 +- test/integration/test_messages_api.py | 4 ++-- test/integration/test_multi_factor_authentication.py | 6 +++--- test/integration/test_recordings.py | 2 +- test/unit/bxml/test_forward.py | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 15eefefa..54a26ecd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04] - python-version: [3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11"] env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} BW_USERNAME: ${{ secrets.BW_USERNAME }} diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 7b88e884..47872e15 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -55,7 +55,7 @@ def setUp(self): self.account_id = BW_ACCOUNT_ID self.createCallBody = CreateCall( to=USER_NUMBER, - _from=BW_NUMBER, + var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL, answer_method=CallbackMethodEnum("POST"), @@ -89,8 +89,8 @@ def setUp(self): priority=5, tag="tag_example", ) - self.testCallBody = CreateCall(to=USER_NUMBER, _from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) - self.testMantecaCallBody = CreateCall(to=MANTECA_IDLE_NUMBER, _from=MANTECA_ACTIVE_NUMBER, application_id=MANTECA_APPLICATION_ID, answer_url=MANTECA_BASE_URL + "/bxml/pause") + self.testCallBody = CreateCall(to=USER_NUMBER, var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) + self.testMantecaCallBody = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER, application_id=MANTECA_APPLICATION_ID, answer_url=MANTECA_BASE_URL + "/bxml/pause") self.updateStateCompleted = UpdateCall(state=CallStateEnum("completed")) self.testCallId = "Call-Id" self.testBxmlBody = 'This is a test bxml response' @@ -135,7 +135,7 @@ def test_create_call(self): def test_create_call_bad_request(self): """Validate a bad (400) request """ - call_body = CreateCall(to="invalidNumberFormat", _from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) + call_body = CreateCall(to="invalidNumberFormat", var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) with self.assertRaises(ApiException) as context: self.calls_api_instance.create_call(BW_ACCOUNT_ID, call_body, _return_http_data_only=False) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 2b495a8d..9f76b3ba 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -133,7 +133,7 @@ def create_conference(self, answer_url: str) -> Tuple[str, str]: # Get the test id from the response test_id = response.data.decode("utf-8") - call_body = CreateCall(to=MANTECA_IDLE_NUMBER, _from=MANTECA_ACTIVE_NUMBER, + call_body = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER, application_id=MANTECA_APPLICATION_ID, answer_url=answer_url, tag=test_id) create_call_response: CreateCallResponse = self.calls_api_instance.create_call( diff --git a/test/integration/test_messages_api.py b/test/integration/test_messages_api.py index e41eb6e2..ca239e83 100644 --- a/test/integration/test_messages_api.py +++ b/test/integration/test_messages_api.py @@ -60,7 +60,7 @@ def setUp(self): self.message_request = MessageRequest( application_id=self.application_id, to=self.to_number, - _from=self.from_number, + var_from=self.from_number, text=self.text, media=self.media, tag=self.tag, @@ -71,7 +71,7 @@ def setUp(self): self.invalid_message_request = MessageRequest( application_id=self.application_id, to=['+invalid'], - _from='+invalid', + var_from='+invalid', text='', ) diff --git a/test/integration/test_multi_factor_authentication.py b/test/integration/test_multi_factor_authentication.py index a983f16a..df23c22a 100644 --- a/test/integration/test_multi_factor_authentication.py +++ b/test/integration/test_multi_factor_authentication.py @@ -35,7 +35,7 @@ def setUp(self) -> None: self.account_id = BW_ACCOUNT_ID self.messaging_code_request = CodeRequest( to=USER_NUMBER, - _from=BW_NUMBER, + var_from=BW_NUMBER, application_id=BW_MESSAGING_APPLICATION_ID, scope="scope", message="Your temporary {NAME} {SCOPE} code is {CODE}", @@ -43,7 +43,7 @@ def setUp(self) -> None: ) self.voice_code_request = CodeRequest( to=USER_NUMBER, - _from=BW_NUMBER, + var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, scope="scope", message="Your temporary {NAME} {SCOPE} code is {CODE}", @@ -51,7 +51,7 @@ def setUp(self) -> None: ) self.bad_code_request = CodeRequest( to=USER_NUMBER, - _from=BW_NUMBER, + var_from=BW_NUMBER, application_id='not_an_application_id', scope="scope", message="Your temporary {NAME} {SCOPE} code is {CODE}", diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 7b6e494c..652f59dd 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -124,7 +124,7 @@ def create_and_validate_call(self, answer_url: str) -> Tuple[str, str]: test_id = response.data.decode("utf-8") # Make a CreateCall body and assign the appropriate params - call_body = CreateCall(to=MANTECA_IDLE_NUMBER, _from=MANTECA_ACTIVE_NUMBER, + call_body = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER, application_id=MANTECA_APPLICATION_ID, answer_url=answer_url, tag=test_id) # Make the call diff --git a/test/unit/bxml/test_forward.py b/test/unit/bxml/test_forward.py index 17a0d2b1..5f6a80ff 100644 --- a/test/unit/bxml/test_forward.py +++ b/test/unit/bxml/test_forward.py @@ -15,7 +15,7 @@ class TestForward(unittest.TestCase): def setUp(self): self.forward = Forward( to="19195554321", - _from="19195554322", + var_from="19195554322", call_timeout = "15", diversion_treatment="propagate", diversion_reason="away", From 688856842317345beeb73f1acc1640131b990bff Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:29:58 -0400 Subject: [PATCH 05/29] more from stuff --- test/integration/test_calls.py | 2 +- test/integration/test_conferences.py | 2 +- test/integration/test_messages_api.py | 2 +- test/integration/test_recordings.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 47872e15..267d3ed6 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -129,7 +129,7 @@ def test_create_call(self): 'account_id', BW_ACCOUNT_ID, 'application_id', BW_VOICE_APPLICATION_ID, 'to', USER_NUMBER, - '_from', BW_NUMBER + 'var_from', BW_NUMBER )) def test_create_call_bad_request(self): diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 9f76b3ba..5ccfac50 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -144,7 +144,7 @@ def create_conference(self, answer_url: str) -> Tuple[str, str]: 'account_id', BW_ACCOUNT_ID, 'application_id', MANTECA_APPLICATION_ID, 'to', MANTECA_IDLE_NUMBER, - '_from', MANTECA_ACTIVE_NUMBER + 'var_from', MANTECA_ACTIVE_NUMBER )) time.sleep(self.TEST_SLEEP) diff --git a/test/integration/test_messages_api.py b/test/integration/test_messages_api.py index ca239e83..e855513f 100644 --- a/test/integration/test_messages_api.py +++ b/test/integration/test_messages_api.py @@ -86,7 +86,7 @@ def test_create_message(self): assert_that(api_response, has_properties( 'application_id', self.application_id, 'to', self.to_number, - '_from', self.from_number, + 'var_from', self.from_number, 'owner', self.from_number, 'text', self.text, 'media', self.media, diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 652f59dd..03770a0f 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -138,7 +138,7 @@ def create_and_validate_call(self, answer_url: str) -> Tuple[str, str]: 'account_id', BW_ACCOUNT_ID, 'application_id', MANTECA_APPLICATION_ID, 'to', MANTECA_IDLE_NUMBER, - '_from', MANTECA_ACTIVE_NUMBER, + 'var_from', MANTECA_ACTIVE_NUMBER, 'call_url', "https://voice.bandwidth.com/api/v2/accounts/" + \ BW_ACCOUNT_ID + "/calls/" + create_call_response.call_id )) From 3134d00919eb499e9219edaf9f9f1979b45483e5 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:02:05 -0400 Subject: [PATCH 06/29] Update Call Cleanup --- test/utils/call_cleanup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils/call_cleanup.py b/test/utils/call_cleanup.py index e5ceb56b..3fe65491 100644 --- a/test/utils/call_cleanup.py +++ b/test/utils/call_cleanup.py @@ -27,9 +27,9 @@ def callCleanup(self): while (repeat and retries <= MAX_RETRIES): try: get_call_response: CallState = self.calls_api_instance.get_call_state(BW_ACCOUNT_ID, callId, _return_http_data_only=False) - if get_call_response[0].state == 'active': + if get_call_response.state == 'active': self.calls_api_instance.update_call(BW_ACCOUNT_ID, callId, body, _return_http_data_only=False) - elif get_call_response[0].state == 'complete': + elif get_call_response.state == 'complete': self.callIdArray.remove(callId) # We succeeded, break the loop From 47b22880c6532ebad875f97e865c5441997f98af Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:08:45 -0400 Subject: [PATCH 07/29] remove type hint --- test/integration/test_media_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/test_media_api.py b/test/integration/test_media_api.py index f4b95d53..6e92efb9 100644 --- a/test/integration/test_media_api.py +++ b/test/integration/test_media_api.py @@ -111,7 +111,7 @@ def deleteMedia(self) -> None: # returns void self.api_instance.delete_media(self.account_id, self.media_id) - def _steps(self) -> None: + def _steps(self): call_order = ['uploadMedia', 'listMedia', 'getMedia', 'deleteMedia'] for name in call_order: yield name, getattr(self, name) From ed9b56a70f0b43e0b8be2965d76dca9c9d9f8ee4 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:16:55 -0400 Subject: [PATCH 08/29] Fix Media tests --- test/integration/test_media_api.py | 33 ++++++++++++++++-------------- test/unit/bxml/test_forward.py | 2 +- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/test/integration/test_media_api.py b/test/integration/test_media_api.py index 6e92efb9..54381626 100644 --- a/test/integration/test_media_api.py +++ b/test/integration/test_media_api.py @@ -7,6 +7,8 @@ import unittest import logging +from bandwidth import ApiResponse + import bandwidth from hamcrest import * from bandwidth.api import media_api @@ -27,7 +29,8 @@ def setUp(self) -> None: self.api_client = bandwidth.ApiClient(configuration) self.api_instance = media_api.MediaApi(self.api_client) self.account_id = BW_ACCOUNT_ID - self.media_path = "./test/fixtures/" + # self.media_path = "./test/fixtures/" + self.media_path = "../../test/fixtures/" self.media_file = "python_cat.jpeg" self.media_id = PYTHON_VERSION + "_" + RUNNER_OS + "_" + str(uuid.uuid4()) + "_" + self.media_file self.download_file_path = "cat_download.jpeg" @@ -40,17 +43,17 @@ def uploadMedia(self) -> None: content_type = "image/jpeg" cache_control = "no-cache" - api_response_with_http_info = self.api_instance.upload_media( + api_response_with_http_info: ApiResponse = self.api_instance.upload_media_with_http_info( account_id=self.account_id, media_id=media_id, - body=self.original_file, + body=bytearray(self.original_file.read()), _content_type=content_type, cache_control=cache_control, _return_http_data_only=False ) logging.debug(api_response_with_http_info) - assert_that(api_response_with_http_info[1], equal_to(204)) + assert_that(api_response_with_http_info.status_code, equal_to(204)) # reopen the media file # the client automatically closes any files passed into request bodies @@ -60,7 +63,7 @@ def uploadMedia(self) -> None: self.api_instance.upload_media( account_id=self.account_id, media_id=media_id, - body=reopened_file, + body=bytearray(reopened_file.read()), _content_type=content_type, cache_control=cache_control, _return_http_data_only=False @@ -69,10 +72,10 @@ def uploadMedia(self) -> None: def listMedia(self) -> None: """Test listing all media on the account """ - api_response_with_http_info = self.api_instance.list_media( + api_response_with_http_info = self.api_instance.list_media_with_http_info( self.account_id, _return_http_data_only=False) - assert_that(api_response_with_http_info[1], equal_to(200)) + assert_that(api_response_with_http_info.status_code, equal_to(200)) api_response = self.api_instance.list_media(self.account_id) logging.debug("List Media" + str(api_response)) @@ -83,17 +86,17 @@ def listMedia(self) -> None: def getMedia(self) -> None: """Test downloading the media we previously uploaded """ - api_response_with_http_info = self.api_instance.get_media( - self.account_id, self.media_id, _return_http_data_only=False) + api_response_with_http_info = self.api_instance.get_media_with_http_info( + self.account_id, self.media_id) logging.debug(api_response_with_http_info) - assert_that(api_response_with_http_info[1], equal_to(200)) + assert_that(api_response_with_http_info.status_code, equal_to(200)) api_response = self.api_instance.get_media( - self.account_id, self.media_id, _preload_content=False) + self.account_id, self.media_id) with open(self.media_path + self.download_file_path, "wb") as download_file: - download_file.write(api_response.data) + download_file.write(api_response) assert_that(filecmp.cmp(self.media_path + self.media_file, self.media_path + self.download_file_path), equal_to(True)) @@ -102,11 +105,11 @@ def getMedia(self) -> None: def deleteMedia(self) -> None: """Test deleting the media that we previously uploaded """ - api_response_with_http_info = self.api_instance.delete_media( - self.account_id, self.media_id, _return_http_data_only=False) + api_response_with_http_info = self.api_instance.delete_media_with_http_info( + self.account_id, self.media_id) logging.debug(api_response_with_http_info) - assert_that(api_response_with_http_info[1], equal_to(204)) + assert_that(api_response_with_http_info.status_code, equal_to(204)) # returns void self.api_instance.delete_media(self.account_id, self.media_id) diff --git a/test/unit/bxml/test_forward.py b/test/unit/bxml/test_forward.py index 5f6a80ff..17a0d2b1 100644 --- a/test/unit/bxml/test_forward.py +++ b/test/unit/bxml/test_forward.py @@ -15,7 +15,7 @@ class TestForward(unittest.TestCase): def setUp(self): self.forward = Forward( to="19195554321", - var_from="19195554322", + _from="19195554322", call_timeout = "15", diversion_treatment="propagate", diversion_reason="away", From c573d6bf62d9a0779e99f765baba4643a4f48295 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:17:13 -0400 Subject: [PATCH 09/29] Return asset path to original value --- test/integration/test_media_api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/test_media_api.py b/test/integration/test_media_api.py index 54381626..ea50a45c 100644 --- a/test/integration/test_media_api.py +++ b/test/integration/test_media_api.py @@ -29,8 +29,7 @@ def setUp(self) -> None: self.api_client = bandwidth.ApiClient(configuration) self.api_instance = media_api.MediaApi(self.api_client) self.account_id = BW_ACCOUNT_ID - # self.media_path = "./test/fixtures/" - self.media_path = "../../test/fixtures/" + self.media_path = "./test/fixtures/" self.media_file = "python_cat.jpeg" self.media_id = PYTHON_VERSION + "_" + RUNNER_OS + "_" + str(uuid.uuid4()) + "_" + self.media_file self.download_file_path = "cat_download.jpeg" From ee9ab750a5fbf6d8e2ffe4c923b50cecff71a0fa Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:34:14 -0400 Subject: [PATCH 10/29] Fix MFA tests --- .../test_multi_factor_authentication.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/integration/test_multi_factor_authentication.py b/test/integration/test_multi_factor_authentication.py index df23c22a..d1482d06 100644 --- a/test/integration/test_multi_factor_authentication.py +++ b/test/integration/test_multi_factor_authentication.py @@ -15,7 +15,7 @@ from bandwidth.models.verify_code_request import VerifyCodeRequest from bandwidth.models.verify_code_response import VerifyCodeResponse from bandwidth.models.voice_code_response import VoiceCodeResponse -from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException +from bandwidth.exceptions import ApiException, BadRequestException, UnauthorizedException, ForbiddenException from test.utils.env_variables import * from hamcrest.core import * @@ -58,20 +58,20 @@ def setUp(self) -> None: digits=6, ) - def assertAuthException(self, context: ApiException, expectedException: ApiException, expected_status_code: int) -> None: + def assertAuthException(self, context: Exception, expected_exception: Exception, expected_status_code: int) -> None: """Validates that an auth exception (401 or 403) is properly formatted Args: context (ApiException): Exception to validate - expectedException (ApiException): Expected exception type + expected_exception (ApiException): Expected exception type expected_status_code (int): Expected status code """ - self.assertIs(type(context.exception), expectedException) + self.assertIs(type(context.exception), expected_exception) self.assertIs(type(context.exception.status), int) self.assertEqual(context.exception.status, expected_status_code) self.assertIs(type(context.exception.body), str) # alternate option using hamcrest mathcers - reads like normal sentence, easy to read/speak & less brain overload - assert_that(context.exception, is_(expectedException)) + assert_that(context.exception, is_(expected_exception)) assert_that(context.exception, has_properties( 'status', equal_to(expected_status_code), @@ -81,11 +81,11 @@ def assertAuthException(self, context: ApiException, expectedException: ApiExcep def testSuccessfulMfaGenerateMessagingCodeRequest(self) -> None: """Test a successful MFA messaging code request """ - api_response_with_http_info = self.api_instance.generate_messaging_code( + api_response_with_http_info = self.api_instance.generate_messaging_code_with_http_info( self.account_id, self.messaging_code_request, _return_http_data_only=False ) - self.assertEqual(api_response_with_http_info[1], 200) + self.assertEqual(api_response_with_http_info.status_code, 200) api_response: MessagingCodeResponse = self.api_instance.generate_messaging_code( self.account_id, self.messaging_code_request) @@ -94,11 +94,11 @@ def testSuccessfulMfaGenerateMessagingCodeRequest(self) -> None: def testSuccessfulMfaGenerateVoiceCodeRequest(self) -> None: """Test a successful MFA voice code request """ - api_response_with_http_info = self.api_instance.generate_voice_code( + api_response_with_http_info = self.api_instance.generate_voice_code_with_http_info( self.account_id, self.voice_code_request, _return_http_data_only=False ) - self.assertEqual(api_response_with_http_info[1], 200) + self.assertEqual(api_response_with_http_info.status_code, 200) api_response: VoiceCodeResponse = self.api_instance.generate_voice_code( self.account_id, self.voice_code_request) @@ -114,11 +114,11 @@ def testSuccessfulMfaGVerifyCodeRequest(self) -> None: expiration_time_in_minutes=3.0, code="123456", ) - api_response_with_http_info = self.api_instance.verify_code( + api_response_with_http_info = self.api_instance.verify_code_with_http_info( self.account_id, verify_code_request, _return_http_data_only=False ) - self.assertEqual(api_response_with_http_info[1], 200) + self.assertEqual(api_response_with_http_info.status_code, 200) api_response: VerifyCodeResponse = self.api_instance.verify_code( self.account_id, verify_code_request) @@ -132,10 +132,10 @@ def testSuccessfulMfaGVerifyCodeRequest(self) -> None: def testBadRequest(self) -> None: """Validates a bad (400) request """ - with self.assertRaises(ApiException) as context: + with self.assertRaises(BadRequestException) as context: self.api_instance.generate_messaging_code(self.account_id, self.bad_code_request) - self.assertAuthException(context, ApiException, 400) + self.assertAuthException(context, BadRequestException, 400) def testUnauthorizedRequest(self) -> None: """Validate an unauthorized (401) request @@ -181,7 +181,7 @@ def testRateLimit(self) -> None: while True: try: logging.debug('Testing rate limit, attempt #'+ str(call_count)) - api_response_with_http_info = self.api_instance.verify_code( + self.api_instance.verify_code( self.account_id, verify_code_request ) call_count += 1 @@ -189,14 +189,14 @@ def testRateLimit(self) -> None: if e.status == 429: logging.debug('Got rate limit error') time.sleep(35) - api_response_with_http_info = self.api_instance.verify_code( + api_response_with_http_info = self.api_instance.verify_code_with_http_info( self.account_id, verify_code_request, _return_http_data_only=False ) - self.assertEqual(api_response_with_http_info[1], 200) + self.assertEqual(api_response_with_http_info.status_code, 200) break else: raise e except: logging.error("Unexpected error while testing rate limit!") - raise e + raise e From 5d16fdba038071137af1768ce3842fbd46aac97c Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:47:53 -0400 Subject: [PATCH 11/29] Update test_recordings.py --- test/integration/test_recordings.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 03770a0f..9be397cc 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -17,6 +17,8 @@ import bandwidth from hamcrest import * + +from bandwidth import ApiResponse from bandwidth.api.recordings_api import RecordingsApi from bandwidth.configuration import Configuration from bandwidth.exceptions import ForbiddenException, NotFoundException, UnauthorizedException @@ -227,12 +229,12 @@ def test_successful_call_recording(self) -> None: (test_id, call_id) = self.complete_recorded_call() # List Call Recordings Endpoint - response: List[CallRecordingMetadata] = self.recordings_api_instance.list_call_recordings( + response: ApiResponse = self.recordings_api_instance.list_call_recordings_with_http_info( BW_ACCOUNT_ID, call_id, _return_http_data_only=False) - assert_that(response[1], equal_to(200)) # Check response code + assert_that(response.status_code, equal_to(200)) # Check response code # We should get back 1 recording - call_recordings = response[0] + call_recordings: List[CallRecordingMetadata] = response.data assert_that(call_recordings, has_length(1)) # Checks on the first recording @@ -341,19 +343,22 @@ def test_successful_update_active_recording(self) -> None: time.sleep(TEST_SLEEP) # Update the call to pause the recording - update_call_recording = UpdateCallRecording(RecordingStateEnum('paused')) - update_response = self.recordings_api_instance.update_call_recording_state( - BW_ACCOUNT_ID, call_id, update_call_recording, _return_http_data_only=False) - assert_that(update_response[1], equal_to(200)) + update_call_recording = UpdateCallRecording() + update_call_recording.state = RecordingStateEnum.PAUSED + update_response = self.recordings_api_instance.update_call_recording_state_with_http_info( + BW_ACCOUNT_ID, call_id, update_call_recording) + assert_that(update_response.status_code, equal_to(200)) # Update the call to resume the recording - update_call_recording = UpdateCallRecording(RecordingStateEnum('recording')) - update_response = self.recordings_api_instance.update_call_recording_state( - BW_ACCOUNT_ID, call_id, update_call_recording, _return_http_data_only=False) - assert_that(update_response[1], equal_to(200)) + update_call_recording = UpdateCallRecording() + update_call_recording.state = RecordingStateEnum.ACTIVE + self.recordings_api_instance.update_call_recording_state_with_http_info( + BW_ACCOUNT_ID, call_id, update_call_recording) + assert_that(update_response.status_code, equal_to(200)) # Kill the call - update_call = UpdateCall(state=CallStateEnum('completed')) + update_call = UpdateCall() + update_call.state = CallStateEnum.COMPLETED self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, update_call) def test_4xx_errors(self) -> None: From bcb688ffd30385ea7d6f6fef3032becf48851b70 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:10:57 -0400 Subject: [PATCH 12/29] Update test_calls.py --- test/integration/test_calls.py | 74 ++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 267d3ed6..c1c4da8e 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -1,7 +1,7 @@ """ Integration test for Bandwidth's Voice Voice Calls API """ - +from bandwidth import ApiResponse from test.utils.env_variables import * from test.utils.call_cleanup import callCleanup import time @@ -24,13 +24,14 @@ from bandwidth.models.update_call import UpdateCall from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException + class CallsIntegration(unittest.TestCase): """Voice Calls API integration test""" def setUp(self): configuration = bandwidth.Configuration( - username = BW_USERNAME, - password = BW_PASSWORD, + username=BW_USERNAME, + password=BW_PASSWORD, ) api_client = bandwidth.ApiClient(configuration) self.calls_api_instance = calls_api.CallsApi(api_client) @@ -118,13 +119,16 @@ def test_create_call(self): Validate a Create Call request with all optional parameters """ time.sleep(self.TEST_SLEEP) - create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.createCallBody, _return_http_data_only=False) + create_call_response: ApiResponse = self.calls_api_instance.create_call_with_http_info( + BW_ACCOUNT_ID, + self.createCallBody + ) #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(create_call_response.data.call_id) - assert_that(create_call_response[1], 201) - assert_that(create_call_response[0], has_properties( + assert_that(create_call_response.status_code, 201) + assert_that(create_call_response, has_properties( 'call_id', instance_of(str), 'account_id', BW_ACCOUNT_ID, 'application_id', BW_VOICE_APPLICATION_ID, @@ -138,7 +142,7 @@ def test_create_call_bad_request(self): call_body = CreateCall(to="invalidNumberFormat", var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) with self.assertRaises(ApiException) as context: - self.calls_api_instance.create_call(BW_ACCOUNT_ID, call_body, _return_http_data_only=False) + self.calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body) assert_that(context.exception.status, 400) @@ -146,7 +150,7 @@ def test_create_call_unauthorized(self) -> None: """Validate an unauthorized (401) request """ with self.assertRaises(UnauthorizedException) as context: - self.unauthorized_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody, _return_http_data_only=False) + self.unauthorized_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody) self.assertApiException(context, UnauthorizedException, 401) @@ -154,7 +158,7 @@ def test_create_call_forbidden(self) -> None: """Validate a forbidden (403) request """ with self.assertRaises(ForbiddenException) as context: - self.forbidden_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody, _return_http_data_only=False) + self.forbidden_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody) self.assertApiException(context, ForbiddenException, 403) @@ -162,18 +166,18 @@ def test_create_call_forbidden(self) -> None: def test_get_call_state(self): """Validate an Get Call State Request """ - create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody) + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(call_id) time.sleep(self.TEST_SLEEP) - get_call_response: CallState = self.calls_api_instance.get_call_state(BW_ACCOUNT_ID, call_id, _return_http_data_only=False) + get_call_response: ApiResponse = self.calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id) - assert_that(get_call_response[1], 200) - assert_that(get_call_response[0], has_properties( + assert_that(get_call_response.status_code, 200) + assert_that(get_call_response.data, has_properties( "call_id", call_id, "state", instance_of(str), "direction", CallDirectionEnum("outbound"), @@ -186,7 +190,7 @@ def test_get_call_state_unauthorized(self) -> None: """Validate an unauthorized (401) request """ with self.assertRaises(UnauthorizedException) as context: - self.unauthorized_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId, _return_http_data_only=False) + self.unauthorized_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId) self.assertApiException(context, UnauthorizedException, 401) @@ -211,10 +215,10 @@ def test_update_call(self): """ time.sleep(self.TEST_SLEEP) create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(call_id) updateCallBody = UpdateCall( state=CallStateEnum("active"), @@ -230,22 +234,22 @@ def test_update_call(self): ) time.sleep(self.TEST_SLEEP) - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, updateCallBody, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, updateCallBody, _return_http_data_only=False) + assert_that(update_call_response.status_code, 200) time.sleep(self.TEST_SLEEP) # hanging-up the call - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) + assert_that(update_call_response.status_code, 200) def test_update_call_bad_request(self): """Validate a bad (400) update call request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(call_id) time.sleep(self.TEST_SLEEP) @@ -307,36 +311,36 @@ def test_update_call_bxml(self): self.callIdArray.append(create_call_response[0].call_id) time.sleep(self.TEST_SLEEP) - update_call_bxml_response: UpdateCall = self.calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, call_id, self.testBxmlBody, _return_http_data_only=False) - assert_that(update_call_bxml_response[1], 204) + update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody, _return_http_data_only=False) + assert_that(update_call_bxml_response.status_code, 204) time.sleep(self.TEST_SLEEP) # hanging-up the call - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) + assert_that(update_call_response.status_code, 200) def test_update_call_bxml_bad_request(self): """Validate a bad (400) update call bxml request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(call_id) time.sleep(self.TEST_SLEEP) invalidBxmlBody = "invalidBXML" with self.assertRaises(ApiException) as context: - self.calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, call_id, invalidBxmlBody, _return_http_data_only=False) + self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, invalidBxmlBody) - assert_that(context.exception.status, 400) + assert_that(context.exception.status_code, 400) time.sleep(self.TEST_SLEEP) # hanging-up the call - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) + assert_that(update_call_response.status_code, 200) def test_update_call_bxml_unauthorized(self): From 51357a76ac93ecdb8ed0ced66f462c42a947a77a Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:17:54 -0400 Subject: [PATCH 13/29] Update test_calls.py --- test/integration/test_calls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index c1c4da8e..bc2d23da 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -359,7 +359,7 @@ def test_update_call_bxml_forbidden(self): call_id = create_call_response[0].call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(create_call_response.call_id) time.sleep(self.TEST_SLEEP) with self.assertRaises(ForbiddenException) as context: From 5c07fccc80234feebe726d6399caf14d579e7154 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:30:03 -0400 Subject: [PATCH 14/29] Fix messages test --- test/integration/test_messages_api.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/integration/test_messages_api.py b/test/integration/test_messages_api.py index e855513f..bd9eba02 100644 --- a/test/integration/test_messages_api.py +++ b/test/integration/test_messages_api.py @@ -17,6 +17,8 @@ import bandwidth from hamcrest import * + +from bandwidth import ApiResponse from bandwidth.api import messages_api from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem @@ -77,11 +79,11 @@ def setUp(self): def test_create_message(self): - response = self.api_instance.create_message(self.account_id, self.message_request, _return_http_data_only=False) + response: ApiResponse = self.api_instance.create_message_with_http_info(self.account_id, self.message_request, _return_http_data_only=False) - assert_that(response[1], equal_to(202)) + assert_that(response.status_code, equal_to(202)) - api_response = response[0] + api_response = response.data assert_that(api_response, instance_of(Message)) assert_that(api_response, has_properties( 'application_id', self.application_id, @@ -96,7 +98,7 @@ def test_create_message(self): 'segment_count', 1, ) ) - assert_that(datetime.fromisoformat(api_response.time[:-1]), instance_of(datetime)) + assert_that(api_response.time, instance_of(datetime)) def test_create_message_bad_request(self): @@ -120,11 +122,11 @@ def test_create_message_invalid_media(self): def test_list_messages(self): message_direction = ListMessageDirectionEnum("OUTBOUND") - response = self.api_instance.list_messages(self.account_id, message_direction=message_direction, _return_http_data_only=False) + response = self.api_instance.list_messages_with_http_info(self.account_id, message_direction=message_direction, _return_http_data_only=False) - assert_that(response[1], equal_to(200)) + assert_that(response.status_code, equal_to(200)) - api_response = response[0] + api_response = response.data assert_that(api_response, instance_of(MessagesList)) assert_that(api_response, has_properties( 'total_count', greater_than(0), @@ -144,7 +146,7 @@ def test_list_messages(self): 'segment_count', greater_than(0), 'source_tn', matches_regexp('^\\+[1-9]\\d{1,14}$') )) - assert_that(datetime.fromisoformat(message.receive_time[:-1]), instance_of(datetime)) + assert_that(message.receive_time, instance_of(datetime)) def test_list_messages_bad_request(self): From 9b7d40ee70703784bc3646c8ab8e99bfbb447ee7 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:37:58 -0400 Subject: [PATCH 15/29] Attempt to fix some calls tests --- test/integration/test_calls.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index bc2d23da..286e5822 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -234,18 +234,18 @@ def test_update_call(self): ) time.sleep(self.TEST_SLEEP) - update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, updateCallBody, _return_http_data_only=False) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, updateCallBody) assert_that(update_call_response.status_code, 200) time.sleep(self.TEST_SLEEP) # hanging-up the call - update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) assert_that(update_call_response.status_code, 200) def test_update_call_bad_request(self): """Validate a bad (400) update call request """ - create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) + create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) call_id = create_call_response.call_id #Adding the call to the self.callIdArray @@ -261,8 +261,8 @@ def test_update_call_bad_request(self): # hanging-up the call time.sleep(self.TEST_SLEEP) - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) + assert_that(update_call_response.status_code, 200) def test_update_call_unauthorized(self): """Validate an unauthorized (401) update call request @@ -276,10 +276,10 @@ def test_update_call_forbidden(self): """Validate a forbidden (403) update call request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(call_id) time.sleep(self.TEST_SLEEP) @@ -290,8 +290,8 @@ def test_update_call_forbidden(self): time.sleep(self.TEST_SLEEP_LONG) # hanging-up the call - update_call_response: UpdateCall = self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) - assert_that(update_call_response[1], 200) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) + assert_that(update_call_response.status_code, 200) def test_update_call_not_found(self): """Validate a not found update call request @@ -304,25 +304,25 @@ def test_update_call_not_found(self): def test_update_call_bxml(self): """Validate an UpdateCallBxml Request """ - create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) + create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) call_id = create_call_response[0].call_id #Adding the call to the self.callIdArray self.callIdArray.append(create_call_response[0].call_id) time.sleep(self.TEST_SLEEP) - update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody, _return_http_data_only=False) + update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody) assert_that(update_call_bxml_response.status_code, 204) time.sleep(self.TEST_SLEEP) # hanging-up the call - update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False) + update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) assert_that(update_call_response.status_code, 200) def test_update_call_bxml_bad_request(self): """Validate a bad (400) update call bxml request """ - create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) + create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) call_id = create_call_response.call_id #Adding the call to the self.callIdArray @@ -335,12 +335,12 @@ def test_update_call_bxml_bad_request(self): with self.assertRaises(ApiException) as context: self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, invalidBxmlBody) - assert_that(context.exception.status_code, 400) + assert_that(context.exception.status, 400) time.sleep(self.TEST_SLEEP) # hanging-up the call update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) - assert_that(update_call_response.status_code, 200) + assert_that(update_call_response.status, 200) def test_update_call_bxml_unauthorized(self): From 10d47444cecee962ee55705ec5ddc3c5be28d1c8 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 09:14:14 -0400 Subject: [PATCH 16/29] More calls tests updates --- test/integration/test_calls.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 286e5822..d66e2dd7 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -133,7 +133,7 @@ def test_create_call(self): 'account_id', BW_ACCOUNT_ID, 'application_id', BW_VOICE_APPLICATION_ID, 'to', USER_NUMBER, - 'var_from', BW_NUMBER + 'from', BW_NUMBER )) def test_create_call_bad_request(self): @@ -308,7 +308,7 @@ def test_update_call_bxml(self): call_id = create_call_response[0].call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response[0].call_id) + self.callIdArray.append(create_call_response.call_id) time.sleep(self.TEST_SLEEP) update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody) @@ -356,10 +356,10 @@ def test_update_call_bxml_forbidden(self): """Validate a forbidden (403) update call bxml request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray - self.callIdArray.append(create_call_response.call_id) + self.callIdArray.append(call_id) time.sleep(self.TEST_SLEEP) with self.assertRaises(ForbiddenException) as context: From 720f1ddceca50cf98c20b566724badcd2b9feb8f Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:06:48 -0400 Subject: [PATCH 17/29] Conferences test --- test/integration/test_conferences.py | 88 ++++++++++++++-------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 5ccfac50..fd9a25a2 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -148,18 +148,18 @@ def create_conference(self, answer_url: str) -> Tuple[str, str]: )) time.sleep(self.TEST_SLEEP) - list_conferences_response = self.conference_api_instance.list_conferences( - BW_ACCOUNT_ID, name=test_id, _return_http_data_only=False) + list_conferences_response = self.conference_api_instance.list_conferences_with_http_info( + BW_ACCOUNT_ID, name=test_id) - assert_that(list_conferences_response[1], 200) + assert_that(list_conferences_response.status_code, 200) # TODO: This is not deterministic; our latest conference may not always be the one we just created due to parallelism. # This new solution should guarantee the right conference id is grabbed. conference_id = list_conferences_response[0][0].id - get_conference_response = self.conference_api_instance.get_conference( - BW_ACCOUNT_ID, conference_id, _return_http_data_only=False) - assert_that(get_conference_response[1], 200) + get_conference_response = self.conference_api_instance.get_conference_with_http_info( + BW_ACCOUNT_ID, conference_id) + assert_that(get_conference_response.status_code, 200) self.callIdArray.append(create_call_response.call_id) @@ -201,46 +201,46 @@ def test_conference_and_members(self): answer_url = MANTECA_BASE_URL + "bxml/joinConferencePause" (test_id, call_id, conference_id) = self.create_conference(answer_url) - list_conferences_response = self.conference_api_instance.list_conferences( - BW_ACCOUNT_ID, _return_http_data_only=False) + list_conferences_response = self.conference_api_instance.list_conferences_with_http_info( + BW_ACCOUNT_ID) - assert_that(list_conferences_response[1], 200) - assert_that(list_conferences_response[0][0].name, instance_of(str)) - assert_that(list_conferences_response[0][0].id, instance_of(str)) + assert_that(list_conferences_response.status_code, 200) + assert_that(list_conferences_response.data[0].name, instance_of(str)) + assert_that(list_conferences_response.data[0].id, instance_of(str)) # TODO: Also non-deterministic; we could differentiate by conference name instead? The conference name is set to be the test id by Manteca # conferenceId = (list_conferences_response[0][len(list_conferences_response[0])-1].id) - get_conference_response = self.conference_api_instance.get_conference( - BW_ACCOUNT_ID, conference_id, _return_http_data_only=False) - assert_that(get_conference_response[1], 200) - assert_that(get_conference_response[0].id, conference_id) - assert_that(get_conference_response[0].name, instance_of(str)) - callId = (get_conference_response[0].active_members[0].call_id) + get_conference_response = self.conference_api_instance.get_conference_with_http_info( + BW_ACCOUNT_ID, conference_id) + assert_that(get_conference_response.status_code, 200) + assert_that(get_conference_response.data[0].id, conference_id) + assert_that(get_conference_response.data[0].name, instance_of(str)) + callId = (get_conference_response.data[0].active_members[0].call_id) self.callIdArray.append(callId) - get_conference_member_response = self.conference_api_instance.get_conference_member( - BW_ACCOUNT_ID, conference_id, callId, _return_http_data_only=False) - assert_that(get_conference_member_response[1], 200) - assert_that(get_conference_member_response[0].conference_id, conference_id) - assert_that(get_conference_member_response[0].call_id, callId) + get_conference_member_response = self.conference_api_instance.get_conference_member_with_http_info( + BW_ACCOUNT_ID, conference_id, callId) + assert_that(get_conference_member_response.status_code, 200) + assert_that(get_conference_member_response.data[0].conference_id, conference_id) + assert_that(get_conference_member_response.data[0].call_id, callId) # time.sleep(self.TEST_SLEEP) - update_conference_member_response = self.conference_api_instance.update_conference_member( - BW_ACCOUNT_ID, conference_id, callId, self.testUpdateMember, _return_http_data_only=False) - assert_that(update_conference_member_response[1], 204) + update_conference_member_response = self.conference_api_instance.update_conference_member_with_http_info( + BW_ACCOUNT_ID, conference_id, callId, self.testUpdateMember) + assert_that(update_conference_member_response.statu_code, 204) # time.sleep(self.TEST_SLEEP) - update_conference_response = self.conference_api_instance.update_conference( - BW_ACCOUNT_ID, conference_id, self.testUpdateConf, _return_http_data_only=False) - assert_that(update_conference_response[1], 204) + update_conference_response = self.conference_api_instance.update_conference_with_http_info( + BW_ACCOUNT_ID, conference_id, self.testUpdateConf) + assert_that(update_conference_response.status_code, 204) updateBxmlBody = 'This is a test bxml response' # time.sleep(self.TEST_SLEEP) - update_conference_bxml_response = self.conference_api_instance.update_conference_bxml( - BW_ACCOUNT_ID, conference_id, updateBxmlBody, _return_http_data_only=False) - assert_that(update_conference_bxml_response[1], 204) + update_conference_bxml_response = self.conference_api_instance.update_conference_bxml_with_http_info( + BW_ACCOUNT_ID, conference_id, updateBxmlBody) + assert_that(update_conference_bxml_response.status_code, 204) update_call = UpdateCall(state=CallStateEnum('completed')) self.calls_api_instance.update_call( @@ -264,9 +264,9 @@ def test_conference_recordings(self) -> None: assert_that(list_conferences_response[1], 200) updateBxmlBody = 'This should be a conference recording.' - update_conference_bxml_response = self.conference_api_instance.update_conference_bxml( - BW_ACCOUNT_ID, conference_id, updateBxmlBody, _return_http_data_only=False) - assert_that(update_conference_bxml_response[1], 204) + update_conference_bxml_response = self.conference_api_instance.update_conference_bxml_with_http_info( + BW_ACCOUNT_ID, conference_id, updateBxmlBody) + assert_that(update_conference_bxml_response.status_code, 204) # Poll Manteca to ensure our conference is recorded call_status = self.get_test_status(test_id) @@ -279,9 +279,9 @@ def test_conference_recordings(self) -> None: # If we failed to get a recorded conference, fail due to polling timeout assert call_status['callRecorded'] == True - list_conference_recordings_response: List[ConferenceRecordingMetadata] = self.conference_api_instance.list_conference_recordings( - BW_ACCOUNT_ID, conference_id, _return_http_data_only=False) - assert_that(list_conference_recordings_response[1], 200) + list_conference_recordings_response: List[ConferenceRecordingMetadata] = self.conference_api_instance.list_conference_recordings_with_http_info( + BW_ACCOUNT_ID, conference_id) + assert_that(list_conference_recordings_response.status_code, 200) conference_recordings = list_conference_recordings_response[0] assert_that(len(conference_recordings), greater_than(0)) @@ -290,14 +290,14 @@ def test_conference_recordings(self) -> None: self.validate_recording(first_recording, conference_id) recording_id = first_recording.recording_id - recording_response: ConferenceRecordingMetadata = self.conference_api_instance.get_conference_recording( - BW_ACCOUNT_ID, conference_id, recording_id, _return_http_data_only=False) - assert_that(recording_response[1], 200) - assert_that(recording_response[0].conference_id, conference_id) - assert_that(recording_response[0].recording_id, recording_id) - assert_that(recording_response[0].name, instance_of(str)) + recording_response: ConferenceRecordingMetadata = self.conference_api_instance.get_conference_recording_with_http_info( + BW_ACCOUNT_ID, conference_id, recording_id) + assert_that(recording_response.status_code, 200) + assert_that(recording_response.data.conference_id, conference_id) + assert_that(recording_response.data.recording_id, recording_id) + assert_that(recording_response.data.name, instance_of(str)) - self.validate_recording(recording_response[0], conference_id) + self.validate_recording(recording_response.data.conference_id, conference_id) recording_media_response = self.conference_api_instance.download_conference_recording( BW_ACCOUNT_ID, conference_id, recording_id, _preload_content=False) From b02e54a5ee4d908691147210c60873bd016456c8 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:31:02 -0400 Subject: [PATCH 18/29] More error fixes --- test/integration/test_calls.py | 4 ++-- test/integration/test_recordings.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index d66e2dd7..9afbb7fa 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -305,7 +305,7 @@ def test_update_call_bxml(self): """Validate an UpdateCallBxml Request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) - call_id = create_call_response[0].call_id + call_id = create_call_response.call_id #Adding the call to the self.callIdArray self.callIdArray.append(create_call_response.call_id) @@ -340,7 +340,7 @@ def test_update_call_bxml_bad_request(self): time.sleep(self.TEST_SLEEP) # hanging-up the call update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) - assert_that(update_call_response.status, 200) + assert_that(update_call_response.status_code, 200) def test_update_call_bxml_unauthorized(self): diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 9be397cc..784f3fdb 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -243,9 +243,9 @@ def test_successful_call_recording(self) -> None: recording_id = first_recording.recording_id # Get Single Recording Endpoint - recording_response: CallRecordingMetadata = self.recordings_api_instance.get_call_recording( + recording_response: ApiResponse = self.recordings_api_instance.get_call_recording_with_http_info( BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) - assert_that(recording_response[1], equal_to(200)) # Check response code + assert_that(recording_response.status_code, equal_to(200)) # Check response code recording = recording_response[0] assert_that(recording.recording_id, equal_to(recording_id)) @@ -522,8 +522,14 @@ def test_invalid_update_call_recording_state(self) -> None: assert_that(call_status['status'], equal_to('ALIVE')) # Common models - pause_recording = UpdateCallRecording(RecordingStateEnum('paused')) - resume_recording = UpdateCallRecording(RecordingStateEnum('recording')) + paused = RecordingStateEnum('paused') + recording = RecordingStateEnum('recording') + + pause_recording = UpdateCallRecording() + pause_recording.state = paused + resume_recording = UpdateCallRecording() + resume_recording.state = recording + # Use the unauthorized client to try to update (401) assert_that(calling(self.unauthorized_recordings_api_instance.update_call_recording_state).with_args( From aceed3e4bdf8cddf6d4a02658218d5b53df96e40 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:06:38 -0400 Subject: [PATCH 19/29] More test fixes --- test/integration/test_conferences.py | 2 +- test/integration/test_recordings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index fd9a25a2..05013ce6 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -155,7 +155,7 @@ def create_conference(self, answer_url: str) -> Tuple[str, str]: # TODO: This is not deterministic; our latest conference may not always be the one we just created due to parallelism. # This new solution should guarantee the right conference id is grabbed. - conference_id = list_conferences_response[0][0].id + conference_id = list_conferences_response.data[0].id get_conference_response = self.conference_api_instance.get_conference_with_http_info( BW_ACCOUNT_ID, conference_id) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 784f3fdb..33c67081 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -247,7 +247,7 @@ def test_successful_call_recording(self) -> None: BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) assert_that(recording_response.status_code, equal_to(200)) # Check response code - recording = recording_response[0] + recording = recording_response.data assert_that(recording.recording_id, equal_to(recording_id)) self.validate_recording(recording, call_id) From 64a559f47e49e73ff2172893ee95c2a5af9c3a04 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:14:26 -0400 Subject: [PATCH 20/29] more conference fixes --- test/integration/test_conferences.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 05013ce6..4a0e3340 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -11,6 +11,7 @@ from hamcrest import assert_that, has_properties, not_none, instance_of, greater_than import bandwidth +from bandwidth import ApiResponse from bandwidth.api import calls_api from bandwidth.models.create_call import CreateCall from bandwidth.models.create_call_response import CreateCallResponse @@ -214,16 +215,16 @@ def test_conference_and_members(self): get_conference_response = self.conference_api_instance.get_conference_with_http_info( BW_ACCOUNT_ID, conference_id) assert_that(get_conference_response.status_code, 200) - assert_that(get_conference_response.data[0].id, conference_id) - assert_that(get_conference_response.data[0].name, instance_of(str)) - callId = (get_conference_response.data[0].active_members[0].call_id) + assert_that(get_conference_response.data.id, conference_id) + assert_that(get_conference_response.data.name, instance_of(str)) + callId = (get_conference_response.data.active_members[0].call_id) self.callIdArray.append(callId) get_conference_member_response = self.conference_api_instance.get_conference_member_with_http_info( BW_ACCOUNT_ID, conference_id, callId) assert_that(get_conference_member_response.status_code, 200) - assert_that(get_conference_member_response.data[0].conference_id, conference_id) - assert_that(get_conference_member_response.data[0].call_id, callId) + assert_that(get_conference_member_response.data.conference_id, conference_id) + assert_that(get_conference_member_response.data.call_id, callId) # time.sleep(self.TEST_SLEEP) update_conference_member_response = self.conference_api_instance.update_conference_member_with_http_info( @@ -279,11 +280,11 @@ def test_conference_recordings(self) -> None: # If we failed to get a recorded conference, fail due to polling timeout assert call_status['callRecorded'] == True - list_conference_recordings_response: List[ConferenceRecordingMetadata] = self.conference_api_instance.list_conference_recordings_with_http_info( + list_conference_recordings_response: ApiResponse = self.conference_api_instance.list_conference_recordings_with_http_info( BW_ACCOUNT_ID, conference_id) assert_that(list_conference_recordings_response.status_code, 200) - conference_recordings = list_conference_recordings_response[0] + conference_recordings = list_conference_recordings_response.data assert_that(len(conference_recordings), greater_than(0)) first_recording: ConferenceRecordingMetadata = conference_recordings[0] From 1edcee35569b2743e4f06e8c9251fbe85cd18e1a Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:59:42 -0400 Subject: [PATCH 21/29] fix calls tests --- test/integration/test_calls.py | 2 +- test/integration/test_conferences.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 9afbb7fa..9ef43f39 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -128,7 +128,7 @@ def test_create_call(self): self.callIdArray.append(create_call_response.data.call_id) assert_that(create_call_response.status_code, 201) - assert_that(create_call_response, has_properties( + assert_that(create_call_response.data, has_properties( 'call_id', instance_of(str), 'account_id', BW_ACCOUNT_ID, 'application_id', BW_VOICE_APPLICATION_ID, diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 4a0e3340..3bba162a 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -166,7 +166,7 @@ def create_conference(self, answer_url: str) -> Tuple[str, str]: return (test_id, create_call_response.call_id, conference_id) - def validate_recording(self, recording: ConferenceRecordingMetadata, conference_id: str) -> None: + def validate_recording(self, recording: ConferenceRecordingMetadata) -> None: assert_that(recording.status, 'complete') assert_that(recording.file_format, FileFormatEnum('wav')) @@ -229,7 +229,7 @@ def test_conference_and_members(self): # time.sleep(self.TEST_SLEEP) update_conference_member_response = self.conference_api_instance.update_conference_member_with_http_info( BW_ACCOUNT_ID, conference_id, callId, self.testUpdateMember) - assert_that(update_conference_member_response.statu_code, 204) + assert_that(update_conference_member_response.status_code, 204) # time.sleep(self.TEST_SLEEP) update_conference_response = self.conference_api_instance.update_conference_with_http_info( @@ -288,7 +288,7 @@ def test_conference_recordings(self) -> None: assert_that(len(conference_recordings), greater_than(0)) first_recording: ConferenceRecordingMetadata = conference_recordings[0] - self.validate_recording(first_recording, conference_id) + self.validate_recording(first_recording) recording_id = first_recording.recording_id recording_response: ConferenceRecordingMetadata = self.conference_api_instance.get_conference_recording_with_http_info( @@ -298,7 +298,7 @@ def test_conference_recordings(self) -> None: assert_that(recording_response.data.recording_id, recording_id) assert_that(recording_response.data.name, instance_of(str)) - self.validate_recording(recording_response.data.conference_id, conference_id) + self.validate_recording(recording_response.data) recording_media_response = self.conference_api_instance.download_conference_recording( BW_ACCOUNT_ID, conference_id, recording_id, _preload_content=False) From 3abb58a9827ac99c42525dec45871e484c20f2c1 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:25:31 -0400 Subject: [PATCH 22/29] Update test_calls.py --- test/integration/test_calls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/test_calls.py b/test/integration/test_calls.py index 9ef43f39..7744a340 100644 --- a/test/integration/test_calls.py +++ b/test/integration/test_calls.py @@ -133,7 +133,7 @@ def test_create_call(self): 'account_id', BW_ACCOUNT_ID, 'application_id', BW_VOICE_APPLICATION_ID, 'to', USER_NUMBER, - 'from', BW_NUMBER + 'var_from', BW_NUMBER )) def test_create_call_bad_request(self): From 796ae9d4d33cd162493c216d1ccf8f75d554471b Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:36:33 -0400 Subject: [PATCH 23/29] Update test_recordings.py --- test/integration/test_recordings.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 33c67081..84eaac41 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -522,13 +522,8 @@ def test_invalid_update_call_recording_state(self) -> None: assert_that(call_status['status'], equal_to('ALIVE')) # Common models - paused = RecordingStateEnum('paused') - recording = RecordingStateEnum('recording') - - pause_recording = UpdateCallRecording() - pause_recording.state = paused - resume_recording = UpdateCallRecording() - resume_recording.state = recording + pause_recording = UpdateCallRecording(state=RecordingStateEnum('paused')) + resume_recording = UpdateCallRecording(state=RecordingStateEnum('recording')) # Use the unauthorized client to try to update (401) From a760c201edbbbb57ff8497c915a9865a0c584e22 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:44:09 -0400 Subject: [PATCH 24/29] Update test_recordings.py --- test/integration/test_recordings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 84eaac41..04e7e548 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -343,15 +343,13 @@ def test_successful_update_active_recording(self) -> None: time.sleep(TEST_SLEEP) # Update the call to pause the recording - update_call_recording = UpdateCallRecording() - update_call_recording.state = RecordingStateEnum.PAUSED + update_call_recording = UpdateCallRecording(state=RecordingStateEnum('paused')) update_response = self.recordings_api_instance.update_call_recording_state_with_http_info( BW_ACCOUNT_ID, call_id, update_call_recording) assert_that(update_response.status_code, equal_to(200)) # Update the call to resume the recording - update_call_recording = UpdateCallRecording() - update_call_recording.state = RecordingStateEnum.ACTIVE + update_call_recording = UpdateCallRecording(state=RecordingStateEnum('recording')) self.recordings_api_instance.update_call_recording_state_with_http_info( BW_ACCOUNT_ID, call_id, update_call_recording) assert_that(update_response.status_code, equal_to(200)) From bd8836a8b914224ae8a4af4481b645b03f7ef0ac Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:50:35 -0400 Subject: [PATCH 25/29] remove preload content --- test/integration/test_conferences.py | 2 +- test/integration/test_recordings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 3bba162a..2b42fb3e 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -301,7 +301,7 @@ def test_conference_recordings(self) -> None: self.validate_recording(recording_response.data) recording_media_response = self.conference_api_instance.download_conference_recording( - BW_ACCOUNT_ID, conference_id, recording_id, _preload_content=False) + BW_ACCOUNT_ID, conference_id, recording_id) conference_recording_media = recording_media_response.data def test_list_conferences_unauthorized(self) -> None: diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 04e7e548..05328a87 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -253,7 +253,7 @@ def test_successful_call_recording(self) -> None: # Download recording media recording_media_response = self.recordings_api_instance.download_call_recording( - BW_ACCOUNT_ID, call_id, recording_id, _preload_content=False) + BW_ACCOUNT_ID, call_id, recording_id) call_recording_media = recording_media_response.data ''' From e3f517cc379b6686e0536bd145c4adbfc9743026 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:56:51 -0400 Subject: [PATCH 26/29] please work --- test/integration/test_conferences.py | 2 +- test/integration/test_recordings.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences.py index 2b42fb3e..63a09772 100644 --- a/test/integration/test_conferences.py +++ b/test/integration/test_conferences.py @@ -302,7 +302,7 @@ def test_conference_recordings(self) -> None: recording_media_response = self.conference_api_instance.download_conference_recording( BW_ACCOUNT_ID, conference_id, recording_id) - conference_recording_media = recording_media_response.data + conference_recording_media = recording_media_response def test_list_conferences_unauthorized(self) -> None: with self.assertRaises(UnauthorizedException) as context: diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 05328a87..1e00e82a 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -254,7 +254,7 @@ def test_successful_call_recording(self) -> None: # Download recording media recording_media_response = self.recordings_api_instance.download_call_recording( BW_ACCOUNT_ID, call_id, recording_id) - call_recording_media = recording_media_response.data + call_recording_media = recording_media_response ''' Do a verification test on the actual recording data? @@ -267,9 +267,9 @@ def test_successful_call_recording(self) -> None: transcription_url = MANTECA_BASE_URL + "/transcriptions" transcribe_recording_request = TranscribeRecording( callback_url=transcription_url, tag=test_id) - transcription_response = self.recordings_api_instance.transcribe_call_recording( - BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording_request, _return_http_data_only=False) - assert_that(transcription_response[1], equal_to(204)) # Check response code + transcription_response = self.recordings_api_instance.transcribe_call_recording_with_http_info( + BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording_request) + assert_that(transcription_response.status_code, equal_to(204)) # Check response code # Poll Manteca to make sure our call is transcribed call_status = self.get_test_status(test_id) From 8defbde50ffbcc252408b484d79dfbdfa3dad298 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:06:23 -0400 Subject: [PATCH 27/29] Update test_recordings.py --- test/integration/test_recordings.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 1e00e82a..8af38464 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -283,11 +283,11 @@ def test_successful_call_recording(self) -> None: assert_that(call_status['callTranscribed'], equal_to(True)) # Get the transcription - transcription_response = self.recordings_api_instance.get_call_transcription( - BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) - assert_that(transcription_response[1], equal_to(200)) # Check response code + transcription_response = self.recordings_api_instance.get_call_transcription_with_http_info( + BW_ACCOUNT_ID, call_id, recording_id) + assert_that(transcription_response.status_code, equal_to(200)) # Check response code - transcription_list = transcription_response[0] + transcription_list = transcription_response.data[0] assert_that(transcription_list.transcripts, has_length(1)) transcription = transcription_list.transcripts[0] assert_that(transcription, instance_of(Transcription)) @@ -297,23 +297,23 @@ def test_successful_call_recording(self) -> None: )) # Delete the transcription - delete_transcription_response = self.recordings_api_instance.delete_call_transcription( - BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) - assert_that(delete_transcription_response[1], equal_to(204)) # Check response code + delete_transcription_response = self.recordings_api_instance.delete_call_transcription_with_http_info( + BW_ACCOUNT_ID, call_id, recording_id) + assert_that(delete_transcription_response.status_code, equal_to(204)) # Check response code assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args( BW_ACCOUNT_ID, call_id, recording_id), raises(NotFoundException)) # Delete Recording media - delete_recording_media_response = self.recordings_api_instance.delete_recording_media( - BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) + delete_recording_media_response = self.recordings_api_instance.delete_recording_media_with_http_info( + BW_ACCOUNT_ID, call_id, recording_id) # Validate the 204 response - assert_that(delete_recording_media_response[1], equal_to(204)) + assert_that(delete_recording_media_response.status_code, equal_to(204)) # Delete Recording - delete_recording_response = self.recordings_api_instance.delete_recording( - BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False) - assert_that(delete_recording_response[1], equal_to(204)) + delete_recording_response = self.recordings_api_instance.delete_recording_with_http_info( + BW_ACCOUNT_ID, call_id, recording_id) + assert_that(delete_recording_response.status_code, equal_to(204)) call_recordings = self.recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, call_id) assert_that(call_recordings, has_length(0)) From 2d1a6668196db7555a53fbb63eceb5157d30b9ee Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:13:05 -0400 Subject: [PATCH 28/29] Update test_recordings.py --- test/integration/test_recordings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings.py index 8af38464..e7c3bfcb 100644 --- a/test/integration/test_recordings.py +++ b/test/integration/test_recordings.py @@ -287,7 +287,7 @@ def test_successful_call_recording(self) -> None: BW_ACCOUNT_ID, call_id, recording_id) assert_that(transcription_response.status_code, equal_to(200)) # Check response code - transcription_list = transcription_response.data[0] + transcription_list = transcription_response.data assert_that(transcription_list.transcripts, has_length(1)) transcription = transcription_list.transcripts[0] assert_that(transcription, instance_of(Transcription)) From 7b73422cd2810ac06260785f7bfef1ff19dcf4fb Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:58:21 -0400 Subject: [PATCH 29/29] Fix unit tests --- .../{test_calls.py => test_calls_api.py} | 0 ...conferences.py => test_conferences_api.py} | 0 ...ctor_authentication.py => test_mfa_api.py} | 0 ...kup.py => test_phone_number_lookup_api.py} | 0 ...t_recordings.py => test_recordings_api.py} | 0 test/test_account_statistics.py | 56 ---------- test/test_answer_callback.py | 70 ------------ test/test_bridge_complete_callback.py | 70 ------------ test/test_bridge_target_complete_callback.py | 67 ----------- test/test_call_direction_enum.py | 37 ------- test/test_call_recording_metadata.py | 76 ------------- test/test_call_state.py | 72 ------------ test/test_call_state_enum.py | 37 ------- test/test_callback_method_enum.py | 37 ------- test/test_calls_api.py | 62 ----------- test/test_code_request.py | 65 ----------- test/test_conference.py | 70 ------------ test/test_conference_completed_callback.py | 59 ---------- test/test_conference_created_callback.py | 59 ---------- test/test_conference_member.py | 60 ---------- test/test_conference_member_exit_callback.py | 62 ----------- test/test_conference_member_join_callback.py | 62 ----------- ...conference_recording_available_callback.py | 68 ------------ test/test_conference_recording_metadata.py | 65 ----------- test/test_conference_redirect_callback.py | 59 ---------- test/test_conference_state_enum.py | 37 ------- test/test_conferences_api.py | 97 ---------------- test/test_create_call.py | 93 ---------------- test/test_create_call_response.py | 84 -------------- test/test_create_lookup_response.py | 56 ---------- test/test_create_message_request_error.py | 63 ----------- test/test_deferred_result.py | 56 ---------- test/test_disconnect_callback.py | 71 ------------ test/test_diversion.py | 61 ---------- test/test_dtmf_callback.py | 71 ------------ test/test_field_error.py | 56 ---------- test/test_file_format_enum.py | 37 ------- test/test_gather_callback.py | 72 ------------ test/test_inbound_message_callback.py | 88 --------------- test/test_inbound_message_callback_message.py | 75 ------------- test/test_initiate_callback.py | 76 ------------- test/test_list_message_direction_enum.py | 37 ------- test/test_list_message_item.py | 71 ------------ test/test_lookup_request.py | 60 ---------- test/test_lookup_result.py | 63 ----------- test/test_lookup_status.py | 69 ------------ test/test_lookup_status_enum.py | 37 ------- ...est_machine_detection_complete_callback.py | 70 ------------ test/test_machine_detection_configuration.py | 69 ------------ test/test_machine_detection_mode_enum.py | 37 ------- test/test_machine_detection_result.py | 56 ---------- test/test_media.py | 57 ---------- test/test_media_api.py | 62 ----------- test/test_message.py | 67 ----------- test/test_message_delivered_callback.py | 88 --------------- ...test_message_delivered_callback_message.py | 76 ------------- test/test_message_direction_enum.py | 37 ------- test/test_message_failed_callback.py | 90 --------------- test/test_message_failed_callback_message.py | 77 ------------- test/test_message_request.py | 65 ----------- test/test_message_sending_callback.py | 88 --------------- test/test_message_sending_callback_message.py | 77 ------------- test/test_message_status_enum.py | 37 ------- test/test_message_type_enum.py | 37 ------- test/test_messages_api.py | 48 -------- test/test_messages_list.py | 80 -------------- test/test_messaging_code_response.py | 55 --------- test/test_messaging_request_error.py | 58 ---------- test/test_mfa_api.py | 55 --------- test/test_mfa_forbidden_request_error.py | 55 --------- test/test_mfa_request_error.py | 56 ---------- test/test_mfa_unauthorized_request_error.py | 55 --------- test/test_page_info.py | 58 ---------- test/test_phone_number_lookup_api.py | 48 -------- test/test_priority_enum.py | 37 ------- test/test_recording_available_callback.py | 76 ------------- test/test_recording_complete_callback.py | 76 ------------- test/test_recording_state_enum.py | 37 ------- test/test_recordings_api.py | 104 ------------------ test/test_redirect_callback.py | 70 ------------ test/test_redirect_method_enum.py | 37 ------- test/test_statistics_api.py | 41 ------- test/test_stir_shaken.py | 57 ---------- test/test_tag.py | 56 ---------- test/test_tn_lookup_request_error.py | 55 --------- test/test_transcribe_recording.py | 61 ---------- test/test_transcription.py | 56 ---------- test/test_transcription_available_callback.py | 77 ------------- test/test_transcription_list.py | 59 ---------- test/test_transcription_metadata.py | 58 ---------- test/test_transfer_answer_callback.py | 69 ------------ test/test_transfer_complete_callback.py | 72 ------------ test/test_transfer_disconnect_callback.py | 74 ------------- test/test_update_call.py | 64 ----------- test/test_update_call_recording.py | 56 ---------- test/test_update_conference.py | 63 ----------- test/test_update_conference_member.py | 57 ---------- test/test_verify_code_request.py | 61 ---------- test/test_verify_code_response.py | 55 --------- test/test_voice_api_error.py | 57 ---------- test/test_voice_code_response.py | 55 --------- test/unit/test_calls_api.py | 62 ----------- test/unit/test_conferences_api.py | 97 ---------------- test/unit/test_media_api.py | 62 ----------- test/unit/test_messages_api.py | 48 -------- test/unit/test_mfa_api.py | 55 --------- test/unit/test_phone_number_lookup_api.py | 48 -------- test/unit/test_recordings_api.py | 104 ------------------ 108 files changed, 6417 deletions(-) rename test/integration/{test_calls.py => test_calls_api.py} (100%) rename test/integration/{test_conferences.py => test_conferences_api.py} (100%) rename test/integration/{test_multi_factor_authentication.py => test_mfa_api.py} (100%) rename test/integration/{test_phone_number_lookup.py => test_phone_number_lookup_api.py} (100%) rename test/integration/{test_recordings.py => test_recordings_api.py} (100%) delete mode 100644 test/test_account_statistics.py delete mode 100644 test/test_answer_callback.py delete mode 100644 test/test_bridge_complete_callback.py delete mode 100644 test/test_bridge_target_complete_callback.py delete mode 100644 test/test_call_direction_enum.py delete mode 100644 test/test_call_recording_metadata.py delete mode 100644 test/test_call_state.py delete mode 100644 test/test_call_state_enum.py delete mode 100644 test/test_callback_method_enum.py delete mode 100644 test/test_calls_api.py delete mode 100644 test/test_code_request.py delete mode 100644 test/test_conference.py delete mode 100644 test/test_conference_completed_callback.py delete mode 100644 test/test_conference_created_callback.py delete mode 100644 test/test_conference_member.py delete mode 100644 test/test_conference_member_exit_callback.py delete mode 100644 test/test_conference_member_join_callback.py delete mode 100644 test/test_conference_recording_available_callback.py delete mode 100644 test/test_conference_recording_metadata.py delete mode 100644 test/test_conference_redirect_callback.py delete mode 100644 test/test_conference_state_enum.py delete mode 100644 test/test_conferences_api.py delete mode 100644 test/test_create_call.py delete mode 100644 test/test_create_call_response.py delete mode 100644 test/test_create_lookup_response.py delete mode 100644 test/test_create_message_request_error.py delete mode 100644 test/test_deferred_result.py delete mode 100644 test/test_disconnect_callback.py delete mode 100644 test/test_diversion.py delete mode 100644 test/test_dtmf_callback.py delete mode 100644 test/test_field_error.py delete mode 100644 test/test_file_format_enum.py delete mode 100644 test/test_gather_callback.py delete mode 100644 test/test_inbound_message_callback.py delete mode 100644 test/test_inbound_message_callback_message.py delete mode 100644 test/test_initiate_callback.py delete mode 100644 test/test_list_message_direction_enum.py delete mode 100644 test/test_list_message_item.py delete mode 100644 test/test_lookup_request.py delete mode 100644 test/test_lookup_result.py delete mode 100644 test/test_lookup_status.py delete mode 100644 test/test_lookup_status_enum.py delete mode 100644 test/test_machine_detection_complete_callback.py delete mode 100644 test/test_machine_detection_configuration.py delete mode 100644 test/test_machine_detection_mode_enum.py delete mode 100644 test/test_machine_detection_result.py delete mode 100644 test/test_media.py delete mode 100644 test/test_media_api.py delete mode 100644 test/test_message.py delete mode 100644 test/test_message_delivered_callback.py delete mode 100644 test/test_message_delivered_callback_message.py delete mode 100644 test/test_message_direction_enum.py delete mode 100644 test/test_message_failed_callback.py delete mode 100644 test/test_message_failed_callback_message.py delete mode 100644 test/test_message_request.py delete mode 100644 test/test_message_sending_callback.py delete mode 100644 test/test_message_sending_callback_message.py delete mode 100644 test/test_message_status_enum.py delete mode 100644 test/test_message_type_enum.py delete mode 100644 test/test_messages_api.py delete mode 100644 test/test_messages_list.py delete mode 100644 test/test_messaging_code_response.py delete mode 100644 test/test_messaging_request_error.py delete mode 100644 test/test_mfa_api.py delete mode 100644 test/test_mfa_forbidden_request_error.py delete mode 100644 test/test_mfa_request_error.py delete mode 100644 test/test_mfa_unauthorized_request_error.py delete mode 100644 test/test_page_info.py delete mode 100644 test/test_phone_number_lookup_api.py delete mode 100644 test/test_priority_enum.py delete mode 100644 test/test_recording_available_callback.py delete mode 100644 test/test_recording_complete_callback.py delete mode 100644 test/test_recording_state_enum.py delete mode 100644 test/test_recordings_api.py delete mode 100644 test/test_redirect_callback.py delete mode 100644 test/test_redirect_method_enum.py delete mode 100644 test/test_statistics_api.py delete mode 100644 test/test_stir_shaken.py delete mode 100644 test/test_tag.py delete mode 100644 test/test_tn_lookup_request_error.py delete mode 100644 test/test_transcribe_recording.py delete mode 100644 test/test_transcription.py delete mode 100644 test/test_transcription_available_callback.py delete mode 100644 test/test_transcription_list.py delete mode 100644 test/test_transcription_metadata.py delete mode 100644 test/test_transfer_answer_callback.py delete mode 100644 test/test_transfer_complete_callback.py delete mode 100644 test/test_transfer_disconnect_callback.py delete mode 100644 test/test_update_call.py delete mode 100644 test/test_update_call_recording.py delete mode 100644 test/test_update_conference.py delete mode 100644 test/test_update_conference_member.py delete mode 100644 test/test_verify_code_request.py delete mode 100644 test/test_verify_code_response.py delete mode 100644 test/test_voice_api_error.py delete mode 100644 test/test_voice_code_response.py delete mode 100644 test/unit/test_calls_api.py delete mode 100644 test/unit/test_conferences_api.py delete mode 100644 test/unit/test_media_api.py delete mode 100644 test/unit/test_messages_api.py delete mode 100644 test/unit/test_mfa_api.py delete mode 100644 test/unit/test_phone_number_lookup_api.py delete mode 100644 test/unit/test_recordings_api.py diff --git a/test/integration/test_calls.py b/test/integration/test_calls_api.py similarity index 100% rename from test/integration/test_calls.py rename to test/integration/test_calls_api.py diff --git a/test/integration/test_conferences.py b/test/integration/test_conferences_api.py similarity index 100% rename from test/integration/test_conferences.py rename to test/integration/test_conferences_api.py diff --git a/test/integration/test_multi_factor_authentication.py b/test/integration/test_mfa_api.py similarity index 100% rename from test/integration/test_multi_factor_authentication.py rename to test/integration/test_mfa_api.py diff --git a/test/integration/test_phone_number_lookup.py b/test/integration/test_phone_number_lookup_api.py similarity index 100% rename from test/integration/test_phone_number_lookup.py rename to test/integration/test_phone_number_lookup_api.py diff --git a/test/integration/test_recordings.py b/test/integration/test_recordings_api.py similarity index 100% rename from test/integration/test_recordings.py rename to test/integration/test_recordings_api.py diff --git a/test/test_account_statistics.py b/test/test_account_statistics.py deleted file mode 100644 index e7038499..00000000 --- a/test/test_account_statistics.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.account_statistics import AccountStatistics # noqa: E501 -from bandwidth.rest import ApiException - -class TestAccountStatistics(unittest.TestCase): - """AccountStatistics unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test AccountStatistics - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountStatistics` - """ - model = bandwidth.models.account_statistics.AccountStatistics() # noqa: E501 - if include_optional : - return AccountStatistics( - current_call_queue_size = 0, - max_call_queue_size = 900 - ) - else : - return AccountStatistics( - ) - """ - - def testAccountStatistics(self): - """Test AccountStatistics""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_answer_callback.py b/test/test_answer_callback.py deleted file mode 100644 index 94cb3d04..00000000 --- a/test/test_answer_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.answer_callback import AnswerCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestAnswerCallback(unittest.TestCase): - """AnswerCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test AnswerCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AnswerCallback` - """ - model = bandwidth.models.answer_callback.AnswerCallback() # noqa: E501 - if include_optional : - return AnswerCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( - value = 'answering-machine', - duration = 'PT4.9891287S', ) - ) - else : - return AnswerCallback( - ) - """ - - def testAnswerCallback(self): - """Test AnswerCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bridge_complete_callback.py b/test/test_bridge_complete_callback.py deleted file mode 100644 index 38ca08a1..00000000 --- a/test/test_bridge_complete_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestBridgeCompleteCallback(unittest.TestCase): - """BridgeCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test BridgeCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BridgeCompleteCallback` - """ - model = bandwidth.models.bridge_complete_callback.BridgeCompleteCallback() # noqa: E501 - if include_optional : - return BridgeCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return BridgeCompleteCallback( - ) - """ - - def testBridgeCompleteCallback(self): - """Test BridgeCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bridge_target_complete_callback.py b/test/test_bridge_target_complete_callback.py deleted file mode 100644 index 7de38d19..00000000 --- a/test/test_bridge_target_complete_callback.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestBridgeTargetCompleteCallback(unittest.TestCase): - """BridgeTargetCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test BridgeTargetCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BridgeTargetCompleteCallback` - """ - model = bandwidth.models.bridge_target_complete_callback.BridgeTargetCompleteCallback() # noqa: E501 - if include_optional : - return BridgeTargetCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag' - ) - else : - return BridgeTargetCompleteCallback( - ) - """ - - def testBridgeTargetCompleteCallback(self): - """Test BridgeTargetCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_call_direction_enum.py b/test/test_call_direction_enum.py deleted file mode 100644 index 7e7c152f..00000000 --- a/test/test_call_direction_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_direction_enum import CallDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallDirectionEnum(unittest.TestCase): - """CallDirectionEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCallDirectionEnum(self): - """Test CallDirectionEnum""" - # inst = CallDirectionEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_call_recording_metadata.py b/test/test_call_recording_metadata.py deleted file mode 100644 index 6b3e8d9a..00000000 --- a/test/test_call_recording_metadata.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_recording_metadata import CallRecordingMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallRecordingMetadata(unittest.TestCase): - """CallRecordingMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CallRecordingMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CallRecordingMetadata` - """ - model = bandwidth.models.call_recording_metadata.CallRecordingMetadata() # noqa: E501 - if include_optional : - return CallRecordingMetadata( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '920012', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - to = '+15555555555', - var_from = '+15555555555', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - duration = 'PT13.67S', - direction = 'inbound', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - file_format = 'wav', - status = 'completed', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - transcription = bandwidth.models.transcription_metadata.transcriptionMetadata( - id = 't-387bd648-18f3-4823-9d16-746bca0003c9', - status = 'completed', - completed_time = '2022-06-13T18:46:29.715Z', - url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', ) - ) - else : - return CallRecordingMetadata( - ) - """ - - def testCallRecordingMetadata(self): - """Test CallRecordingMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_call_state.py b/test/test_call_state.py deleted file mode 100644 index a0bb02d5..00000000 --- a/test/test_call_state.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_state import CallState # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallState(unittest.TestCase): - """CallState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CallState - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CallState` - """ - model = bandwidth.models.call_state.CallState() # noqa: E501 - if include_optional : - return CallState( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '19195554321', - direction = 'inbound', - state = 'disconnected', - stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, - identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken', - enqueued_time = '2022-06-16T13:15:07.160Z', - start_time = '2022-06-16T13:15:07.160Z', - answer_time = '2022-06-16T13:15:18.126Z', - end_time = '2022-06-16T13:15:18.314Z', - disconnect_cause = '', - error_message = '', - error_id = '', - last_update = '2022-06-16T13:15:18.314Z' - ) - else : - return CallState( - ) - """ - - def testCallState(self): - """Test CallState""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_call_state_enum.py b/test/test_call_state_enum.py deleted file mode 100644 index e4eb0653..00000000 --- a/test/test_call_state_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_state_enum import CallStateEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallStateEnum(unittest.TestCase): - """CallStateEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCallStateEnum(self): - """Test CallStateEnum""" - # inst = CallStateEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_callback_method_enum.py b/test/test_callback_method_enum.py deleted file mode 100644 index a91471a3..00000000 --- a/test/test_callback_method_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.callback_method_enum import CallbackMethodEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallbackMethodEnum(unittest.TestCase): - """CallbackMethodEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCallbackMethodEnum(self): - """Test CallbackMethodEnum""" - # inst = CallbackMethodEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_calls_api.py b/test/test_calls_api.py deleted file mode 100644 index 09019c0b..00000000 --- a/test/test_calls_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.calls_api import CallsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestCallsApi(unittest.TestCase): - """CallsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.calls_api.CallsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_call(self): - """Test case for create_call - - Create Call # noqa: E501 - """ - pass - - def test_get_call_state(self): - """Test case for get_call_state - - Get Call State Information # noqa: E501 - """ - pass - - def test_update_call(self): - """Test case for update_call - - Update Call # noqa: E501 - """ - pass - - def test_update_call_bxml(self): - """Test case for update_call_bxml - - Update Call BXML # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_code_request.py b/test/test_code_request.py deleted file mode 100644 index 9df98c86..00000000 --- a/test/test_code_request.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.code_request import CodeRequest # noqa: E501 -from bandwidth.rest import ApiException - -class TestCodeRequest(unittest.TestCase): - """CodeRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CodeRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CodeRequest` - """ - model = bandwidth.models.code_request.CodeRequest() # noqa: E501 - if include_optional : - return CodeRequest( - to = '+19195551234', - var_from = '+19195554321', - application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', - scope = '2FA', - message = 'Your temporary {NAME} {SCOPE} code is {CODE}', - digits = 6 - ) - else : - return CodeRequest( - to = '+19195551234', - var_from = '+19195554321', - application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', - message = 'Your temporary {NAME} {SCOPE} code is {CODE}', - digits = 6, - ) - """ - - def testCodeRequest(self): - """Test CodeRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference.py b/test/test_conference.py deleted file mode 100644 index 2e83f298..00000000 --- a/test/test_conference.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference import Conference # noqa: E501 -from bandwidth.rest import ApiException - -class TestConference(unittest.TestCase): - """Conference unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Conference - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Conference` - """ - model = bandwidth.models.conference.Conference() # noqa: E501 - if include_optional : - return Conference( - id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - created_time = '2022-06-17T22:19:40.375Z', - completed_time = '2022-06-17T22:20Z', - conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent', - conference_event_method = 'POST', - tag = 'my custom tag', - active_members = [ - bandwidth.models.conference_member.conferenceMember( - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - mute = False, - hold = False, - call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], ) - ] - ) - else : - return Conference( - ) - """ - - def testConference(self): - """Test Conference""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_completed_callback.py b/test/test_conference_completed_callback.py deleted file mode 100644 index 7b4be3bc..00000000 --- a/test/test_conference_completed_callback.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceCompletedCallback(unittest.TestCase): - """ConferenceCompletedCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceCompletedCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceCompletedCallback` - """ - model = bandwidth.models.conference_completed_callback.ConferenceCompletedCallback() # noqa: E501 - if include_optional : - return ConferenceCompletedCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - tag = 'exampleTag' - ) - else : - return ConferenceCompletedCallback( - ) - """ - - def testConferenceCompletedCallback(self): - """Test ConferenceCompletedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_created_callback.py b/test/test_conference_created_callback.py deleted file mode 100644 index af7eff5b..00000000 --- a/test/test_conference_created_callback.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_created_callback import ConferenceCreatedCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceCreatedCallback(unittest.TestCase): - """ConferenceCreatedCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceCreatedCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceCreatedCallback` - """ - model = bandwidth.models.conference_created_callback.ConferenceCreatedCallback() # noqa: E501 - if include_optional : - return ConferenceCreatedCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - tag = 'exampleTag' - ) - else : - return ConferenceCreatedCallback( - ) - """ - - def testConferenceCreatedCallback(self): - """Test ConferenceCreatedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_member.py b/test/test_conference_member.py deleted file mode 100644 index 51222320..00000000 --- a/test/test_conference_member.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_member import ConferenceMember # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceMember(unittest.TestCase): - """ConferenceMember unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceMember - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceMember` - """ - model = bandwidth.models.conference_member.ConferenceMember() # noqa: E501 - if include_optional : - return ConferenceMember( - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - mute = False, - hold = False, - call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] - ) - else : - return ConferenceMember( - ) - """ - - def testConferenceMember(self): - """Test ConferenceMember""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_member_exit_callback.py b/test/test_conference_member_exit_callback.py deleted file mode 100644 index 879b1f4e..00000000 --- a/test/test_conference_member_exit_callback.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceMemberExitCallback(unittest.TestCase): - """ConferenceMemberExitCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceMemberExitCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceMemberExitCallback` - """ - model = bandwidth.models.conference_member_exit_callback.ConferenceMemberExitCallback() # noqa: E501 - if include_optional : - return ConferenceMemberExitCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - tag = 'exampleTag' - ) - else : - return ConferenceMemberExitCallback( - ) - """ - - def testConferenceMemberExitCallback(self): - """Test ConferenceMemberExitCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_member_join_callback.py b/test/test_conference_member_join_callback.py deleted file mode 100644 index be466717..00000000 --- a/test/test_conference_member_join_callback.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceMemberJoinCallback(unittest.TestCase): - """ConferenceMemberJoinCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceMemberJoinCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceMemberJoinCallback` - """ - model = bandwidth.models.conference_member_join_callback.ConferenceMemberJoinCallback() # noqa: E501 - if include_optional : - return ConferenceMemberJoinCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - tag = 'exampleTag' - ) - else : - return ConferenceMemberJoinCallback( - ) - """ - - def testConferenceMemberJoinCallback(self): - """Test ConferenceMemberJoinCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_recording_available_callback.py b/test/test_conference_recording_available_callback.py deleted file mode 100644 index 91de9b94..00000000 --- a/test/test_conference_recording_available_callback.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceRecordingAvailableCallback(unittest.TestCase): - """ConferenceRecordingAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceRecordingAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceRecordingAvailableCallback` - """ - model = bandwidth.models.conference_recording_available_callback.ConferenceRecordingAvailableCallback() # noqa: E501 - if include_optional : - return ConferenceRecordingAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - account_id = '920012', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - tag = 'exampleTag', - status = 'completed' - ) - else : - return ConferenceRecordingAvailableCallback( - ) - """ - - def testConferenceRecordingAvailableCallback(self): - """Test ConferenceRecordingAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_recording_metadata.py b/test/test_conference_recording_metadata.py deleted file mode 100644 index 0538c7d2..00000000 --- a/test/test_conference_recording_metadata.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceRecordingMetadata(unittest.TestCase): - """ConferenceRecordingMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceRecordingMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceRecordingMetadata` - """ - model = bandwidth.models.conference_recording_metadata.ConferenceRecordingMetadata() # noqa: E501 - if include_optional : - return ConferenceRecordingMetadata( - account_id = '920012', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - duration = 'PT13.67S', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - file_format = 'wav', - status = 'completed', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' - ) - else : - return ConferenceRecordingMetadata( - ) - """ - - def testConferenceRecordingMetadata(self): - """Test ConferenceRecordingMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_redirect_callback.py b/test/test_conference_redirect_callback.py deleted file mode 100644 index 4edd30dd..00000000 --- a/test/test_conference_redirect_callback.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceRedirectCallback(unittest.TestCase): - """ConferenceRedirectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceRedirectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceRedirectCallback` - """ - model = bandwidth.models.conference_redirect_callback.ConferenceRedirectCallback() # noqa: E501 - if include_optional : - return ConferenceRedirectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - tag = 'exampleTag' - ) - else : - return ConferenceRedirectCallback( - ) - """ - - def testConferenceRedirectCallback(self): - """Test ConferenceRedirectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conference_state_enum.py b/test/test_conference_state_enum.py deleted file mode 100644 index 87caff31..00000000 --- a/test/test_conference_state_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_state_enum import ConferenceStateEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceStateEnum(unittest.TestCase): - """ConferenceStateEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testConferenceStateEnum(self): - """Test ConferenceStateEnum""" - # inst = ConferenceStateEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_conferences_api.py b/test/test_conferences_api.py deleted file mode 100644 index 40eed969..00000000 --- a/test/test_conferences_api.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.conferences_api import ConferencesApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestConferencesApi(unittest.TestCase): - """ConferencesApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.conferences_api.ConferencesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_download_conference_recording(self): - """Test case for download_conference_recording - - Download Conference Recording # noqa: E501 - """ - pass - - def test_get_conference(self): - """Test case for get_conference - - Get Conference Information # noqa: E501 - """ - pass - - def test_get_conference_member(self): - """Test case for get_conference_member - - Get Conference Member # noqa: E501 - """ - pass - - def test_get_conference_recording(self): - """Test case for get_conference_recording - - Get Conference Recording Information # noqa: E501 - """ - pass - - def test_list_conference_recordings(self): - """Test case for list_conference_recordings - - Get Conference Recordings # noqa: E501 - """ - pass - - def test_list_conferences(self): - """Test case for list_conferences - - Get Conferences # noqa: E501 - """ - pass - - def test_update_conference(self): - """Test case for update_conference - - Update Conference # noqa: E501 - """ - pass - - def test_update_conference_bxml(self): - """Test case for update_conference_bxml - - Update Conference BXML # noqa: E501 - """ - pass - - def test_update_conference_member(self): - """Test case for update_conference_member - - Update Conference Member # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_call.py b/test/test_create_call.py deleted file mode 100644 index 2aa1ef1b..00000000 --- a/test/test_create_call.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_call import CreateCall # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateCall(unittest.TestCase): - """CreateCall unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateCall - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateCall` - """ - model = bandwidth.models.create_call.CreateCall() # noqa: E501 - if include_optional : - return CreateCall( - to = '+19195551234', - var_from = '+19195554321', - display_name = 'John Doe', - uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64', - application_id = '1234-qwer-5679-tyui', - answer_url = 'https://www.myCallbackServer.example/webhooks/answer', - answer_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer', - answer_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect', - disconnect_method = 'POST', - call_timeout = 30, - callback_timeout = 15, - machine_detection = bandwidth.models.machine_detection_configuration.machineDetectionConfiguration( - mode = 'async', - detection_timeout = 15, - silence_timeout = 10, - speech_threshold = 10, - speech_end_threshold = 5, - machine_speech_end_threshold = 5, - delay_result = False, - callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', - fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', ), - priority = 5, - tag = 'arbitrary text here' - ) - else : - return CreateCall( - to = '+19195551234', - var_from = '+19195554321', - application_id = '1234-qwer-5679-tyui', - answer_url = 'https://www.myCallbackServer.example/webhooks/answer', - ) - """ - - def testCreateCall(self): - """Test CreateCall""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_call_response.py b/test/test_create_call_response.py deleted file mode 100644 index deeb0bd2..00000000 --- a/test/test_create_call_response.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_call_response import CreateCallResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateCallResponse(unittest.TestCase): - """CreateCallResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateCallResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateCallResponse` - """ - model = bandwidth.models.create_call_response.CreateCallResponse() # noqa: E501 - if include_optional : - return CreateCallResponse( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '+19195554321', - enqueued_time = '2022-06-16T13:15:07.160Z', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_timeout = 30, - callback_timeout = 15, - tag = 'My custom tag value', - answer_method = 'POST', - answer_url = 'https://myServer.example/bandwidth/webhooks/answer', - answer_fallback_method = 'POST', - answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer', - disconnect_method = 'POST', - disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - priority = 5 - ) - else : - return CreateCallResponse( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '+19195554321', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - answer_method = 'POST', - answer_url = 'https://myServer.example/bandwidth/webhooks/answer', - disconnect_method = 'POST', - ) - """ - - def testCreateCallResponse(self): - """Test CreateCallResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_lookup_response.py b/test/test_create_lookup_response.py deleted file mode 100644 index 73081e2a..00000000 --- a/test/test_create_lookup_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_lookup_response import CreateLookupResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateLookupResponse(unittest.TestCase): - """CreateLookupResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateLookupResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateLookupResponse` - """ - model = bandwidth.models.create_lookup_response.CreateLookupResponse() # noqa: E501 - if include_optional : - return CreateLookupResponse( - request_id = '', - status = 'COMPLETE' - ) - else : - return CreateLookupResponse( - ) - """ - - def testCreateLookupResponse(self): - """Test CreateLookupResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_message_request_error.py b/test/test_create_message_request_error.py deleted file mode 100644 index 031fe199..00000000 --- a/test/test_create_message_request_error.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_message_request_error import CreateMessageRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateMessageRequestError(unittest.TestCase): - """CreateMessageRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateMessageRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateMessageRequestError` - """ - model = bandwidth.models.create_message_request_error.CreateMessageRequestError() # noqa: E501 - if include_optional : - return CreateMessageRequestError( - type = '', - description = '', - field_errors = [ - bandwidth.models.field_error.fieldError( - field_name = 'from', - description = ''+invalid' must be replaced with a valid E164 formatted telephone number', ) - ] - ) - else : - return CreateMessageRequestError( - type = '', - description = '', - ) - """ - - def testCreateMessageRequestError(self): - """Test CreateMessageRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_deferred_result.py b/test/test_deferred_result.py deleted file mode 100644 index e9a0fee8..00000000 --- a/test/test_deferred_result.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.deferred_result import DeferredResult # noqa: E501 -from bandwidth.rest import ApiException - -class TestDeferredResult(unittest.TestCase): - """DeferredResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DeferredResult - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DeferredResult` - """ - model = bandwidth.models.deferred_result.DeferredResult() # noqa: E501 - if include_optional : - return DeferredResult( - result = None, - set_or_expired = True - ) - else : - return DeferredResult( - ) - """ - - def testDeferredResult(self): - """Test DeferredResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_disconnect_callback.py b/test/test_disconnect_callback.py deleted file mode 100644 index 7efc4c10..00000000 --- a/test/test_disconnect_callback.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.disconnect_callback import DisconnectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestDisconnectCallback(unittest.TestCase): - """DisconnectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DisconnectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DisconnectCallback` - """ - model = bandwidth.models.disconnect_callback.DisconnectCallback() # noqa: E501 - if include_optional : - return DisconnectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - direction = 'inbound', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765', - tag = 'exampleTag' - ) - else : - return DisconnectCallback( - ) - """ - - def testDisconnectCallback(self): - """Test DisconnectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_diversion.py b/test/test_diversion.py deleted file mode 100644 index 6109e693..00000000 --- a/test/test_diversion.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.diversion import Diversion # noqa: E501 -from bandwidth.rest import ApiException - -class TestDiversion(unittest.TestCase): - """Diversion unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Diversion - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Diversion` - """ - model = bandwidth.models.diversion.Diversion() # noqa: E501 - if include_optional : - return Diversion( - reason = 'unavailable', - privacy = 'off', - screen = 'no', - counter = '2', - limit = '3', - unknown = 'unknownValue', - orig_to = '+15558884444' - ) - else : - return Diversion( - ) - """ - - def testDiversion(self): - """Test Diversion""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_dtmf_callback.py b/test/test_dtmf_callback.py deleted file mode 100644 index 10091a99..00000000 --- a/test/test_dtmf_callback.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.dtmf_callback import DtmfCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestDtmfCallback(unittest.TestCase): - """DtmfCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DtmfCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DtmfCallback` - """ - model = bandwidth.models.dtmf_callback.DtmfCallback() # noqa: E501 - if include_optional : - return DtmfCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - direction = 'inbound', - digit = '2', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - tag = 'exampleTag' - ) - else : - return DtmfCallback( - ) - """ - - def testDtmfCallback(self): - """Test DtmfCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_field_error.py b/test/test_field_error.py deleted file mode 100644 index 77e049c6..00000000 --- a/test/test_field_error.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.field_error import FieldError # noqa: E501 -from bandwidth.rest import ApiException - -class TestFieldError(unittest.TestCase): - """FieldError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test FieldError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `FieldError` - """ - model = bandwidth.models.field_error.FieldError() # noqa: E501 - if include_optional : - return FieldError( - field_name = 'from', - description = ''+invalid' must be replaced with a valid E164 formatted telephone number' - ) - else : - return FieldError( - ) - """ - - def testFieldError(self): - """Test FieldError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_file_format_enum.py b/test/test_file_format_enum.py deleted file mode 100644 index 40cf27e0..00000000 --- a/test/test_file_format_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.file_format_enum import FileFormatEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestFileFormatEnum(unittest.TestCase): - """FileFormatEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileFormatEnum(self): - """Test FileFormatEnum""" - # inst = FileFormatEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_gather_callback.py b/test/test_gather_callback.py deleted file mode 100644 index dae61d55..00000000 --- a/test/test_gather_callback.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.gather_callback import GatherCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestGatherCallback(unittest.TestCase): - """GatherCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test GatherCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `GatherCallback` - """ - model = bandwidth.models.gather_callback.GatherCallback() # noqa: E501 - if include_optional : - return GatherCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - digits = '123', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - terminating_digit = '#', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - tag = 'exampleTag' - ) - else : - return GatherCallback( - ) - """ - - def testGatherCallback(self): - """Test GatherCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inbound_message_callback.py b/test/test_inbound_message_callback.py deleted file mode 100644 index d0264bc2..00000000 --- a/test/test_inbound_message_callback.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.inbound_message_callback import InboundMessageCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestInboundMessageCallback(unittest.TestCase): - """InboundMessageCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InboundMessageCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InboundMessageCallback` - """ - model = bandwidth.models.inbound_message_callback.InboundMessageCallback() # noqa: E501 - if include_optional : - return InboundMessageCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-received', - to = '+15552223333', - description = 'Incoming message received', - message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - ) - else : - return InboundMessageCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-received', - to = '+15552223333', - description = 'Incoming message received', - message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - ) - """ - - def testInboundMessageCallback(self): - """Test InboundMessageCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inbound_message_callback_message.py b/test/test_inbound_message_callback_message.py deleted file mode 100644 index 35126e7d..00000000 --- a/test/test_inbound_message_callback_message.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException - -class TestInboundMessageCallbackMessage(unittest.TestCase): - """InboundMessageCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InboundMessageCallbackMessage - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InboundMessageCallbackMessage` - """ - model = bandwidth.models.inbound_message_callback_message.InboundMessageCallbackMessage() # noqa: E501 - if include_optional : - return InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else : - return InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - ) - """ - - def testInboundMessageCallbackMessage(self): - """Test InboundMessageCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_initiate_callback.py b/test/test_initiate_callback.py deleted file mode 100644 index 49014cae..00000000 --- a/test/test_initiate_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.initiate_callback import InitiateCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestInitiateCallback(unittest.TestCase): - """InitiateCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InitiateCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InitiateCallback` - """ - model = bandwidth.models.initiate_callback.InitiateCallback() # noqa: E501 - if include_optional : - return InitiateCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - start_time = '2022-06-17T22:19:40.375Z', - diversion = bandwidth.models.diversion.diversion( - reason = 'unavailable', - privacy = 'off', - screen = 'no', - counter = '2', - limit = '3', - unknown = 'unknownValue', - orig_to = '+15558884444', ), - stir_shaken = bandwidth.models.stir_shaken.stirShaken( - verstat = 'Tn-Verification-Passed', - attestation_indicator = 'A', - originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', ) - ) - else : - return InitiateCallback( - ) - """ - - def testInitiateCallback(self): - """Test InitiateCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_message_direction_enum.py b/test/test_list_message_direction_enum.py deleted file mode 100644 index 72ac6efe..00000000 --- a/test/test_list_message_direction_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestListMessageDirectionEnum(unittest.TestCase): - """ListMessageDirectionEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListMessageDirectionEnum(self): - """Test ListMessageDirectionEnum""" - # inst = ListMessageDirectionEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_message_item.py b/test/test_list_message_item.py deleted file mode 100644 index 9b549595..00000000 --- a/test/test_list_message_item.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.list_message_item import ListMessageItem # noqa: E501 -from bandwidth.rest import ApiException - -class TestListMessageItem(unittest.TestCase): - """ListMessageItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ListMessageItem - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ListMessageItem` - """ - model = bandwidth.models.list_message_item.ListMessageItem() # noqa: E501 - if include_optional : - return ListMessageItem( - message_id = '1589228074636lm4k2je7j7jklbn2', - account_id = '9900000', - source_tn = '+15554443333', - destination_tn = '+15554442222', - message_status = 'RECEIVED', - message_direction = 'INBOUND', - message_type = 'sms', - segment_count = 1, - error_code = 9902, - receive_time = '2020-04-07T14:03:07Z', - carrier_name = 'other', - message_size = 27, - message_length = 18, - attachment_count = 1, - recipient_count = 1, - campaign_class = 'T', - campaign_id = 'CJEUMDK' - ) - else : - return ListMessageItem( - ) - """ - - def testListMessageItem(self): - """Test ListMessageItem""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lookup_request.py b/test/test_lookup_request.py deleted file mode 100644 index b9d21bce..00000000 --- a/test/test_lookup_request.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_request import LookupRequest # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupRequest(unittest.TestCase): - """LookupRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test LookupRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `LookupRequest` - """ - model = bandwidth.models.lookup_request.LookupRequest() # noqa: E501 - if include_optional : - return LookupRequest( - tns = [ - '' - ] - ) - else : - return LookupRequest( - tns = [ - '' - ], - ) - """ - - def testLookupRequest(self): - """Test LookupRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lookup_result.py b/test/test_lookup_result.py deleted file mode 100644 index 38fd0a33..00000000 --- a/test/test_lookup_result.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_result import LookupResult # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupResult(unittest.TestCase): - """LookupResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test LookupResult - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `LookupResult` - """ - model = bandwidth.models.lookup_result.LookupResult() # noqa: E501 - if include_optional : - return LookupResult( - response_code = 0, - message = 'NOERROR', - e_164_format = '+19195551234', - formatted = '(919) 555-1234', - country = 'US', - line_type = 'Mobile', - line_provider = 'Verizon Wireless', - mobile_country_code = '310', - mobile_network_code = '010' - ) - else : - return LookupResult( - ) - """ - - def testLookupResult(self): - """Test LookupResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lookup_status.py b/test/test_lookup_status.py deleted file mode 100644 index 8be65daf..00000000 --- a/test/test_lookup_status.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_status import LookupStatus # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupStatus(unittest.TestCase): - """LookupStatus unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test LookupStatus - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `LookupStatus` - """ - model = bandwidth.models.lookup_status.LookupStatus() # noqa: E501 - if include_optional : - return LookupStatus( - request_id = '004223a0-8b17-41b1-bf81-20732adf5590', - status = 'COMPLETE', - result = [ - bandwidth.models.lookup_result.lookupResult( - response_code = 0, - message = 'NOERROR', - e/164_format = '+19195551234', - formatted = '(919) 555-1234', - country = 'US', - line_type = 'Mobile', - line_provider = 'Verizon Wireless', - mobile_country_code = '310', - mobile_network_code = '010', ) - ], - failed_telephone_numbers = ["+191955512345"] - ) - else : - return LookupStatus( - ) - """ - - def testLookupStatus(self): - """Test LookupStatus""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lookup_status_enum.py b/test/test_lookup_status_enum.py deleted file mode 100644 index abb4208e..00000000 --- a/test/test_lookup_status_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_status_enum import LookupStatusEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupStatusEnum(unittest.TestCase): - """LookupStatusEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLookupStatusEnum(self): - """Test LookupStatusEnum""" - # inst = LookupStatusEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_machine_detection_complete_callback.py b/test/test_machine_detection_complete_callback.py deleted file mode 100644 index f39febb4..00000000 --- a/test/test_machine_detection_complete_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionCompleteCallback(unittest.TestCase): - """MachineDetectionCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MachineDetectionCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MachineDetectionCompleteCallback` - """ - model = bandwidth.models.machine_detection_complete_callback.MachineDetectionCompleteCallback() # noqa: E501 - if include_optional : - return MachineDetectionCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( - value = 'answering-machine', - duration = 'PT4.9891287S', ) - ) - else : - return MachineDetectionCompleteCallback( - ) - """ - - def testMachineDetectionCompleteCallback(self): - """Test MachineDetectionCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_machine_detection_configuration.py b/test/test_machine_detection_configuration.py deleted file mode 100644 index 2bb49ef7..00000000 --- a/test/test_machine_detection_configuration.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionConfiguration(unittest.TestCase): - """MachineDetectionConfiguration unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MachineDetectionConfiguration - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MachineDetectionConfiguration` - """ - model = bandwidth.models.machine_detection_configuration.MachineDetectionConfiguration() # noqa: E501 - if include_optional : - return MachineDetectionConfiguration( - mode = 'async', - detection_timeout = 15, - silence_timeout = 10, - speech_threshold = 10, - speech_end_threshold = 5, - machine_speech_end_threshold = 5, - delay_result = False, - callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', - fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!' - ) - else : - return MachineDetectionConfiguration( - ) - """ - - def testMachineDetectionConfiguration(self): - """Test MachineDetectionConfiguration""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_machine_detection_mode_enum.py b/test/test_machine_detection_mode_enum.py deleted file mode 100644 index 78928e99..00000000 --- a/test/test_machine_detection_mode_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionModeEnum(unittest.TestCase): - """MachineDetectionModeEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMachineDetectionModeEnum(self): - """Test MachineDetectionModeEnum""" - # inst = MachineDetectionModeEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_machine_detection_result.py b/test/test_machine_detection_result.py deleted file mode 100644 index 845d3360..00000000 --- a/test/test_machine_detection_result.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_result import MachineDetectionResult # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionResult(unittest.TestCase): - """MachineDetectionResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MachineDetectionResult - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MachineDetectionResult` - """ - model = bandwidth.models.machine_detection_result.MachineDetectionResult() # noqa: E501 - if include_optional : - return MachineDetectionResult( - value = 'answering-machine', - duration = 'PT4.9891287S' - ) - else : - return MachineDetectionResult( - ) - """ - - def testMachineDetectionResult(self): - """Test MachineDetectionResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_media.py b/test/test_media.py deleted file mode 100644 index 62011240..00000000 --- a/test/test_media.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.media import Media # noqa: E501 -from bandwidth.rest import ApiException - -class TestMedia(unittest.TestCase): - """Media unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Media - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Media` - """ - model = bandwidth.models.media.Media() # noqa: E501 - if include_optional : - return Media( - content = '', - content_length = 56, - media_name = '' - ) - else : - return Media( - ) - """ - - def testMedia(self): - """Test Media""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_media_api.py b/test/test_media_api.py deleted file mode 100644 index 2b6ae425..00000000 --- a/test/test_media_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.media_api import MediaApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMediaApi(unittest.TestCase): - """MediaApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.media_api.MediaApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_media(self): - """Test case for delete_media - - Delete Media # noqa: E501 - """ - pass - - def test_get_media(self): - """Test case for get_media - - Get Media # noqa: E501 - """ - pass - - def test_list_media(self): - """Test case for list_media - - List Media # noqa: E501 - """ - pass - - def test_upload_media(self): - """Test case for upload_media - - Upload Media # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message.py b/test/test_message.py deleted file mode 100644 index b441fda4..00000000 --- a/test/test_message.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message import Message # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessage(unittest.TestCase): - """Message unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Message - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Message` - """ - model = bandwidth.models.message.Message() # noqa: E501 - if include_optional : - return Message( - id = '1589228074636lm4k2je7j7jklbn2', - owner = '+15554443333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2022-09-14T18:20:16Z', - segment_count = 2, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"], - text = 'Hello world', - tag = 'custom tag', - priority = 'default', - expiration = '2021-02-01T11:29:18-05:00' - ) - else : - return Message( - ) - """ - - def testMessage(self): - """Test Message""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_delivered_callback.py b/test/test_message_delivered_callback.py deleted file mode 100644 index 28a9f494..00000000 --- a/test/test_message_delivered_callback.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageDeliveredCallback(unittest.TestCase): - """MessageDeliveredCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageDeliveredCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageDeliveredCallback` - """ - model = bandwidth.models.message_delivered_callback.MessageDeliveredCallback() # noqa: E501 - if include_optional : - return MessageDeliveredCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-delivered', - to = '+15552223333', - description = 'Message delivered to carrier.', - message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - ) - else : - return MessageDeliveredCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-delivered', - to = '+15552223333', - description = 'Message delivered to carrier.', - message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - ) - """ - - def testMessageDeliveredCallback(self): - """Test MessageDeliveredCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_delivered_callback_message.py b/test/test_message_delivered_callback_message.py deleted file mode 100644 index b7b31569..00000000 --- a/test/test_message_delivered_callback_message.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageDeliveredCallbackMessage(unittest.TestCase): - """MessageDeliveredCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageDeliveredCallbackMessage - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageDeliveredCallbackMessage` - """ - model = bandwidth.models.message_delivered_callback_message.MessageDeliveredCallbackMessage() # noqa: E501 - if include_optional : - return MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else : - return MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - ) - """ - - def testMessageDeliveredCallbackMessage(self): - """Test MessageDeliveredCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_direction_enum.py b/test/test_message_direction_enum.py deleted file mode 100644 index d29a5719..00000000 --- a/test/test_message_direction_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_direction_enum import MessageDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageDirectionEnum(unittest.TestCase): - """MessageDirectionEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessageDirectionEnum(self): - """Test MessageDirectionEnum""" - # inst = MessageDirectionEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_failed_callback.py b/test/test_message_failed_callback.py deleted file mode 100644 index 08699c8b..00000000 --- a/test/test_message_failed_callback.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_failed_callback import MessageFailedCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageFailedCallback(unittest.TestCase): - """MessageFailedCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageFailedCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageFailedCallback` - """ - model = bandwidth.models.message_failed_callback.MessageFailedCallback() # noqa: E501 - if include_optional : - return MessageFailedCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-failed', - to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - error_code = 9902 - ) - else : - return MessageFailedCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-failed', - to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - error_code = 9902, - ) - """ - - def testMessageFailedCallback(self): - """Test MessageFailedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_failed_callback_message.py b/test/test_message_failed_callback_message.py deleted file mode 100644 index 71c42fb5..00000000 --- a/test/test_message_failed_callback_message.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageFailedCallbackMessage(unittest.TestCase): - """MessageFailedCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageFailedCallbackMessage - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageFailedCallbackMessage` - """ - model = bandwidth.models.message_failed_callback_message.MessageFailedCallbackMessage() # noqa: E501 - if include_optional : - return MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else : - return MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - priority = 'default', - ) - """ - - def testMessageFailedCallbackMessage(self): - """Test MessageFailedCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_request.py b/test/test_message_request.py deleted file mode 100644 index 950d437a..00000000 --- a/test/test_message_request.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_request import MessageRequest # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageRequest(unittest.TestCase): - """MessageRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageRequest` - """ - model = bandwidth.models.message_request.MessageRequest() # noqa: E501 - if include_optional : - return MessageRequest( - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - to = ["+15554443333","+15552223333"], - var_from = '+15551113333', - text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - tag = 'custom string', - priority = 'default', - expiration = '2021-02-01T11:29:18-05:00' - ) - else : - return MessageRequest( - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - to = ["+15554443333","+15552223333"], - var_from = '+15551113333', - ) - """ - - def testMessageRequest(self): - """Test MessageRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_sending_callback.py b/test/test_message_sending_callback.py deleted file mode 100644 index b2ab77f3..00000000 --- a/test/test_message_sending_callback.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_sending_callback import MessageSendingCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageSendingCallback(unittest.TestCase): - """MessageSendingCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageSendingCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageSendingCallback` - """ - model = bandwidth.models.message_sending_callback.MessageSendingCallback() # noqa: E501 - if include_optional : - return MessageSendingCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-sending', - to = '+15552223333', - description = 'Message is sending to carrier', - message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - ) - else : - return MessageSendingCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-sending', - to = '+15552223333', - description = 'Message is sending to carrier', - message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - ) - """ - - def testMessageSendingCallback(self): - """Test MessageSendingCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_sending_callback_message.py b/test/test_message_sending_callback_message.py deleted file mode 100644 index 9899720f..00000000 --- a/test/test_message_sending_callback_message.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageSendingCallbackMessage(unittest.TestCase): - """MessageSendingCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessageSendingCallbackMessage - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessageSendingCallbackMessage` - """ - model = bandwidth.models.message_sending_callback_message.MessageSendingCallbackMessage() # noqa: E501 - if include_optional : - return MessageSendingCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else : - return MessageSendingCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', - ) - """ - - def testMessageSendingCallbackMessage(self): - """Test MessageSendingCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_status_enum.py b/test/test_message_status_enum.py deleted file mode 100644 index 91d85764..00000000 --- a/test/test_message_status_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_status_enum import MessageStatusEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageStatusEnum(unittest.TestCase): - """MessageStatusEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessageStatusEnum(self): - """Test MessageStatusEnum""" - # inst = MessageStatusEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_type_enum.py b/test/test_message_type_enum.py deleted file mode 100644 index 05699d58..00000000 --- a/test/test_message_type_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_type_enum import MessageTypeEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageTypeEnum(unittest.TestCase): - """MessageTypeEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessageTypeEnum(self): - """Test MessageTypeEnum""" - # inst = MessageTypeEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messages_api.py b/test/test_messages_api.py deleted file mode 100644 index 17f59e9a..00000000 --- a/test/test_messages_api.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.messages_api import MessagesApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMessagesApi(unittest.TestCase): - """MessagesApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.messages_api.MessagesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_message(self): - """Test case for create_message - - Create Message # noqa: E501 - """ - pass - - def test_list_messages(self): - """Test case for list_messages - - List Messages # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messages_list.py b/test/test_messages_list.py deleted file mode 100644 index f2a556db..00000000 --- a/test/test_messages_list.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.messages_list import MessagesList # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessagesList(unittest.TestCase): - """MessagesList unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessagesList - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessagesList` - """ - model = bandwidth.models.messages_list.MessagesList() # noqa: E501 - if include_optional : - return MessagesList( - total_count = 100, - page_info = bandwidth.models.page_info.PageInfo( - prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', - next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', - prev_page_token = 'DLAPE902', - next_page_token = 'GL83PD3C', ), - messages = [ - bandwidth.models.list_message_item.listMessageItem( - message_id = '1589228074636lm4k2je7j7jklbn2', - account_id = '9900000', - source_tn = '+15554443333', - destination_tn = '+15554442222', - message_status = 'RECEIVED', - message_direction = 'INBOUND', - message_type = 'sms', - segment_count = 1, - error_code = 9902, - receive_time = '2020-04-07T14:03:07Z', - carrier_name = 'other', - message_size = 27, - message_length = 18, - attachment_count = 1, - recipient_count = 1, - campaign_class = 'T', - campaign_id = 'CJEUMDK', ) - ] - ) - else : - return MessagesList( - ) - """ - - def testMessagesList(self): - """Test MessagesList""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messaging_code_response.py b/test/test_messaging_code_response.py deleted file mode 100644 index 53578365..00000000 --- a/test/test_messaging_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.messaging_code_response import MessagingCodeResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessagingCodeResponse(unittest.TestCase): - """MessagingCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessagingCodeResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessagingCodeResponse` - """ - model = bandwidth.models.messaging_code_response.MessagingCodeResponse() # noqa: E501 - if include_optional : - return MessagingCodeResponse( - message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' - ) - else : - return MessagingCodeResponse( - ) - """ - - def testMessagingCodeResponse(self): - """Test MessagingCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messaging_request_error.py b/test/test_messaging_request_error.py deleted file mode 100644 index ec14fc51..00000000 --- a/test/test_messaging_request_error.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.messaging_request_error import MessagingRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessagingRequestError(unittest.TestCase): - """MessagingRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessagingRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessagingRequestError` - """ - model = bandwidth.models.messaging_request_error.MessagingRequestError() # noqa: E501 - if include_optional : - return MessagingRequestError( - type = '', - description = '' - ) - else : - return MessagingRequestError( - type = '', - description = '', - ) - """ - - def testMessagingRequestError(self): - """Test MessagingRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_mfa_api.py b/test/test_mfa_api.py deleted file mode 100644 index 7559e2d8..00000000 --- a/test/test_mfa_api.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.mfa_api import MFAApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMFAApi(unittest.TestCase): - """MFAApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.mfa_api.MFAApi() # noqa: E501 - - def tearDown(self): - pass - - def test_generate_messaging_code(self): - """Test case for generate_messaging_code - - Messaging Authentication Code # noqa: E501 - """ - pass - - def test_generate_voice_code(self): - """Test case for generate_voice_code - - Voice Authentication Code # noqa: E501 - """ - pass - - def test_verify_code(self): - """Test case for verify_code - - Verify Authentication Code # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_mfa_forbidden_request_error.py b/test/test_mfa_forbidden_request_error.py deleted file mode 100644 index 5a754be2..00000000 --- a/test/test_mfa_forbidden_request_error.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestMfaForbiddenRequestError(unittest.TestCase): - """MfaForbiddenRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MfaForbiddenRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MfaForbiddenRequestError` - """ - model = bandwidth.models.mfa_forbidden_request_error.MfaForbiddenRequestError() # noqa: E501 - if include_optional : - return MfaForbiddenRequestError( - message = 'Missing Authentication Token' - ) - else : - return MfaForbiddenRequestError( - ) - """ - - def testMfaForbiddenRequestError(self): - """Test MfaForbiddenRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_mfa_request_error.py b/test/test_mfa_request_error.py deleted file mode 100644 index 2e5423b9..00000000 --- a/test/test_mfa_request_error.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.mfa_request_error import MfaRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestMfaRequestError(unittest.TestCase): - """MfaRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MfaRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MfaRequestError` - """ - model = bandwidth.models.mfa_request_error.MfaRequestError() # noqa: E501 - if include_optional : - return MfaRequestError( - error = '400 Request is malformed or invalid', - request_id = '354cc8a3-6701-461e-8fa7-8671703dd898' - ) - else : - return MfaRequestError( - ) - """ - - def testMfaRequestError(self): - """Test MfaRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_mfa_unauthorized_request_error.py b/test/test_mfa_unauthorized_request_error.py deleted file mode 100644 index c6e719ce..00000000 --- a/test/test_mfa_unauthorized_request_error.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestMfaUnauthorizedRequestError(unittest.TestCase): - """MfaUnauthorizedRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MfaUnauthorizedRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MfaUnauthorizedRequestError` - """ - model = bandwidth.models.mfa_unauthorized_request_error.MfaUnauthorizedRequestError() # noqa: E501 - if include_optional : - return MfaUnauthorizedRequestError( - message = 'Unauthorized' - ) - else : - return MfaUnauthorizedRequestError( - ) - """ - - def testMfaUnauthorizedRequestError(self): - """Test MfaUnauthorizedRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_page_info.py b/test/test_page_info.py deleted file mode 100644 index 07dc573a..00000000 --- a/test/test_page_info.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.page_info import PageInfo # noqa: E501 -from bandwidth.rest import ApiException - -class TestPageInfo(unittest.TestCase): - """PageInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test PageInfo - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PageInfo` - """ - model = bandwidth.models.page_info.PageInfo() # noqa: E501 - if include_optional : - return PageInfo( - prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', - next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', - prev_page_token = 'DLAPE902', - next_page_token = 'GL83PD3C' - ) - else : - return PageInfo( - ) - """ - - def testPageInfo(self): - """Test PageInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_phone_number_lookup_api.py b/test/test_phone_number_lookup_api.py deleted file mode 100644 index bf70014c..00000000 --- a/test/test_phone_number_lookup_api.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestPhoneNumberLookupApi(unittest.TestCase): - """PhoneNumberLookupApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.phone_number_lookup_api.PhoneNumberLookupApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_lookup(self): - """Test case for create_lookup - - Create Lookup # noqa: E501 - """ - pass - - def test_get_lookup_status(self): - """Test case for get_lookup_status - - Get Lookup Request Status # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_priority_enum.py b/test/test_priority_enum.py deleted file mode 100644 index 6111bb1d..00000000 --- a/test/test_priority_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.priority_enum import PriorityEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestPriorityEnum(unittest.TestCase): - """PriorityEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPriorityEnum(self): - """Test PriorityEnum""" - # inst = PriorityEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_recording_available_callback.py b/test/test_recording_available_callback.py deleted file mode 100644 index 09bc1902..00000000 --- a/test/test_recording_available_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.recording_available_callback import RecordingAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRecordingAvailableCallback(unittest.TestCase): - """RecordingAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RecordingAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RecordingAvailableCallback` - """ - model = bandwidth.models.recording_available_callback.RecordingAvailableCallback() # noqa: E501 - if include_optional : - return RecordingAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - channels = 'completed', - tag = 'exampleTag', - status = 'completed', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RecordingAvailableCallback( - ) - """ - - def testRecordingAvailableCallback(self): - """Test RecordingAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_recording_complete_callback.py b/test/test_recording_complete_callback.py deleted file mode 100644 index c8a4c403..00000000 --- a/test/test_recording_complete_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.recording_complete_callback import RecordingCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRecordingCompleteCallback(unittest.TestCase): - """RecordingCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RecordingCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RecordingCompleteCallback` - """ - model = bandwidth.models.recording_complete_callback.RecordingCompleteCallback() # noqa: E501 - if include_optional : - return RecordingCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - channels = 1, - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RecordingCompleteCallback( - ) - """ - - def testRecordingCompleteCallback(self): - """Test RecordingCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_recording_state_enum.py b/test/test_recording_state_enum.py deleted file mode 100644 index de388697..00000000 --- a/test/test_recording_state_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.recording_state_enum import RecordingStateEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestRecordingStateEnum(unittest.TestCase): - """RecordingStateEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRecordingStateEnum(self): - """Test RecordingStateEnum""" - # inst = RecordingStateEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_recordings_api.py b/test/test_recordings_api.py deleted file mode 100644 index c0eb20b4..00000000 --- a/test/test_recordings_api.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.recordings_api import RecordingsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestRecordingsApi(unittest.TestCase): - """RecordingsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.recordings_api.RecordingsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_call_transcription(self): - """Test case for delete_call_transcription - - Delete Transcription # noqa: E501 - """ - pass - - def test_delete_recording(self): - """Test case for delete_recording - - Delete Recording # noqa: E501 - """ - pass - - def test_delete_recording_media(self): - """Test case for delete_recording_media - - Delete Recording Media # noqa: E501 - """ - pass - - def test_download_call_recording(self): - """Test case for download_call_recording - - Download Recording # noqa: E501 - """ - pass - - def test_get_call_recording(self): - """Test case for get_call_recording - - Get Call Recording # noqa: E501 - """ - pass - - def test_get_call_transcription(self): - """Test case for get_call_transcription - - Get Transcription # noqa: E501 - """ - pass - - def test_list_account_call_recordings(self): - """Test case for list_account_call_recordings - - Get Call Recordings # noqa: E501 - """ - pass - - def test_list_call_recordings(self): - """Test case for list_call_recordings - - List Call Recordings # noqa: E501 - """ - pass - - def test_transcribe_call_recording(self): - """Test case for transcribe_call_recording - - Create Transcription Request # noqa: E501 - """ - pass - - def test_update_call_recording_state(self): - """Test case for update_call_recording_state - - Update Recording # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_redirect_callback.py b/test/test_redirect_callback.py deleted file mode 100644 index 83df0c06..00000000 --- a/test/test_redirect_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.redirect_callback import RedirectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRedirectCallback(unittest.TestCase): - """RedirectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RedirectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RedirectCallback` - """ - model = bandwidth.models.redirect_callback.RedirectCallback() # noqa: E501 - if include_optional : - return RedirectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RedirectCallback( - ) - """ - - def testRedirectCallback(self): - """Test RedirectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_redirect_method_enum.py b/test/test_redirect_method_enum.py deleted file mode 100644 index b1908a31..00000000 --- a/test/test_redirect_method_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.redirect_method_enum import RedirectMethodEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestRedirectMethodEnum(unittest.TestCase): - """RedirectMethodEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRedirectMethodEnum(self): - """Test RedirectMethodEnum""" - # inst = RedirectMethodEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_statistics_api.py b/test/test_statistics_api.py deleted file mode 100644 index 103f3da2..00000000 --- a/test/test_statistics_api.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.statistics_api import StatisticsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestStatisticsApi(unittest.TestCase): - """StatisticsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.statistics_api.StatisticsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_statistics(self): - """Test case for get_statistics - - Get Account Statistics # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_stir_shaken.py b/test/test_stir_shaken.py deleted file mode 100644 index 17fff122..00000000 --- a/test/test_stir_shaken.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.stir_shaken import StirShaken # noqa: E501 -from bandwidth.rest import ApiException - -class TestStirShaken(unittest.TestCase): - """StirShaken unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test StirShaken - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `StirShaken` - """ - model = bandwidth.models.stir_shaken.StirShaken() # noqa: E501 - if include_optional : - return StirShaken( - verstat = 'Tn-Verification-Passed', - attestation_indicator = 'A', - originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af' - ) - else : - return StirShaken( - ) - """ - - def testStirShaken(self): - """Test StirShaken""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tag.py b/test/test_tag.py deleted file mode 100644 index c773cad7..00000000 --- a/test/test_tag.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.tag import Tag # noqa: E501 -from bandwidth.rest import ApiException - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Tag - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Tag` - """ - model = bandwidth.models.tag.Tag() # noqa: E501 - if include_optional : - return Tag( - key = '', - value = '' - ) - else : - return Tag( - ) - """ - - def testTag(self): - """Test Tag""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tn_lookup_request_error.py b/test/test_tn_lookup_request_error.py deleted file mode 100644 index ae62fa79..00000000 --- a/test/test_tn_lookup_request_error.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.tn_lookup_request_error import TnLookupRequestError # noqa: E501 -from bandwidth.rest import ApiException - -class TestTnLookupRequestError(unittest.TestCase): - """TnLookupRequestError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TnLookupRequestError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TnLookupRequestError` - """ - model = bandwidth.models.tn_lookup_request_error.TnLookupRequestError() # noqa: E501 - if include_optional : - return TnLookupRequestError( - message = 'example error message' - ) - else : - return TnLookupRequestError( - ) - """ - - def testTnLookupRequestError(self): - """Test TnLookupRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transcribe_recording.py b/test/test_transcribe_recording.py deleted file mode 100644 index 6bc69901..00000000 --- a/test/test_transcribe_recording.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcribe_recording import TranscribeRecording # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscribeRecording(unittest.TestCase): - """TranscribeRecording unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscribeRecording - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscribeRecording` - """ - model = bandwidth.models.transcribe_recording.TranscribeRecording() # noqa: E501 - if include_optional : - return TranscribeRecording( - callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - tag = 'exampleTag', - callback_timeout = 5.5, - detect_language = True - ) - else : - return TranscribeRecording( - ) - """ - - def testTranscribeRecording(self): - """Test TranscribeRecording""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transcription.py b/test/test_transcription.py deleted file mode 100644 index 0913bc68..00000000 --- a/test/test_transcription.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription import Transcription # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscription(unittest.TestCase): - """Transcription unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Transcription - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Transcription` - """ - model = bandwidth.models.transcription.Transcription() # noqa: E501 - if include_optional : - return Transcription( - text = 'Nice talking to you, friend!', - confidence = 0.9 - ) - else : - return Transcription( - ) - """ - - def testTranscription(self): - """Test Transcription""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transcription_available_callback.py b/test/test_transcription_available_callback.py deleted file mode 100644 index 2cd8ea3e..00000000 --- a/test/test_transcription_available_callback.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionAvailableCallback(unittest.TestCase): - """TranscriptionAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionAvailableCallback` - """ - model = bandwidth.models.transcription_available_callback.TranscriptionAvailableCallback() # noqa: E501 - if include_optional : - return TranscriptionAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - tag = 'exampleTag', - transcription = bandwidth.models.transcription.transcription( - text = 'Nice talking to you, friend!', - confidence = 0.9, ), - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return TranscriptionAvailableCallback( - ) - """ - - def testTranscriptionAvailableCallback(self): - """Test TranscriptionAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transcription_list.py b/test/test_transcription_list.py deleted file mode 100644 index cba18c12..00000000 --- a/test/test_transcription_list.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_list import TranscriptionList # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionList(unittest.TestCase): - """TranscriptionList unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionList - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionList` - """ - model = bandwidth.models.transcription_list.TranscriptionList() # noqa: E501 - if include_optional : - return TranscriptionList( - transcripts = [ - bandwidth.models.transcription.transcription( - text = 'Nice talking to you, friend!', - confidence = 0.9, ) - ] - ) - else : - return TranscriptionList( - ) - """ - - def testTranscriptionList(self): - """Test TranscriptionList""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transcription_metadata.py b/test/test_transcription_metadata.py deleted file mode 100644 index 721ecb71..00000000 --- a/test/test_transcription_metadata.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_metadata import TranscriptionMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionMetadata(unittest.TestCase): - """TranscriptionMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionMetadata` - """ - model = bandwidth.models.transcription_metadata.TranscriptionMetadata() # noqa: E501 - if include_optional : - return TranscriptionMetadata( - id = 't-387bd648-18f3-4823-9d16-746bca0003c9', - status = 'completed', - completed_time = '2022-06-13T18:46:29.715Z', - url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' - ) - else : - return TranscriptionMetadata( - ) - """ - - def testTranscriptionMetadata(self): - """Test TranscriptionMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transfer_answer_callback.py b/test/test_transfer_answer_callback.py deleted file mode 100644 index b010211f..00000000 --- a/test/test_transfer_answer_callback.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_answer_callback import TransferAnswerCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferAnswerCallback(unittest.TestCase): - """TransferAnswerCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferAnswerCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferAnswerCallback` - """ - model = bandwidth.models.transfer_answer_callback.TransferAnswerCallback() # noqa: E501 - if include_optional : - return TransferAnswerCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return TransferAnswerCallback( - ) - """ - - def testTransferAnswerCallback(self): - """Test TransferAnswerCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transfer_complete_callback.py b/test/test_transfer_complete_callback.py deleted file mode 100644 index 70dab471..00000000 --- a/test/test_transfer_complete_callback.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_complete_callback import TransferCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferCompleteCallback(unittest.TestCase): - """TransferCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferCompleteCallback` - """ - model = bandwidth.models.transfer_complete_callback.TransferCompleteCallback() # noqa: E501 - if include_optional : - return TransferCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return TransferCompleteCallback( - ) - """ - - def testTransferCompleteCallback(self): - """Test TransferCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transfer_disconnect_callback.py b/test/test_transfer_disconnect_callback.py deleted file mode 100644 index 5fcf35d6..00000000 --- a/test/test_transfer_disconnect_callback.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferDisconnectCallback(unittest.TestCase): - """TransferDisconnectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferDisconnectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferDisconnectCallback` - """ - model = bandwidth.models.transfer_disconnect_callback.TransferDisconnectCallback() # noqa: E501 - if include_optional : - return TransferDisconnectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return TransferDisconnectCallback( - ) - """ - - def testTransferDisconnectCallback(self): - """Test TransferDisconnectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_call.py b/test/test_update_call.py deleted file mode 100644 index a9ed57bd..00000000 --- a/test/test_update_call.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_call import UpdateCall # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateCall(unittest.TestCase): - """UpdateCall unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateCall - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateCall` - """ - model = bandwidth.models.update_call.UpdateCall() # noqa: E501 - if include_optional : - return UpdateCall( - state = 'active', - redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect', - redirect_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect', - redirect_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - tag = 'My Custom Tag' - ) - else : - return UpdateCall( - ) - """ - - def testUpdateCall(self): - """Test UpdateCall""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_call_recording.py b/test/test_update_call_recording.py deleted file mode 100644 index a853acac..00000000 --- a/test/test_update_call_recording.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_call_recording import UpdateCallRecording # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateCallRecording(unittest.TestCase): - """UpdateCallRecording unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateCallRecording - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateCallRecording` - """ - model = bandwidth.models.update_call_recording.UpdateCallRecording() # noqa: E501 - if include_optional : - return UpdateCallRecording( - state = 'paused' - ) - else : - return UpdateCallRecording( - state = 'paused', - ) - """ - - def testUpdateCallRecording(self): - """Test UpdateCallRecording""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_conference.py b/test/test_update_conference.py deleted file mode 100644 index ddf8509e..00000000 --- a/test/test_update_conference.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_conference import UpdateConference # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateConference(unittest.TestCase): - """UpdateConference unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateConference - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateConference` - """ - model = bandwidth.models.update_conference.UpdateConference() # noqa: E501 - if include_optional : - return UpdateConference( - status = 'active', - redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect', - redirect_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect', - redirect_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!' - ) - else : - return UpdateConference( - ) - """ - - def testUpdateConference(self): - """Test UpdateConference""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_conference_member.py b/test/test_update_conference_member.py deleted file mode 100644 index 0f153ff4..00000000 --- a/test/test_update_conference_member.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_conference_member import UpdateConferenceMember # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateConferenceMember(unittest.TestCase): - """UpdateConferenceMember unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateConferenceMember - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateConferenceMember` - """ - model = bandwidth.models.update_conference_member.UpdateConferenceMember() # noqa: E501 - if include_optional : - return UpdateConferenceMember( - mute = False, - hold = False, - call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] - ) - else : - return UpdateConferenceMember( - ) - """ - - def testUpdateConferenceMember(self): - """Test UpdateConferenceMember""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_verify_code_request.py b/test/test_verify_code_request.py deleted file mode 100644 index 5cefb99a..00000000 --- a/test/test_verify_code_request.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.verify_code_request import VerifyCodeRequest # noqa: E501 -from bandwidth.rest import ApiException - -class TestVerifyCodeRequest(unittest.TestCase): - """VerifyCodeRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test VerifyCodeRequest - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `VerifyCodeRequest` - """ - model = bandwidth.models.verify_code_request.VerifyCodeRequest() # noqa: E501 - if include_optional : - return VerifyCodeRequest( - to = '+19195551234', - scope = '2FA', - expiration_time_in_minutes = 3, - code = '123456' - ) - else : - return VerifyCodeRequest( - to = '+19195551234', - expiration_time_in_minutes = 3, - code = '123456', - ) - """ - - def testVerifyCodeRequest(self): - """Test VerifyCodeRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_verify_code_response.py b/test/test_verify_code_response.py deleted file mode 100644 index e335d611..00000000 --- a/test/test_verify_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.verify_code_response import VerifyCodeResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestVerifyCodeResponse(unittest.TestCase): - """VerifyCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test VerifyCodeResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `VerifyCodeResponse` - """ - model = bandwidth.models.verify_code_response.VerifyCodeResponse() # noqa: E501 - if include_optional : - return VerifyCodeResponse( - valid = True - ) - else : - return VerifyCodeResponse( - ) - """ - - def testVerifyCodeResponse(self): - """Test VerifyCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_voice_api_error.py b/test/test_voice_api_error.py deleted file mode 100644 index 837b75c6..00000000 --- a/test/test_voice_api_error.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.voice_api_error import VoiceApiError # noqa: E501 -from bandwidth.rest import ApiException - -class TestVoiceApiError(unittest.TestCase): - """VoiceApiError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test VoiceApiError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `VoiceApiError` - """ - model = bandwidth.models.voice_api_error.VoiceApiError() # noqa: E501 - if include_optional : - return VoiceApiError( - type = '', - description = '', - id = '' - ) - else : - return VoiceApiError( - ) - """ - - def testVoiceApiError(self): - """Test VoiceApiError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_voice_code_response.py b/test/test_voice_code_response.py deleted file mode 100644 index 71950960..00000000 --- a/test/test_voice_code_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.voice_code_response import VoiceCodeResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestVoiceCodeResponse(unittest.TestCase): - """VoiceCodeResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test VoiceCodeResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `VoiceCodeResponse` - """ - model = bandwidth.models.voice_code_response.VoiceCodeResponse() # noqa: E501 - if include_optional : - return VoiceCodeResponse( - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' - ) - else : - return VoiceCodeResponse( - ) - """ - - def testVoiceCodeResponse(self): - """Test VoiceCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_calls_api.py b/test/unit/test_calls_api.py deleted file mode 100644 index 09019c0b..00000000 --- a/test/unit/test_calls_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.calls_api import CallsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestCallsApi(unittest.TestCase): - """CallsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.calls_api.CallsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_call(self): - """Test case for create_call - - Create Call # noqa: E501 - """ - pass - - def test_get_call_state(self): - """Test case for get_call_state - - Get Call State Information # noqa: E501 - """ - pass - - def test_update_call(self): - """Test case for update_call - - Update Call # noqa: E501 - """ - pass - - def test_update_call_bxml(self): - """Test case for update_call_bxml - - Update Call BXML # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conferences_api.py b/test/unit/test_conferences_api.py deleted file mode 100644 index 40eed969..00000000 --- a/test/unit/test_conferences_api.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.conferences_api import ConferencesApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestConferencesApi(unittest.TestCase): - """ConferencesApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.conferences_api.ConferencesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_download_conference_recording(self): - """Test case for download_conference_recording - - Download Conference Recording # noqa: E501 - """ - pass - - def test_get_conference(self): - """Test case for get_conference - - Get Conference Information # noqa: E501 - """ - pass - - def test_get_conference_member(self): - """Test case for get_conference_member - - Get Conference Member # noqa: E501 - """ - pass - - def test_get_conference_recording(self): - """Test case for get_conference_recording - - Get Conference Recording Information # noqa: E501 - """ - pass - - def test_list_conference_recordings(self): - """Test case for list_conference_recordings - - Get Conference Recordings # noqa: E501 - """ - pass - - def test_list_conferences(self): - """Test case for list_conferences - - Get Conferences # noqa: E501 - """ - pass - - def test_update_conference(self): - """Test case for update_conference - - Update Conference # noqa: E501 - """ - pass - - def test_update_conference_bxml(self): - """Test case for update_conference_bxml - - Update Conference BXML # noqa: E501 - """ - pass - - def test_update_conference_member(self): - """Test case for update_conference_member - - Update Conference Member # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_media_api.py b/test/unit/test_media_api.py deleted file mode 100644 index 2b6ae425..00000000 --- a/test/unit/test_media_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.media_api import MediaApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMediaApi(unittest.TestCase): - """MediaApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.media_api.MediaApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_media(self): - """Test case for delete_media - - Delete Media # noqa: E501 - """ - pass - - def test_get_media(self): - """Test case for get_media - - Get Media # noqa: E501 - """ - pass - - def test_list_media(self): - """Test case for list_media - - List Media # noqa: E501 - """ - pass - - def test_upload_media(self): - """Test case for upload_media - - Upload Media # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_messages_api.py b/test/unit/test_messages_api.py deleted file mode 100644 index 17f59e9a..00000000 --- a/test/unit/test_messages_api.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.messages_api import MessagesApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMessagesApi(unittest.TestCase): - """MessagesApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.messages_api.MessagesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_message(self): - """Test case for create_message - - Create Message # noqa: E501 - """ - pass - - def test_list_messages(self): - """Test case for list_messages - - List Messages # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_mfa_api.py b/test/unit/test_mfa_api.py deleted file mode 100644 index 7559e2d8..00000000 --- a/test/unit/test_mfa_api.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.mfa_api import MFAApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestMFAApi(unittest.TestCase): - """MFAApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.mfa_api.MFAApi() # noqa: E501 - - def tearDown(self): - pass - - def test_generate_messaging_code(self): - """Test case for generate_messaging_code - - Messaging Authentication Code # noqa: E501 - """ - pass - - def test_generate_voice_code(self): - """Test case for generate_voice_code - - Voice Authentication Code # noqa: E501 - """ - pass - - def test_verify_code(self): - """Test case for verify_code - - Verify Authentication Code # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_phone_number_lookup_api.py b/test/unit/test_phone_number_lookup_api.py deleted file mode 100644 index bf70014c..00000000 --- a/test/unit/test_phone_number_lookup_api.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestPhoneNumberLookupApi(unittest.TestCase): - """PhoneNumberLookupApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.phone_number_lookup_api.PhoneNumberLookupApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_lookup(self): - """Test case for create_lookup - - Create Lookup # noqa: E501 - """ - pass - - def test_get_lookup_status(self): - """Test case for get_lookup_status - - Get Lookup Request Status # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_recordings_api.py b/test/unit/test_recordings_api.py deleted file mode 100644 index c0eb20b4..00000000 --- a/test/unit/test_recordings_api.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.recordings_api import RecordingsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestRecordingsApi(unittest.TestCase): - """RecordingsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.recordings_api.RecordingsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_call_transcription(self): - """Test case for delete_call_transcription - - Delete Transcription # noqa: E501 - """ - pass - - def test_delete_recording(self): - """Test case for delete_recording - - Delete Recording # noqa: E501 - """ - pass - - def test_delete_recording_media(self): - """Test case for delete_recording_media - - Delete Recording Media # noqa: E501 - """ - pass - - def test_download_call_recording(self): - """Test case for download_call_recording - - Download Recording # noqa: E501 - """ - pass - - def test_get_call_recording(self): - """Test case for get_call_recording - - Get Call Recording # noqa: E501 - """ - pass - - def test_get_call_transcription(self): - """Test case for get_call_transcription - - Get Transcription # noqa: E501 - """ - pass - - def test_list_account_call_recordings(self): - """Test case for list_account_call_recordings - - Get Call Recordings # noqa: E501 - """ - pass - - def test_list_call_recordings(self): - """Test case for list_call_recordings - - List Call Recordings # noqa: E501 - """ - pass - - def test_transcribe_call_recording(self): - """Test case for transcribe_call_recording - - Create Transcription Request # noqa: E501 - """ - pass - - def test_update_call_recording_state(self): - """Test case for update_call_recording_state - - Update Recording # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main()