From 9b3deb61a1ea5cb373392f9a8d50308cef39c7ca Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Wed, 12 Feb 2025 19:55:25 +0000 Subject: [PATCH 1/6] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 50 + Bandwidth.Standard.sln | 10 +- README.md | 34 +- api/openapi.yaml | 2058 ++++++++++++++++- bandwidth.yml | 1102 +++++++++ docs/AdditionalDenialReason.md | 12 + docs/Address.md | 16 + docs/Contact.md | 13 + docs/Error.md | 12 + docs/FailureWebhook.md | 15 + docs/LinksObject.md | 13 + docs/OptInWorkflow.md | 11 + docs/TelephoneNumber.md | 10 + docs/TfvBasicAuthentication.md | 11 + docs/TfvCallbackStatusEnum.md | 9 + docs/TfvError.md | 13 + docs/TfvStatus.md | 17 + docs/TfvStatusEnum.md | 9 + docs/TfvSubmissionInfo.md | 18 + docs/TfvSubmissionWrapper.md | 10 + docs/TollFreeVerificationApi.md | 835 +++++++ docs/VerificationDenialWebhook.md | 17 + docs/VerificationRequest.md | 19 + docs/VerificationUpdateRequest.md | 18 + docs/VerificationWebhook.md | 13 + docs/WebhookSubscription.md | 17 + .../WebhookSubscriptionBasicAuthentication.md | 12 + docs/WebhookSubscriptionRequestSchema.md | 12 + docs/WebhookSubscriptionTypeEnum.md | 9 + docs/WebhookSubscriptionsListBody.md | 13 + .../Api/TollFreeVerificationApi.cs | 1948 ++++++++++++++++ .../Client/Configuration.cs | 102 +- .../Model/AdditionalDenialReason.cs | 117 + src/Bandwidth.Standard/Model/Address.cs | 266 +++ src/Bandwidth.Standard/Model/Contact.cs | 199 ++ src/Bandwidth.Standard/Model/Error.cs | 101 + .../Model/FailureWebhook.cs | 160 ++ src/Bandwidth.Standard/Model/LinksObject.cs | 114 + src/Bandwidth.Standard/Model/OptInWorkflow.cs | 120 + .../Model/TelephoneNumber.cs | 84 + .../Model/TfvBasicAuthentication.cs | 119 + .../Model/TfvCallbackStatusEnum.cs | 48 + src/Bandwidth.Standard/Model/TfvError.cs | 105 + src/Bandwidth.Standard/Model/TfvStatus.cs | 179 ++ src/Bandwidth.Standard/Model/TfvStatusEnum.cs | 66 + .../Model/TfvSubmissionInfo.cs | 239 ++ .../Model/TfvSubmissionWrapper.cs | 83 + .../Model/VerificationDenialWebhook.cs | 183 ++ .../Model/VerificationRequest.cs | 285 +++ .../Model/VerificationUpdateRequest.cs | 271 +++ .../Model/VerificationWebhook.cs | 137 ++ .../Model/WebhookSubscription.cs | 174 ++ .../WebhookSubscriptionBasicAuthentication.cs | 119 + .../Model/WebhookSubscriptionRequestSchema.cs | 157 ++ .../Model/WebhookSubscriptionTypeEnum.cs | 48 + .../Model/WebhookSubscriptionsListBody.cs | 111 + 56 files changed, 9899 insertions(+), 44 deletions(-) create mode 100644 docs/AdditionalDenialReason.md create mode 100644 docs/Address.md create mode 100644 docs/Contact.md create mode 100644 docs/Error.md create mode 100644 docs/FailureWebhook.md create mode 100644 docs/LinksObject.md create mode 100644 docs/OptInWorkflow.md create mode 100644 docs/TelephoneNumber.md create mode 100644 docs/TfvBasicAuthentication.md create mode 100644 docs/TfvCallbackStatusEnum.md create mode 100644 docs/TfvError.md create mode 100644 docs/TfvStatus.md create mode 100644 docs/TfvStatusEnum.md create mode 100644 docs/TfvSubmissionInfo.md create mode 100644 docs/TfvSubmissionWrapper.md create mode 100644 docs/TollFreeVerificationApi.md create mode 100644 docs/VerificationDenialWebhook.md create mode 100644 docs/VerificationRequest.md create mode 100644 docs/VerificationUpdateRequest.md create mode 100644 docs/VerificationWebhook.md create mode 100644 docs/WebhookSubscription.md create mode 100644 docs/WebhookSubscriptionBasicAuthentication.md create mode 100644 docs/WebhookSubscriptionRequestSchema.md create mode 100644 docs/WebhookSubscriptionTypeEnum.md create mode 100644 docs/WebhookSubscriptionsListBody.md create mode 100644 src/Bandwidth.Standard/Api/TollFreeVerificationApi.cs create mode 100644 src/Bandwidth.Standard/Model/AdditionalDenialReason.cs create mode 100644 src/Bandwidth.Standard/Model/Address.cs create mode 100644 src/Bandwidth.Standard/Model/Contact.cs create mode 100644 src/Bandwidth.Standard/Model/Error.cs create mode 100644 src/Bandwidth.Standard/Model/FailureWebhook.cs create mode 100644 src/Bandwidth.Standard/Model/LinksObject.cs create mode 100644 src/Bandwidth.Standard/Model/OptInWorkflow.cs create mode 100644 src/Bandwidth.Standard/Model/TelephoneNumber.cs create mode 100644 src/Bandwidth.Standard/Model/TfvBasicAuthentication.cs create mode 100644 src/Bandwidth.Standard/Model/TfvCallbackStatusEnum.cs create mode 100644 src/Bandwidth.Standard/Model/TfvError.cs create mode 100644 src/Bandwidth.Standard/Model/TfvStatus.cs create mode 100644 src/Bandwidth.Standard/Model/TfvStatusEnum.cs create mode 100644 src/Bandwidth.Standard/Model/TfvSubmissionInfo.cs create mode 100644 src/Bandwidth.Standard/Model/TfvSubmissionWrapper.cs create mode 100644 src/Bandwidth.Standard/Model/VerificationDenialWebhook.cs create mode 100644 src/Bandwidth.Standard/Model/VerificationRequest.cs create mode 100644 src/Bandwidth.Standard/Model/VerificationUpdateRequest.cs create mode 100644 src/Bandwidth.Standard/Model/VerificationWebhook.cs create mode 100644 src/Bandwidth.Standard/Model/WebhookSubscription.cs create mode 100644 src/Bandwidth.Standard/Model/WebhookSubscriptionBasicAuthentication.cs create mode 100644 src/Bandwidth.Standard/Model/WebhookSubscriptionRequestSchema.cs create mode 100644 src/Bandwidth.Standard/Model/WebhookSubscriptionTypeEnum.cs create mode 100644 src/Bandwidth.Standard/Model/WebhookSubscriptionsListBody.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 290a216..3975034 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,6 +3,8 @@ README.md api/openapi.yaml appveyor.yml docs/AccountStatistics.md +docs/AdditionalDenialReason.md +docs/Address.md docs/AnswerCallback.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md @@ -30,6 +32,7 @@ docs/ConferenceRecordingMetadata.md docs/ConferenceRedirectCallback.md docs/ConferenceStateEnum.md docs/ConferencesApi.md +docs/Contact.md docs/CreateCall.md docs/CreateCallResponse.md docs/CreateLookupResponse.md @@ -38,10 +41,13 @@ docs/DeferredResult.md docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md +docs/Error.md +docs/FailureWebhook.md docs/FieldError.md docs/FileFormatEnum.md docs/GatherCallback.md docs/InitiateCallback.md +docs/LinksObject.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md docs/LookupRequest.md @@ -69,6 +75,7 @@ docs/MessagingRequestError.md docs/MfaForbiddenRequestError.md docs/MfaRequestError.md docs/MfaUnauthorizedRequestError.md +docs/OptInWorkflow.md docs/PageInfo.md docs/PhoneNumberLookupApi.md docs/PriorityEnum.md @@ -83,7 +90,16 @@ docs/RedirectMethodEnum.md docs/StatisticsApi.md docs/StirShaken.md docs/Tag.md +docs/TelephoneNumber.md +docs/TfvBasicAuthentication.md +docs/TfvCallbackStatusEnum.md +docs/TfvError.md +docs/TfvStatus.md +docs/TfvStatusEnum.md +docs/TfvSubmissionInfo.md +docs/TfvSubmissionWrapper.md docs/TnLookupRequestError.md +docs/TollFreeVerificationApi.md docs/TranscribeRecording.md docs/Transcription.md docs/TranscriptionAvailableCallback.md @@ -95,10 +111,19 @@ docs/UpdateCall.md docs/UpdateCallRecording.md docs/UpdateConference.md docs/UpdateConferenceMember.md +docs/VerificationDenialWebhook.md +docs/VerificationRequest.md +docs/VerificationUpdateRequest.md +docs/VerificationWebhook.md docs/VerifyCodeRequest.md docs/VerifyCodeResponse.md docs/VoiceApiError.md docs/VoiceCodeResponse.md +docs/WebhookSubscription.md +docs/WebhookSubscriptionBasicAuthentication.md +docs/WebhookSubscriptionRequestSchema.md +docs/WebhookSubscriptionTypeEnum.md +docs/WebhookSubscriptionsListBody.md git_push.sh src/Bandwidth.Standard/Api/CallsApi.cs src/Bandwidth.Standard/Api/ConferencesApi.cs @@ -108,6 +133,7 @@ src/Bandwidth.Standard/Api/MessagesApi.cs src/Bandwidth.Standard/Api/PhoneNumberLookupApi.cs src/Bandwidth.Standard/Api/RecordingsApi.cs src/Bandwidth.Standard/Api/StatisticsApi.cs +src/Bandwidth.Standard/Api/TollFreeVerificationApi.cs src/Bandwidth.Standard/Api/TranscriptionsApi.cs src/Bandwidth.Standard/Client/ApiClient.cs src/Bandwidth.Standard/Client/ApiException.cs @@ -127,6 +153,8 @@ src/Bandwidth.Standard/Client/RequestOptions.cs src/Bandwidth.Standard/Client/RetryConfiguration.cs src/Bandwidth.Standard/Model/AbstractOpenAPISchema.cs src/Bandwidth.Standard/Model/AccountStatistics.cs +src/Bandwidth.Standard/Model/AdditionalDenialReason.cs +src/Bandwidth.Standard/Model/Address.cs src/Bandwidth.Standard/Model/AnswerCallback.cs src/Bandwidth.Standard/Model/BridgeCompleteCallback.cs src/Bandwidth.Standard/Model/BridgeTargetCompleteCallback.cs @@ -152,6 +180,7 @@ src/Bandwidth.Standard/Model/ConferenceRecordingAvailableCallback.cs src/Bandwidth.Standard/Model/ConferenceRecordingMetadata.cs src/Bandwidth.Standard/Model/ConferenceRedirectCallback.cs src/Bandwidth.Standard/Model/ConferenceStateEnum.cs +src/Bandwidth.Standard/Model/Contact.cs src/Bandwidth.Standard/Model/CreateCall.cs src/Bandwidth.Standard/Model/CreateCallResponse.cs src/Bandwidth.Standard/Model/CreateLookupResponse.cs @@ -160,10 +189,13 @@ src/Bandwidth.Standard/Model/DeferredResult.cs src/Bandwidth.Standard/Model/DisconnectCallback.cs src/Bandwidth.Standard/Model/Diversion.cs src/Bandwidth.Standard/Model/DtmfCallback.cs +src/Bandwidth.Standard/Model/Error.cs +src/Bandwidth.Standard/Model/FailureWebhook.cs src/Bandwidth.Standard/Model/FieldError.cs src/Bandwidth.Standard/Model/FileFormatEnum.cs src/Bandwidth.Standard/Model/GatherCallback.cs src/Bandwidth.Standard/Model/InitiateCallback.cs +src/Bandwidth.Standard/Model/LinksObject.cs src/Bandwidth.Standard/Model/ListMessageDirectionEnum.cs src/Bandwidth.Standard/Model/ListMessageItem.cs src/Bandwidth.Standard/Model/LookupRequest.cs @@ -188,6 +220,7 @@ src/Bandwidth.Standard/Model/MessagingRequestError.cs src/Bandwidth.Standard/Model/MfaForbiddenRequestError.cs src/Bandwidth.Standard/Model/MfaRequestError.cs src/Bandwidth.Standard/Model/MfaUnauthorizedRequestError.cs +src/Bandwidth.Standard/Model/OptInWorkflow.cs src/Bandwidth.Standard/Model/PageInfo.cs src/Bandwidth.Standard/Model/PriorityEnum.cs src/Bandwidth.Standard/Model/RecordingAvailableCallback.cs @@ -199,6 +232,14 @@ src/Bandwidth.Standard/Model/RedirectCallback.cs src/Bandwidth.Standard/Model/RedirectMethodEnum.cs src/Bandwidth.Standard/Model/StirShaken.cs src/Bandwidth.Standard/Model/Tag.cs +src/Bandwidth.Standard/Model/TelephoneNumber.cs +src/Bandwidth.Standard/Model/TfvBasicAuthentication.cs +src/Bandwidth.Standard/Model/TfvCallbackStatusEnum.cs +src/Bandwidth.Standard/Model/TfvError.cs +src/Bandwidth.Standard/Model/TfvStatus.cs +src/Bandwidth.Standard/Model/TfvStatusEnum.cs +src/Bandwidth.Standard/Model/TfvSubmissionInfo.cs +src/Bandwidth.Standard/Model/TfvSubmissionWrapper.cs src/Bandwidth.Standard/Model/TnLookupRequestError.cs src/Bandwidth.Standard/Model/TranscribeRecording.cs src/Bandwidth.Standard/Model/Transcription.cs @@ -210,7 +251,16 @@ src/Bandwidth.Standard/Model/UpdateCall.cs src/Bandwidth.Standard/Model/UpdateCallRecording.cs src/Bandwidth.Standard/Model/UpdateConference.cs src/Bandwidth.Standard/Model/UpdateConferenceMember.cs +src/Bandwidth.Standard/Model/VerificationDenialWebhook.cs +src/Bandwidth.Standard/Model/VerificationRequest.cs +src/Bandwidth.Standard/Model/VerificationUpdateRequest.cs +src/Bandwidth.Standard/Model/VerificationWebhook.cs src/Bandwidth.Standard/Model/VerifyCodeRequest.cs src/Bandwidth.Standard/Model/VerifyCodeResponse.cs src/Bandwidth.Standard/Model/VoiceApiError.cs src/Bandwidth.Standard/Model/VoiceCodeResponse.cs +src/Bandwidth.Standard/Model/WebhookSubscription.cs +src/Bandwidth.Standard/Model/WebhookSubscriptionBasicAuthentication.cs +src/Bandwidth.Standard/Model/WebhookSubscriptionRequestSchema.cs +src/Bandwidth.Standard/Model/WebhookSubscriptionTypeEnum.cs +src/Bandwidth.Standard/Model/WebhookSubscriptionsListBody.cs diff --git a/Bandwidth.Standard.sln b/Bandwidth.Standard.sln index 7f7322c..e4762cb 100644 --- a/Bandwidth.Standard.sln +++ b/Bandwidth.Standard.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{EA879785-5633-4755-ABF8-7CAEE38F2A75}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{3736A9B2-3939-4BA1-8755-A7F84F9A40CC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard.Test", "src\Bandwidth.Standard.Test\Bandwidth.Standard.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EA879785-5633-4755-ABF8-7CAEE38F2A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA879785-5633-4755-ABF8-7CAEE38F2A75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA879785-5633-4755-ABF8-7CAEE38F2A75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA879785-5633-4755-ABF8-7CAEE38F2A75}.Release|Any CPU.Build.0 = Release|Any CPU + {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/README.md b/README.md index 1d848c2..277d935 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Bandwidth's Communication APIs This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- SDK version: 1.0.0 +- SDK version: 1.0.0-dev - Generator version: 7.7.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com) @@ -144,6 +144,14 @@ Class | Method | HTTP request | Description *RecordingsApi* | [**TranscribeCallRecording**](docs/RecordingsApi.md#transcribecallrecording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request *RecordingsApi* | [**UpdateCallRecordingState**](docs/RecordingsApi.md#updatecallrecordingstate) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording *StatisticsApi* | [**GetStatistics**](docs/StatisticsApi.md#getstatistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics +*TollFreeVerificationApi* | [**CreateWebhookSubscription**](docs/TollFreeVerificationApi.md#createwebhooksubscription) | **POST** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | Create Webhook Subscription +*TollFreeVerificationApi* | [**DeleteWebhookSubscription**](docs/TollFreeVerificationApi.md#deletewebhooksubscription) | **DELETE** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Delete Webhook Subscription +*TollFreeVerificationApi* | [**GetTollFreeVerificationStatus**](docs/TollFreeVerificationApi.md#gettollfreeverificationstatus) | **GET** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Get Toll-Free Verification Status +*TollFreeVerificationApi* | [**ListTollFreeUseCases**](docs/TollFreeVerificationApi.md#listtollfreeusecases) | **GET** /tollFreeVerification/useCases | List Toll-Free Use Cases +*TollFreeVerificationApi* | [**ListWebhookSubscriptions**](docs/TollFreeVerificationApi.md#listwebhooksubscriptions) | **GET** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | List Webhook Subscriptions +*TollFreeVerificationApi* | [**RequestTollFreeVerification**](docs/TollFreeVerificationApi.md#requesttollfreeverification) | **POST** /accounts/{accountId}/tollFreeVerification | Request Toll-Free Verification +*TollFreeVerificationApi* | [**UpdateTollFreeVerificationRequest**](docs/TollFreeVerificationApi.md#updatetollfreeverificationrequest) | **PUT** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Update Toll-Free Verification Request +*TollFreeVerificationApi* | [**UpdateWebhookSubscription**](docs/TollFreeVerificationApi.md#updatewebhooksubscription) | **PUT** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Update Webhook Subscription *TranscriptionsApi* | [**DeleteRealTimeTranscription**](docs/TranscriptionsApi.md#deleterealtimetranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Delete a specific transcription *TranscriptionsApi* | [**GetRealTimeTranscription**](docs/TranscriptionsApi.md#getrealtimetranscription) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Retrieve a specific transcription *TranscriptionsApi* | [**ListRealTimeTranscriptions**](docs/TranscriptionsApi.md#listrealtimetranscriptions) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions | Enumerate transcriptions made with StartTranscription @@ -153,6 +161,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - [Model.AccountStatistics](docs/AccountStatistics.md) + - [Model.AdditionalDenialReason](docs/AdditionalDenialReason.md) + - [Model.Address](docs/Address.md) - [Model.AnswerCallback](docs/AnswerCallback.md) - [Model.BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [Model.BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) @@ -178,6 +188,7 @@ Class | Method | HTTP request | Description - [Model.ConferenceRecordingMetadata](docs/ConferenceRecordingMetadata.md) - [Model.ConferenceRedirectCallback](docs/ConferenceRedirectCallback.md) - [Model.ConferenceStateEnum](docs/ConferenceStateEnum.md) + - [Model.Contact](docs/Contact.md) - [Model.CreateCall](docs/CreateCall.md) - [Model.CreateCallResponse](docs/CreateCallResponse.md) - [Model.CreateLookupResponse](docs/CreateLookupResponse.md) @@ -186,10 +197,13 @@ Class | Method | HTTP request | Description - [Model.DisconnectCallback](docs/DisconnectCallback.md) - [Model.Diversion](docs/Diversion.md) - [Model.DtmfCallback](docs/DtmfCallback.md) + - [Model.Error](docs/Error.md) + - [Model.FailureWebhook](docs/FailureWebhook.md) - [Model.FieldError](docs/FieldError.md) - [Model.FileFormatEnum](docs/FileFormatEnum.md) - [Model.GatherCallback](docs/GatherCallback.md) - [Model.InitiateCallback](docs/InitiateCallback.md) + - [Model.LinksObject](docs/LinksObject.md) - [Model.ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [Model.ListMessageItem](docs/ListMessageItem.md) - [Model.LookupRequest](docs/LookupRequest.md) @@ -214,6 +228,7 @@ Class | Method | HTTP request | Description - [Model.MfaForbiddenRequestError](docs/MfaForbiddenRequestError.md) - [Model.MfaRequestError](docs/MfaRequestError.md) - [Model.MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) + - [Model.OptInWorkflow](docs/OptInWorkflow.md) - [Model.PageInfo](docs/PageInfo.md) - [Model.PriorityEnum](docs/PriorityEnum.md) - [Model.RecordingAvailableCallback](docs/RecordingAvailableCallback.md) @@ -225,6 +240,14 @@ Class | Method | HTTP request | Description - [Model.RedirectMethodEnum](docs/RedirectMethodEnum.md) - [Model.StirShaken](docs/StirShaken.md) - [Model.Tag](docs/Tag.md) + - [Model.TelephoneNumber](docs/TelephoneNumber.md) + - [Model.TfvBasicAuthentication](docs/TfvBasicAuthentication.md) + - [Model.TfvCallbackStatusEnum](docs/TfvCallbackStatusEnum.md) + - [Model.TfvError](docs/TfvError.md) + - [Model.TfvStatus](docs/TfvStatus.md) + - [Model.TfvStatusEnum](docs/TfvStatusEnum.md) + - [Model.TfvSubmissionInfo](docs/TfvSubmissionInfo.md) + - [Model.TfvSubmissionWrapper](docs/TfvSubmissionWrapper.md) - [Model.TnLookupRequestError](docs/TnLookupRequestError.md) - [Model.TranscribeRecording](docs/TranscribeRecording.md) - [Model.Transcription](docs/Transcription.md) @@ -236,10 +259,19 @@ Class | Method | HTTP request | Description - [Model.UpdateCallRecording](docs/UpdateCallRecording.md) - [Model.UpdateConference](docs/UpdateConference.md) - [Model.UpdateConferenceMember](docs/UpdateConferenceMember.md) + - [Model.VerificationDenialWebhook](docs/VerificationDenialWebhook.md) + - [Model.VerificationRequest](docs/VerificationRequest.md) + - [Model.VerificationUpdateRequest](docs/VerificationUpdateRequest.md) + - [Model.VerificationWebhook](docs/VerificationWebhook.md) - [Model.VerifyCodeRequest](docs/VerifyCodeRequest.md) - [Model.VerifyCodeResponse](docs/VerifyCodeResponse.md) - [Model.VoiceApiError](docs/VoiceApiError.md) - [Model.VoiceCodeResponse](docs/VoiceCodeResponse.md) + - [Model.WebhookSubscription](docs/WebhookSubscription.md) + - [Model.WebhookSubscriptionBasicAuthentication](docs/WebhookSubscriptionBasicAuthentication.md) + - [Model.WebhookSubscriptionRequestSchema](docs/WebhookSubscriptionRequestSchema.md) + - [Model.WebhookSubscriptionTypeEnum](docs/WebhookSubscriptionTypeEnum.md) + - [Model.WebhookSubscriptionsListBody](docs/WebhookSubscriptionsListBody.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 4738cd0..2d2229e 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -21,6 +21,7 @@ tags: - name: Transcriptions - name: MFA - name: Phone Number Lookup +- name: Toll-Free Verification paths: /users/{accountId}/media: get: @@ -4539,6 +4540,809 @@ paths: servers: - description: Production url: https://numbers.bandwidth.com/api/v1 + /accounts/{accountId}/tollFreeVerification: + post: + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + description: Submit a request for verification of a toll-free phone number. + operationId: requestTollFreeVerification + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' + responses: + "202": + description: Accepted + "400": + content: + application/json: + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email + address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Request Toll-Free Verification + tags: + - Toll-Free Verification + servers: + - description: Production + url: https://api.bandwidth.com/api/v2 + /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: + get: + description: |- + Gets the verification status for a phone number that is provisioned to your account. + Submission information will be appended to the response if it is available. + operationId: getTollFreeVerificationStatus + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Valid Toll-Free telephone number in E.164 format. + example: "+18885555555" + explode: false + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/tfvStatus' + description: OK + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Get Toll-Free Verification Status + tags: + - Toll-Free Verification + put: + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + description: |- + Updates a toll-free verification request. + Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + operationId: updateTollFreeVerificationRequest + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Valid Toll-Free telephone number in E.164 format. + example: "+18885555555" + explode: false + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + style: simple + requestBody: + $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' + responses: + "202": + description: Accepted + "400": + content: + application/json: + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email + address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Update Toll-Free Verification Request + tags: + - Toll-Free Verification + servers: + - description: Production + url: https://api.bandwidth.com/api/v2 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: + get: + description: |- + Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API + If `basicAuthentication` is defined, the `password` property of that object will be null). + operationId: listWebhookSubscriptions + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionsListBody' + description: OK + "400": + content: + application/json: + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email + address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: List Webhook Subscriptions + tags: + - Toll-Free Verification + post: + description: |- + Create a new webhook subscription (this webhook will be called for every update on every submission). + In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). + The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + operationId: createWebhookSubscription + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + description: Created + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Create Webhook Subscription + tags: + - Toll-Free Verification + servers: + - description: Production + url: https://api.bandwidth.com/api/v2 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: + delete: + description: Delete a webhook subscription by ID. + operationId: deleteWebhookSubscription + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "204": + description: No Content + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Delete Webhook Subscription + tags: + - Toll-Free Verification + put: + description: Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` + can be updated). + operationId: updateWebhookSubscription + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + description: OK + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: Update Webhook Subscription + tags: + - Toll-Free Verification + servers: + - description: Production + url: https://api.bandwidth.com/api/v2 + /tollFreeVerification/useCases: + get: + description: Lists valid toll-free use cases. + operationId: listTollFreeUseCases + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/useCases' + description: OK + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: List Toll-Free Use Cases + tags: + - Toll-Free Verification + servers: + - description: Production + url: https://api.bandwidth.com/api/v2 components: callbacks: inboundCallback: @@ -4587,6 +5391,102 @@ components: responses: "200": description: OK + tfVerificationStatus: + your_url.com/webhookService: + post: + description: Unique webhook URL provided by customers to which Bandwidth + sends a POST request to notify customer regarding TFV status updates. + operationId: tfvRequest + parameters: + - description: "64-character lowercase hexidecimal HMAC calculated with\ + \ a shared secret key, the canonicalized request body, and SHA256. It\ + \ is only included when a shared secret key is set through webhook subscription." + example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 + explode: false + in: header + name: x-bandwidth-signature-hmac-sha256 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/verificationWebhookRequest' + responses: + "204": + description: No Content + "400": + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + "401": + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + "403": + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + "404": + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found + schema: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + "405": + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + "429": + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: '#/components/schemas/tfvError' + description: Too Many Requests + "500": + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: '#/components/schemas/tfvError' + description: Internal Server Error + "503": + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable + summary: TFV status updates sent to customer's webhook URL. examples: smsMessageReceivedCallbackExample: summary: An example of a sms message-received callback body. @@ -5319,6 +6219,26 @@ components: schema: type: string style: simple + tfPhoneNumberPathParam: + description: Valid Toll-Free telephone number in E.164 format. + example: "+18885555555" + explode: false + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + style: simple + webhookSubscriptionIdPathParam: + description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple requestBodies: createMessageRequest: content: @@ -5623,6 +6543,38 @@ components: $ref: '#/components/schemas/lookupRequest' description: Phone number lookup request. required: true + requestTollFreeVerificationRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/verificationRequest' + description: Request for verification of a toll-free phone number. + required: true + updateTollFreeVerificationRequestRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/tfvSubmissionWrapper' + description: Update a request for verification of a toll-free phone number. + required: true + verificationWebhookRequest: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/verificationWebhook' + - $ref: '#/components/schemas/verificationDenialWebhook' + - $ref: '#/components/schemas/failureWebhook' + description: Verification callback status of a toll-free phone number. + required: true + webhookSubscriptionRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionRequestSchema' + description: Information about a webhook that Bandwidth should send upon the + completion of event customer is trying to subscribe to. + required: true responses: createMessageResponse: content: @@ -6024,53 +6976,167 @@ components: tnLookupForbiddenError: content: application/json: - examples: - forbidden: - summary: Example Forbidden Error - value: - message: Authorization header requires 'Credential' parameter. Authorization - header requires 'Signature' parameter. Authorization header requires - 'SignedHeaders' parameter. Authorization header requires existence - of either a 'X-Amz-Date' or a 'Date' header. Authorization=Basic - Y2tvZloPTGhHgywYIzGlcGVlcGvvcGovYTIGIt==' + examples: + forbidden: + summary: Example Forbidden Error + value: + message: Authorization header requires 'Credential' parameter. Authorization + header requires 'Signature' parameter. Authorization header requires + 'SignedHeaders' parameter. Authorization header requires existence + of either a 'X-Amz-Date' or a 'Date' header. Authorization=Basic + Y2tvZloPTGhHgywYIzGlcGVlcGvvcGovYTIGIt==' + schema: + $ref: '#/components/schemas/tnLookupRequestError' + description: Forbidden + tnLookupMediaTypeError: + content: + application/json: + examples: + mediaType: + summary: Example Unsupported Media Type Error + value: + message: Content-Type must be application/json. + schema: + $ref: '#/components/schemas/tnLookupRequestError' + description: Unsupported Media Type + tnLookupNotFoundError: + description: Not Found + tnLookupTooManyRequestsError: + content: + application/json: + examples: + mediaType: + summary: Example Too Many Requests Error + value: + message: Too many requests. + schema: + $ref: '#/components/schemas/tnLookupRequestError' + description: Too Many Requests + tnLookupInternalServerError: + content: + application/json: + examples: + mediaType: + summary: Example Internal Server Error Error + value: + message: Request has not been passed further. + schema: + $ref: '#/components/schemas/tnLookupRequestError' + description: Internal Server Error + getTollFreeVerificationStatusResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/tfvStatus' + description: OK + listWebhookSubscriptionsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionsListBody' + description: OK + createWebhookSubscriptionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + description: Created + updateWebhookSubscriptionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + description: OK + listTollFreeUseCasesResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/useCases' + description: OK + tfvBadRequestResponse: + content: + application/json: + example: + description: Cannot process request. + type: bad request + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + tfvPostBadRequestResponse: + content: + application/json: + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + schema: + $ref: '#/components/schemas/tfvError' + description: Bad Request + tfvUnauthorizedResponse: + content: + application/json: + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + schema: + $ref: '#/components/schemas/tfvError' + description: Unauthorized + tfvForbiddenResponse: + content: + application/json: + example: + description: Client is not authorized for the action. + type: forbidden + schema: + $ref: '#/components/schemas/tfvError' + description: Forbidden + tfvNotFoundResponse: + content: + application/json: + example: + description: Cannot find the requested resource. + type: Not Found schema: - $ref: '#/components/schemas/tnLookupRequestError' - description: Forbidden - tnLookupMediaTypeError: + $ref: '#/components/schemas/tfvError' + description: Cannot find the requested resource. + tfvNotAllowedResponse: content: application/json: - examples: - mediaType: - summary: Example Unsupported Media Type Error - value: - message: Content-Type must be application/json. + example: + description: Method is not allowed. + type: Method Not Allowed schema: - $ref: '#/components/schemas/tnLookupRequestError' - description: Unsupported Media Type - tnLookupNotFoundError: - description: Not Found - tnLookupTooManyRequestsError: + $ref: '#/components/schemas/tfvError' + description: Method Not Allowed + tfvTooManyRequestsResponse: content: application/json: - examples: - mediaType: - summary: Example Too Many Requests Error - value: - message: Too many requests. + example: + description: Throttling error. Too many requests. + type: Too Many Requests schema: - $ref: '#/components/schemas/tnLookupRequestError' + $ref: '#/components/schemas/tfvError' description: Too Many Requests - tnLookupInternalServerError: + tfvServerErrorResponse: content: application/json: - examples: - mediaType: - summary: Example Internal Server Error Error - value: - message: Request has not been passed further. + example: + description: Internal Server Error. + type: Internal Server Error schema: - $ref: '#/components/schemas/tnLookupRequestError' + $ref: '#/components/schemas/tfvError' description: Internal Server Error + tfvServiceUnavailableResponse: + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: '#/components/schemas/tfvError' + description: Service Unavailable schemas: callbackTypeEnum: description: | @@ -10236,6 +11302,928 @@ components: example: example error message type: string type: object + accountId1: + description: User's account ID. + example: "1234567" + type: string + tfPhoneNumber: + description: Toll-free telephone number in E.164 format. + example: "+18005555555" + maxLength: 12 + minLength: 12 + nullable: false + pattern: "^\\+1(800|833|844|855|866|877|888)[2-9]\\d{6}$" + type: string + tfvWebhookErrors: + description: Details of the errors that were encountered when processing the + request. + items: + example: "optInWorkflowImageURLs: Entries must be a valid array of objects." + type: string + type: array + tfvCallbackStatusEnum: + enum: + - VERIFIED + - UNVERIFIED + example: VERIFIED + type: string + tfvUnverifiedStatus: + default: UNVERIFIED + example: UNVERIFIED + type: string + declineReasonDescription: + description: Explanation for why a verification request was declined. + example: Invalid Information - Can't Validate URL - Website is not accessible + / not available + nullable: false + type: string + denialStatusCode: + description: Reason code for denial. + example: 511 + type: integer + resubmitAllowed: + description: Whether a Toll-Free Verification request qualifies for resubmission + via PUT. + example: true + type: boolean + additionalDenialReason: + properties: + statusCode: + description: Reason code for denial. + example: 511 + type: integer + reason: + description: Explanation for why a verification request was declined. + example: Invalid Information - Can't Validate URL - Website is not accessible + / not available + nullable: false + type: string + resubmitAllowed: + description: Whether a Toll-Free Verification request qualifies for resubmission + via PUT. + example: true + type: boolean + required: + - reason + - resubmitAllowed + - statusCode + type: object + internalTicketNumber: + description: Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number - included in all webhook payloads. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + internalTicketNumberForWebhook: + description: Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + businessContactPhoneNumber: + description: Contact telephone number + example: "+19192654500" + maxLength: 500 + minLength: 1 + nullable: false + type: string + verificationRequest: + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + description: Estimated monthly volume of messages from the toll-free number. + example: 10000 + maximum: 10000000 + minimum: 10 + type: integer + phoneNumbers: + items: + $ref: '#/components/schemas/tfPhoneNumber' + maxItems: 10 + minItems: 1 + type: array + useCase: + description: The category of the use case. + example: 2FA + maxLength: 500 + minLength: 0 + type: string + useCaseSummary: + description: A general idea of the use case and customer. + maxLength: 500 + minLength: 1 + nullable: false + type: string + productionMessageContent: + description: Example of message content. + maxLength: 500 + minLength: 1 + nullable: false + type: string + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + description: Any additional information. + maxLength: 500 + minLength: 0 + nullable: true + type: string + isvReseller: + description: ISV name. + example: Test ISV + maxLength: 500 + minLength: 0 + nullable: true + type: string + required: + - businessAddress + - businessContact + - messageVolume + - optInWorkflow + - phoneNumbers + - productionMessageContent + - useCase + - useCaseSummary + type: object + verificationUpdateRequest: + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + description: Estimated monthly volume of messages from the toll-free number. + example: 10000 + maximum: 10000000 + minimum: 10 + type: integer + useCase: + description: The category of the use case. + example: 2FA + maxLength: 500 + minLength: 0 + type: string + useCaseSummary: + description: A general idea of the use case and customer. + maxLength: 500 + minLength: 0 + nullable: false + type: string + productionMessageContent: + description: Example of message content. + maxLength: 500 + minLength: 0 + nullable: false + type: string + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + description: Any additional information. + maxLength: 500 + minLength: 0 + nullable: true + type: string + isvReseller: + description: ISV name. + example: Test ISV + maxLength: 500 + minLength: 0 + nullable: true + type: string + required: + - businessAddress + - businessContact + - messageVolume + - optInWorkflow + - productionMessageContent + - useCase + - useCaseSummary + type: object + tfvBasicAuthentication: + properties: + username: + maxLength: 100 + type: string + password: + maxLength: 200 + type: string + required: + - password + - username + type: object + webhookSubscriptionRequestSchema: + properties: + basicAuthentication: + $ref: '#/components/schemas/tfvBasicAuthentication' + callbackUrl: + description: "Callback URL to receive status updates from Bandwidth. When\ + \ a webhook subscription is registered with Bandwidth under a given account\ + \ ID, it will be used to send status updates for all requests submitted\ + \ under that account ID." + example: https://www.example.com/path/to/resource + format: url + maxLength: 2000 + minLength: 0 + nullable: true + pattern: "^$|(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,253}\\.[a-z]{2,6}\\\ + b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*)" + type: string + sharedSecretKey: + description: An ASCII string submitted by the user as a shared secret key + for generating an HMAC header for callbacks. + example: This is my $3cret + maxLength: 64 + minLength: 16 + nullable: true + pattern: "^[ -~]{16,64}$" + type: string + required: + - callbackUrl + type: object + failureWebhook: + properties: + accountId: + description: User's account ID. + example: "1234567" + type: string + phoneNumber: + description: Toll-free telephone number in E.164 format. + example: "+18005555555" + maxLength: 12 + minLength: 12 + nullable: false + pattern: "^\\+1(800|833|844|855|866|877|888)[2-9]\\d{6}$" + type: string + errorCode: + description: An error code indicating what error was encountered. This code + can be interpreted as an HTTP status code in regards to the error that + was encountered. + example: "400" + type: string + errorDescription: + description: A description of the error that was encountered. + example: cannot process request. + type: string + errors: + description: Details of the errors that were encountered when processing + the request. + items: + example: "optInWorkflowImageURLs: Entries must be a valid array of objects." + type: string + type: array + internalTicketNumber: + description: Unique identifier (UUID) generated by Bandwidth to assist in + tracking the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + type: object + verificationDenialWebhook: + properties: + accountId: + description: User's account ID. + example: "1234567" + type: string + additionalDenialReasons: + description: An optional list of denial reasons in addition to declineReasonDescription + when multiple reasons apply. + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true + items: + $ref: '#/components/schemas/additionalDenialReason' + type: array + declineReasonDescription: + description: Explanation for why a verification request was declined. + example: Invalid Information - Can't Validate URL - Website is not accessible + / not available + nullable: false + type: string + denialStatusCode: + description: Reason code for denial. + example: 511 + type: integer + internalTicketNumber: + description: Unique identifier (UUID) generated by Bandwidth to assist in + tracking the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + phoneNumber: + description: Toll-free telephone number in E.164 format. + example: "+18005555555" + maxLength: 12 + minLength: 12 + nullable: false + pattern: "^\\+1(800|833|844|855|866|877|888)[2-9]\\d{6}$" + type: string + resubmitAllowed: + description: Whether a Toll-Free Verification request qualifies for resubmission + via PUT. + example: true + type: boolean + status: + default: UNVERIFIED + example: UNVERIFIED + type: string + type: object + verificationWebhook: + properties: + accountId: + description: User's account ID. + example: "1234567" + type: string + phoneNumber: + description: Toll-free telephone number in E.164 format. + example: "+18005555555" + maxLength: 12 + minLength: 12 + nullable: false + pattern: "^\\+1(800|833|844|855|866|877|888)[2-9]\\d{6}$" + type: string + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + description: Unique identifier (UUID) generated by Bandwidth to assist in + tracking the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + type: object + tfvSubmissionWrapper: + properties: + submission: + $ref: '#/components/schemas/verificationUpdateRequest' + type: object + address: + example: + zip: "27606" + addr2: addr2 + addr1: 2230 Bandmate Way + city: Raleigh + name: Bandwidth Inc. + state: NC + url: https://www.example.com/path/to/resource + nullable: false + properties: + name: + description: The name of the business using the toll-free number. + example: Bandwidth Inc. + maxLength: 500 + minLength: 1 + nullable: false + type: string + addr1: + description: The address of the business using the toll-free number. + example: 2230 Bandmate Way + maxLength: 500 + minLength: 1 + nullable: false + type: string + addr2: + description: The address of the business using the toll-free number. + maxLength: 500 + minLength: 0 + nullable: true + type: string + city: + description: The city of the business using the toll-free number. + example: Raleigh + maxLength: 500 + minLength: 1 + nullable: false + type: string + state: + description: The state of the business using the toll-free number. + example: NC + maxLength: 500 + minLength: 1 + nullable: false + type: string + zip: + description: The zip of the business using the toll-free number. + example: "27606" + nullable: false + pattern: "[- A-Za-z0-9]{0,500}" + type: string + url: + description: The website of the business using the toll-free number. + example: https://www.example.com/path/to/resource + format: url + maxLength: 500 + minLength: 1 + nullable: false + type: string + required: + - addr1 + - city + - name + - state + - url + - zip + type: object + optInWorkflow: + example: + imageUrls: + - https://www.example.com/path/to/resource + - https://www.example.com/path/to/resource + description: Opt In Flow + nullable: false + properties: + description: + example: Opt In Flow + maxLength: 500 + minLength: 1 + nullable: false + type: string + imageUrls: + items: + example: https://www.example.com/path/to/resource + maxLength: 500 + minLength: 1 + nullable: false + pattern: "^$|(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,253}\\\ + .[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*)" + type: string + type: array + required: + - description + - imageUrls + type: object + isvReseller: + description: ISV name. + example: Test ISV + maxLength: 500 + minLength: 0 + nullable: true + type: string + contact: + example: + firstName: John + lastName: Doe + phoneNumber: "+19192654500" + email: foo@bar.com + nullable: false + properties: + firstName: + description: The first name of the business contact using the toll-free + number. + example: John + maxLength: 500 + minLength: 1 + nullable: false + type: string + lastName: + description: The last name of the business contact using the toll-free number. + example: Doe + maxLength: 500 + minLength: 1 + nullable: false + type: string + email: + example: foo@bar.com + format: email + maxLength: 500 + minLength: 0 + nullable: false + pattern: "^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"\ + (?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\\ + [\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\ + .)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\\ + .){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\\ + x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\\ + x0b\\x0c\\x0e-\\x7f])+)\\])$" + type: string + phoneNumber: + description: Contact telephone number + example: "+19192654500" + maxLength: 500 + minLength: 1 + nullable: false + type: string + required: + - email + - firstName + - lastName + - phoneNumber + type: object + email: + example: foo@bar.com + format: email + maxLength: 500 + minLength: 0 + nullable: false + pattern: "^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"\ + (?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\\ + x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\ + [(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\\ + x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\\ + x0c\\x0e-\\x7f])+)\\])$" + type: string + useCases: + example: + - 2FA + - App Notifications + - Appointments + - Auctions + - Auto Repair Services + - Bank Transfers + - Billing + - Booking Confirmations + - Business Updates + - COVID-19 Alerts + items: + type: string + type: array + useCase: + description: The category of the use case. + example: 2FA + maxLength: 500 + minLength: 0 + type: string + webhookSubscriptionsListBody: + description: A list of all webhook subscriptions registered for this account + ID for this particular feature (unpaginated). + example: + data: + - accountId: "1234567" + createdDate: 2023-05-15T13:56:39.965Z + modifiedDate: 2023-05-15T13:56:39.965Z + callbackUrl: https://www.example.com/path/to/resource + id: 7hICGStfAfeGxEq3N0lQwO + type: TOLLFREE_VERIFICATION_STATUS + basicAuthentication: + password: password + username: username + - accountId: "1234567" + createdDate: 2023-05-15T13:56:39.965Z + modifiedDate: 2023-05-15T13:56:39.965Z + callbackUrl: https://www.example.com/path/to/resource + id: 7hICGStfAfeGxEq3N0lQwO + type: TOLLFREE_VERIFICATION_STATUS + basicAuthentication: + password: password + username: username + links: + next: next + previous: previous + last: last + first: first + errors: + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + properties: + links: + $ref: '#/components/schemas/linksObject' + errors: + items: + $ref: '#/components/schemas/error' + type: array + data: + items: + $ref: '#/components/schemas/webhookSubscription' + type: array + required: + - data + type: object + linksObject: + example: + next: next + previous: previous + last: last + first: first + properties: + first: + description: The first (or only) page of results matching the query. + type: string + next: + description: "If more results exist than specified by 'size', this link\ + \ returns the next page of 'size' results." + type: string + previous: + description: "If the results are more than one page, this link returns the\ + \ previous page of 'size' results." + type: string + last: + description: "If more results exist than specified by 'size', this link\ + \ return the last page of result." + type: string + type: object + error: + example: + code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + properties: + code: + type: integer + description: + type: string + telephoneNumbers: + items: + $ref: '#/components/schemas/telephoneNumber' + type: array + type: object + telephoneNumber: + example: + telephoneNumber: telephoneNumber + properties: + telephoneNumber: + description: Simple Telephone Number. + type: string + type: object + webhookSubscriptionTypeEnum: + enum: + - TOLLFREE_VERIFICATION_STATUS + - MESSAGING_PORTOUT_APPROVAL_STATUS + example: TOLLFREE_VERIFICATION_STATUS + type: string + webhookSubscription: + description: Information about a webhook that Bandwidth should send upon the + completion of event customer has subscribed to. + example: + accountId: "1234567" + createdDate: 2023-05-15T13:56:39.965Z + modifiedDate: 2023-05-15T13:56:39.965Z + callbackUrl: https://www.example.com/path/to/resource + id: 7hICGStfAfeGxEq3N0lQwO + type: TOLLFREE_VERIFICATION_STATUS + basicAuthentication: + password: password + username: username + properties: + id: + example: 7hICGStfAfeGxEq3N0lQwO + type: string + accountId: + example: "1234567" + type: string + callbackUrl: + description: "Callback URL to receive status updates from Bandwidth. When\ + \ a webhook subscription is registered with Bandwidth under a given account\ + \ ID, it will be used to send status updates for all requests submitted\ + \ under that account ID." + example: https://www.example.com/path/to/resource + format: url + maxLength: 2000 + minLength: 0 + nullable: true + pattern: "^$|(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,253}\\.[a-z]{2,6}\\\ + b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*)" + type: string + type: + $ref: '#/components/schemas/webhookSubscriptionTypeEnum' + basicAuthentication: + $ref: '#/components/schemas/webhookSubscription_basicAuthentication' + createdDate: + example: 2023-05-15T13:56:39.965Z + format: date-time + type: string + modifiedDate: + example: 2023-05-15T13:56:39.965Z + format: date-time + type: string + required: + - callbackUrl + type: object + webhookUrl: + description: "Callback URL to receive status updates from Bandwidth. When a\ + \ webhook subscription is registered with Bandwidth under a given account\ + \ ID, it will be used to send status updates for all requests submitted under\ + \ that account ID." + example: https://www.example.com/path/to/resource + format: url + maxLength: 2000 + minLength: 0 + nullable: true + pattern: "^$|(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,253}\\.[a-z]{2,6}\\\ + b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*)" + type: string + tfvError: + description: A generic error object. + example: + description: Error Message + type: Error Type + errors: + field: error message + properties: + type: + example: Error Type + type: string + description: + example: Error Message + type: string + errors: + description: "Each key of this errors object refers to a field of the submitted\ + \ object (using dot notation for nested objects), with the field being\ + \ a key to an array of one or more errors for that field." + example: + field: error message + type: object + type: object + tfvStatus: + example: + internalTicketNumber: acde070d-8c4c-4f0d-9d8a-162843c10333 + phoneNumber: "+18005555555" + resubmitAllowed: true + createdDateTime: 2021-06-08T06:45:13Z + modifiedDateTime: 2021-06-08T06:45:13Z + submission: + additionalInformation: Any additional information + useCase: 2FA + isvReseller: Test ISV + businessContact: + firstName: John + lastName: Doe + phoneNumber: "+19192654500" + email: foo@bar.com + messageVolume: 10000 + productionMessageContent: Production message content + businessAddress: + zip: "27606" + addr2: addr2 + addr1: 2230 Bandmate Way + city: Raleigh + name: Bandwidth Inc. + state: NC + url: https://www.example.com/path/to/resource + useCaseSummary: Text summarizing the use case for the toll-free number + optInWorkflow: + imageUrls: + - https://www.example.com/path/to/resource + - https://www.example.com/path/to/resource + description: Opt In Flow + declineReasonDescription: Invalid Information - Can't Validate URL - Website + is not accessible / not available + status: VERIFIED + properties: + phoneNumber: + description: Toll-free telephone number in E.164 format. + example: "+18005555555" + maxLength: 12 + minLength: 12 + nullable: false + pattern: "^\\+1(800|833|844|855|866|877|888)[2-9]\\d{6}$" + type: string + status: + $ref: '#/components/schemas/tfvStatusEnum' + internalTicketNumber: + description: Unique identifier (UUID) generated by Bandwidth to assist in + tracking the verification status of a toll-free number - included in all + webhook payloads. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + format: uuid + type: string + declineReasonDescription: + description: Explanation for why a verification request was declined. + example: Invalid Information - Can't Validate URL - Website is not accessible + / not available + nullable: false + type: string + resubmitAllowed: + description: Whether a Toll-Free Verification request qualifies for resubmission + via PUT. + example: true + type: boolean + createdDateTime: + description: Date and time the verification request was created. + example: 2021-06-08T06:45:13Z + format: date-time + type: string + modifiedDateTime: + description: Date and time the verification request was last modified. + example: 2021-06-08T06:45:13Z + format: date-time + type: string + submission: + $ref: '#/components/schemas/tfvSubmissionInfo' + type: object + tfvSubmissionInfo: + example: + additionalInformation: Any additional information + useCase: 2FA + isvReseller: Test ISV + businessContact: + firstName: John + lastName: Doe + phoneNumber: "+19192654500" + email: foo@bar.com + messageVolume: 10000 + productionMessageContent: Production message content + businessAddress: + zip: "27606" + addr2: addr2 + addr1: 2230 Bandmate Way + city: Raleigh + name: Bandwidth Inc. + state: NC + url: https://www.example.com/path/to/resource + useCaseSummary: Text summarizing the use case for the toll-free number + optInWorkflow: + imageUrls: + - https://www.example.com/path/to/resource + - https://www.example.com/path/to/resource + description: Opt In Flow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + description: Estimated monthly volume of messages from the toll-free number. + example: 10000 + maximum: 10000000 + minimum: 10 + type: integer + useCase: + description: The category of the use case. + example: 2FA + maxLength: 500 + minLength: 0 + type: string + useCaseSummary: + description: A general idea of the use case and customer. + example: Text summarizing the use case for the toll-free number + maxLength: 500 + minLength: 0 + nullable: false + type: string + productionMessageContent: + description: Example of message content. + example: Production message content + maxLength: 500 + minLength: 0 + nullable: false + type: string + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + description: Any additional information. + example: Any additional information + maxLength: 500 + minLength: 0 + nullable: true + type: string + isvReseller: + description: ISV name. + example: Test ISV + maxLength: 500 + minLength: 0 + nullable: true + type: string + type: object + tfvStatusEnum: + enum: + - VERIFIED + - UNVERIFIED + - PENDING + - PARTIALLY_VERIFIED + - INVALID_STATUS + example: VERIFIED + type: string + sharedSecretKey: + description: An ASCII string submitted by the user as a shared secret key for + generating an HMAC header for callbacks. + example: This is my $3cret + maxLength: 64 + minLength: 16 + nullable: true + pattern: "^[ -~]{16,64}$" + type: string + webhookSubscription_basicAuthentication: + description: "Basic authentication credentials are not required, but if present,\ + \ both username and password must be provided." + example: + password: password + username: username + properties: + username: + maxLength: 100 + type: string + password: + maxLength: 200 + type: string + required: + - password + - username + type: object securitySchemes: Basic: description: |- diff --git a/bandwidth.yml b/bandwidth.yml index 87921df..70ca20d 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -19,6 +19,7 @@ tags: - name: Transcriptions - name: MFA - name: Phone Number Lookup + - name: Toll-Free Verification paths: /users/{accountId}/media: get: @@ -1328,6 +1329,270 @@ paths: '500': $ref: '#/components/responses/tnLookupInternalServerError' servers: *ref_3 + /accounts/{accountId}/tollFreeVerification: + post: + tags: + - Toll-Free Verification + summary: Request Toll-Free Verification + description: Submit a request for verification of a toll-free phone number. + operationId: requestTollFreeVerification + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + servers: &ref_4 + - url: https://api.bandwidth.com/api/v2 + description: Production + /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: + get: + tags: + - Toll-Free Verification + summary: Get Toll-Free Verification Status + description: >- + Gets the verification status for a phone number that is provisioned to + your account. + + Submission information will be appended to the response if it is + available. + operationId: getTollFreeVerificationStatus + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '200': + $ref: '#/components/responses/getTollFreeVerificationStatusResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Toll-Free Verification Request + description: >- + Updates a toll-free verification request. + + Submissions are only eligible for resubmission for 7 days within being + processed and if resubmission is allowed (resubmitAllowed field is + true). + operationId: updateTollFreeVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + requestBody: + $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: + get: + tags: + - Toll-Free Verification + summary: List Webhook Subscriptions + description: >- + Lists all webhook subscriptions that are registered to receive status + updates for the toll-free verification requests submitted under this + account (password will not be returned through this API + + If `basicAuthentication` is defined, the `password` property of that + object will be null). + operationId: listWebhookSubscriptions + parameters: + - $ref: '#/components/parameters/accountId' + responses: + '200': + $ref: '#/components/responses/listWebhookSubscriptionsResponse' + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + post: + tags: + - Toll-Free Verification + summary: Create Webhook Subscription + description: >- + Create a new webhook subscription (this webhook will be called for every + update on every submission). + + In addition to a `callbackUrl`, this subscription can provide optional + HTTP basic authentication credentials (a username and a password). + + The returned subscription object will contain an ID that can be used to + modify or delete the subscription at a later time. + operationId: createWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '201': + $ref: '#/components/responses/createWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: + delete: + tags: + - Toll-Free Verification + summary: Delete Webhook Subscription + description: Delete a webhook subscription by ID. + operationId: deleteWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Webhook Subscription + description: >- + Update an existing webhook subscription (`callbackUrl` and + `basicAuthentication` can be updated). + operationId: updateWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '200': + $ref: '#/components/responses/updateWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /tollFreeVerification/useCases: + get: + tags: + - Toll-Free Verification + summary: List Toll-Free Use Cases + description: Lists valid toll-free use cases. + operationId: listTollFreeUseCases + responses: + '200': + $ref: '#/components/responses/listTollFreeUseCasesResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 components: schemas: callbackTypeEnum: @@ -4410,6 +4675,640 @@ components: type: string description: A description of what validation error occurred. example: example error message + accountId1: + type: string + description: User's account ID. + example: '1234567' + tfPhoneNumber: + type: string + description: Toll-free telephone number in E.164 format. + minLength: 12 + maxLength: 12 + nullable: false + pattern: ^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$ + example: '+18005555555' + tfvWebhookErrors: + type: array + description: Details of the errors that were encountered when processing the request. + items: + type: string + example: 'optInWorkflowImageURLs: Entries must be a valid array of objects.' + tfvCallbackStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + example: VERIFIED + tfvUnverifiedStatus: + type: string + default: UNVERIFIED + example: UNVERIFIED + declineReasonDescription: + type: string + description: Explanation for why a verification request was declined. + nullable: false + example: >- + Invalid Information - Can't Validate URL - Website is not accessible / + not available + denialStatusCode: + description: Reason code for denial. + type: integer + example: 511 + resubmitAllowed: + description: >- + Whether a Toll-Free Verification request qualifies for resubmission via + PUT. + example: true + type: boolean + additionalDenialReason: + properties: + statusCode: + $ref: '#/components/schemas/denialStatusCode' + reason: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + required: + - statusCode + - reason + - resubmitAllowed + type: object + internalTicketNumber: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number - included in all webhook + payloads. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + internalTicketNumberForWebhook: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + businessContactPhoneNumber: + description: Contact telephone number + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: '+19192654500' + verificationRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - phoneNumbers + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + phoneNumbers: + type: array + minItems: 1 + maxItems: 10 + items: + $ref: '#/components/schemas/tfPhoneNumber' + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + type: string + description: A general idea of the use case and customer. + minLength: 1 + maxLength: 500 + nullable: false + productionMessageContent: + type: string + description: Example of message content. + minLength: 1 + maxLength: 500 + nullable: false + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + isvReseller: + $ref: '#/components/schemas/isvReseller' + verificationUpdateRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + type: string + description: A general idea of the use case and customer. + minLength: 0 + maxLength: 500 + nullable: false + productionMessageContent: + type: string + description: Example of message content. + minLength: 0 + maxLength: 500 + nullable: false + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + isvReseller: + $ref: '#/components/schemas/isvReseller' + tfvBasicAuthentication: + type: object + properties: + username: + type: string + maxLength: 100 + password: + type: string + maxLength: 200 + required: + - username + - password + webhookSubscriptionRequestSchema: + type: object + properties: + basicAuthentication: + $ref: '#/components/schemas/tfvBasicAuthentication' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + sharedSecretKey: + $ref: '#/components/schemas/sharedSecretKey' + required: + - callbackUrl + failureWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + errorCode: + type: string + description: >- + An error code indicating what error was encountered. This code can + be interpreted as an HTTP status code in regards to the error that + was encountered. + example: '400' + errorDescription: + type: string + description: A description of the error that was encountered. + example: cannot process request. + errors: + $ref: '#/components/schemas/tfvWebhookErrors' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + verificationDenialWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + additionalDenialReasons: + description: >- + An optional list of denial reasons in addition to + declineReasonDescription when multiple reasons apply. + items: + $ref: '#/components/schemas/additionalDenialReason' + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true + type: array + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + denialStatusCode: + $ref: '#/components/schemas/denialStatusCode' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + status: + $ref: '#/components/schemas/tfvUnverifiedStatus' + verificationWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + tfvSubmissionWrapper: + type: object + properties: + submission: + $ref: '#/components/schemas/verificationUpdateRequest' + address: + type: object + nullable: false + required: + - name + - addr1 + - city + - state + - zip + - url + properties: + name: + type: string + description: The name of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Bandwidth Inc. + addr1: + type: string + description: The address of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: 2230 Bandmate Way + addr2: + type: string + description: The address of the business using the toll-free number. + minLength: 0 + maxLength: 500 + nullable: true + city: + type: string + description: The city of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Raleigh + state: + type: string + description: The state of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: NC + zip: + type: string + description: The zip of the business using the toll-free number. + nullable: false + example: '27606' + pattern: '[- A-Za-z0-9]{0,500}' + url: + type: string + format: url + description: The website of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + optInWorkflow: + type: object + nullable: false + required: + - description + - imageUrls + properties: + description: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: Opt In Flow + imageUrls: + type: array + items: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + isvReseller: + type: string + description: ISV name. + minLength: 0 + maxLength: 500 + nullable: true + example: Test ISV + contact: + type: object + nullable: false + required: + - firstName + - lastName + - email + - phoneNumber + properties: + firstName: + type: string + description: The first name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: John + lastName: + type: string + description: The last name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Doe + email: + $ref: '#/components/schemas/email' + phoneNumber: + $ref: '#/components/schemas/businessContactPhoneNumber' + email: + type: string + format: email + minLength: 0 + maxLength: 500 + nullable: false + pattern: >- + ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ + example: foo@bar.com + useCases: + type: array + items: + type: string + example: + - 2FA + - App Notifications + - Appointments + - Auctions + - Auto Repair Services + - Bank Transfers + - Billing + - Booking Confirmations + - Business Updates + - COVID-19 Alerts + useCase: + type: string + description: The category of the use case. + minLength: 0 + maxLength: 500 + example: 2FA + webhookSubscriptionsListBody: + description: >- + A list of all webhook subscriptions registered for this account ID for + this particular feature (unpaginated). + type: object + required: + - data + properties: + links: + $ref: '#/components/schemas/linksObject' + errors: + type: array + items: + $ref: '#/components/schemas/error' + data: + items: + $ref: '#/components/schemas/webhookSubscription' + type: array + linksObject: + type: object + properties: + first: + description: The first (or only) page of results matching the query. + type: string + next: + description: >- + If more results exist than specified by 'size', this link returns + the next page of 'size' results. + type: string + previous: + description: >- + If the results are more than one page, this link returns the + previous page of 'size' results. + type: string + last: + description: >- + If more results exist than specified by 'size', this link return the + last page of result. + type: string + error: + type: object + properties: + code: + type: integer + description: + type: string + telephoneNumbers: + type: array + items: + $ref: '#/components/schemas/telephoneNumber' + telephoneNumber: + type: object + properties: + telephoneNumber: + description: Simple Telephone Number. + type: string + webhookSubscriptionTypeEnum: + type: string + enum: + - TOLLFREE_VERIFICATION_STATUS + - MESSAGING_PORTOUT_APPROVAL_STATUS + example: TOLLFREE_VERIFICATION_STATUS + webhookSubscription: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer has subscribed to. + type: object + required: + - callbackUrl + properties: + id: + type: string + example: 7hICGStfAfeGxEq3N0lQwO + accountId: + type: string + example: '1234567' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + type: + $ref: '#/components/schemas/webhookSubscriptionTypeEnum' + basicAuthentication: + description: >- + Basic authentication credentials are not required, but if present, + both username and password must be provided. + type: object + required: + - username + - password + properties: + username: + type: string + maxLength: 100 + password: + type: string + maxLength: 200 + createdDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + modifiedDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + webhookUrl: + description: >- + Callback URL to receive status updates from Bandwidth. When a webhook + subscription is registered with Bandwidth under a given account ID, it + will be used to send status updates for all requests submitted under + that account ID. + type: string + format: url + minLength: 0 + maxLength: 2000 + nullable: true + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + tfvError: + description: A generic error object. + properties: + type: + type: string + example: Error Type + description: + type: string + example: Error Message + errors: + type: object + description: >- + Each key of this errors object refers to a field of the submitted + object (using dot notation for nested objects), with the field being + a key to an array of one or more errors for that field. + example: + field: error message + type: object + tfvStatus: + type: object + properties: + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumber' + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + createdDateTime: + type: string + description: Date and time the verification request was created. + format: date-time + example: '2021-06-08T06:45:13.0Z' + modifiedDateTime: + type: string + description: Date and time the verification request was last modified. + format: date-time + example: '2021-06-08T06:45:13.0Z' + submission: + $ref: '#/components/schemas/tfvSubmissionInfo' + tfvSubmissionInfo: + type: object + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + type: string + description: A general idea of the use case and customer. + minLength: 0 + maxLength: 500 + nullable: false + example: Text summarizing the use case for the toll-free number + productionMessageContent: + type: string + description: Example of message content. + minLength: 0 + maxLength: 500 + nullable: false + example: Production message content + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + example: Any additional information + isvReseller: + $ref: '#/components/schemas/isvReseller' + tfvStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + - PENDING + - PARTIALLY_VERIFIED + - INVALID_STATUS + example: VERIFIED + sharedSecretKey: + description: >- + An ASCII string submitted by the user as a shared secret key for + generating an HMAC header for callbacks. + example: This is my $3cret + maxLength: 64 + minLength: 16 + nullable: true + pattern: ^[ -~]{16,64}$ + type: string responses: createMessageResponse: description: Accepted @@ -4860,6 +5759,120 @@ components: summary: Example Internal Server Error Error value: message: Request has not been passed further. + getTollFreeVerificationStatusResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/tfvStatus' + listWebhookSubscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionsListBody' + createWebhookSubscriptionResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + updateWebhookSubscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + listTollFreeUseCasesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/useCases' + tfvBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot process request. + type: bad request + tfvPostBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + tfvUnauthorizedResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + tfvForbiddenResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is not authorized for the action. + type: forbidden + tfvNotFoundResponse: + description: Cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot find the requested resource. + type: Not Found + tfvNotAllowedResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Method is not allowed. + type: Method Not Allowed + tfvTooManyRequestsResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Throttling error. Too many requests. + type: Too Many Requests + tfvServerErrorResponse: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Internal Server Error. + type: Internal Server Error + tfvServiceUnavailableResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Service Unavailable Error. + type: Service Unavailable parameters: accountId: in: path @@ -5227,6 +6240,22 @@ components: type: string description: The phone number lookup request ID from Bandwidth. example: 004223a0-8b17-41b1-bf81-20732adf5590 + tfPhoneNumberPathParam: + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + description: Valid Toll-Free telephone number in E.164 format. + example: '+18885555555' + webhookSubscriptionIdPathParam: + in: path + name: id + required: true + schema: + type: string + description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu examples: smsMessageReceivedCallbackExample: summary: An example of a sms message-received callback body. @@ -5843,6 +6872,39 @@ components: $ref: '#/components/examples/singleNumberRequestExample' multipleNumberRequestExample: $ref: '#/components/examples/multipleNumberRequestExample' + requestTollFreeVerificationRequest: + description: Request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verificationRequest' + updateTollFreeVerificationRequestRequest: + description: Update a request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/tfvSubmissionWrapper' + verificationWebhookRequest: + description: Verification callback status of a toll-free phone number. + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/verificationWebhook' + - $ref: '#/components/schemas/verificationDenialWebhook' + - $ref: '#/components/schemas/failureWebhook' + webhookSubscriptionRequest: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer is trying to subscribe to. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionRequestSchema' securitySchemes: Basic: type: http @@ -5913,3 +6975,43 @@ components: responses: '200': description: OK + tfVerificationStatus: + your_url.com/webhookService: + post: + summary: TFV status updates sent to customer's webhook URL. + description: >- + Unique webhook URL provided by customers to which Bandwidth sends a + POST request to notify customer regarding TFV status updates. + operationId: tfvRequest + parameters: + - description: >- + 64-character lowercase hexidecimal HMAC calculated with a shared + secret key, the canonicalized request body, and SHA256. It is + only included when a shared secret key is set through webhook + subscription. + example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 + in: header + name: x-bandwidth-signature-hmac-sha256 + schema: + type: string + requestBody: + $ref: '#/components/requestBodies/verificationWebhookRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' diff --git a/docs/AdditionalDenialReason.md b/docs/AdditionalDenialReason.md new file mode 100644 index 0000000..158abb1 --- /dev/null +++ b/docs/AdditionalDenialReason.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.AdditionalDenialReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StatusCode** | **int** | Reason code for denial. | +**Reason** | **string** | Explanation for why a verification request was declined. | +**ResubmitAllowed** | **bool** | Whether a Toll-Free Verification request qualifies for resubmission via PUT. | + +[[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/Address.md b/docs/Address.md new file mode 100644 index 0000000..c24a07c --- /dev/null +++ b/docs/Address.md @@ -0,0 +1,16 @@ +# Bandwidth.Standard.Model.Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the business using the toll-free number. | +**Addr1** | **string** | The address of the business using the toll-free number. | +**Addr2** | **string** | The address of the business using the toll-free number. | [optional] +**City** | **string** | The city of the business using the toll-free number. | +**State** | **string** | The state of the business using the toll-free number. | +**Zip** | **string** | The zip of the business using the toll-free number. | +**Url** | **string** | The website of the business using the toll-free number. | + +[[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/Contact.md b/docs/Contact.md new file mode 100644 index 0000000..b009f33 --- /dev/null +++ b/docs/Contact.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.Contact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The first name of the business contact using the toll-free number. | +**LastName** | **string** | The last name of the business contact using the toll-free number. | +**Email** | **string** | | +**PhoneNumber** | **string** | Contact telephone number | + +[[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/Error.md b/docs/Error.md new file mode 100644 index 0000000..366809b --- /dev/null +++ b/docs/Error.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Description** | **string** | | [optional] +**TelephoneNumbers** | [**List<TelephoneNumber>**](TelephoneNumber.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FailureWebhook.md b/docs/FailureWebhook.md new file mode 100644 index 0000000..bf8eef9 --- /dev/null +++ b/docs/FailureWebhook.md @@ -0,0 +1,15 @@ +# Bandwidth.Standard.Model.FailureWebhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | User's account ID. | [optional] +**PhoneNumber** | **string** | Toll-free telephone number in E.164 format. | [optional] +**ErrorCode** | **string** | An error code indicating what error was encountered. This code can be interpreted as an HTTP status code in regards to the error that was encountered. | [optional] +**ErrorDescription** | **string** | A description of the error that was encountered. | [optional] +**Errors** | **List<string>** | Details of the errors that were encountered when processing the request. | [optional] +**InternalTicketNumber** | **Guid** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/LinksObject.md b/docs/LinksObject.md new file mode 100644 index 0000000..6e4c69e --- /dev/null +++ b/docs/LinksObject.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.LinksObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**First** | **string** | The first (or only) page of results matching the query. | [optional] +**Next** | **string** | If more results exist than specified by 'size', this link returns the next page of 'size' results. | [optional] +**Previous** | **string** | If the results are more than one page, this link returns the previous page of 'size' results. | [optional] +**Last** | **string** | If more results exist than specified by 'size', this link return the last page of result. | [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/OptInWorkflow.md b/docs/OptInWorkflow.md new file mode 100644 index 0000000..4813c9e --- /dev/null +++ b/docs/OptInWorkflow.md @@ -0,0 +1,11 @@ +# Bandwidth.Standard.Model.OptInWorkflow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**ImageUrls** | **List<string>** | | + +[[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/TelephoneNumber.md b/docs/TelephoneNumber.md new file mode 100644 index 0000000..81c9981 --- /dev/null +++ b/docs/TelephoneNumber.md @@ -0,0 +1,10 @@ +# Bandwidth.Standard.Model.TelephoneNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarTelephoneNumber** | **string** | Simple Telephone Number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TfvBasicAuthentication.md b/docs/TfvBasicAuthentication.md new file mode 100644 index 0000000..33ec0a5 --- /dev/null +++ b/docs/TfvBasicAuthentication.md @@ -0,0 +1,11 @@ +# Bandwidth.Standard.Model.TfvBasicAuthentication + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | | +**Password** | **string** | | + +[[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/TfvCallbackStatusEnum.md b/docs/TfvCallbackStatusEnum.md new file mode 100644 index 0000000..6531ba9 --- /dev/null +++ b/docs/TfvCallbackStatusEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.TfvCallbackStatusEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TfvError.md b/docs/TfvError.md new file mode 100644 index 0000000..7537398 --- /dev/null +++ b/docs/TfvError.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.TfvError +A generic error object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | [optional] +**Description** | **string** | | [optional] +**Errors** | **Object** | Each key of this errors object refers to a field of the submitted object (using dot notation for nested objects), with the field being a key to an array of one or more errors for that field. | [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/TfvStatus.md b/docs/TfvStatus.md new file mode 100644 index 0000000..915d592 --- /dev/null +++ b/docs/TfvStatus.md @@ -0,0 +1,17 @@ +# Bandwidth.Standard.Model.TfvStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PhoneNumber** | **string** | Toll-free telephone number in E.164 format. | [optional] +**Status** | **TfvStatusEnum** | | [optional] +**InternalTicketNumber** | **Guid** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. | [optional] +**DeclineReasonDescription** | **string** | Explanation for why a verification request was declined. | [optional] +**ResubmitAllowed** | **bool** | Whether a Toll-Free Verification request qualifies for resubmission via PUT. | [optional] +**CreatedDateTime** | **DateTime** | Date and time the verification request was created. | [optional] +**ModifiedDateTime** | **DateTime** | Date and time the verification request was last modified. | [optional] +**Submission** | [**TfvSubmissionInfo**](TfvSubmissionInfo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TfvStatusEnum.md b/docs/TfvStatusEnum.md new file mode 100644 index 0000000..6a9f2dc --- /dev/null +++ b/docs/TfvStatusEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.TfvStatusEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TfvSubmissionInfo.md b/docs/TfvSubmissionInfo.md new file mode 100644 index 0000000..91d5950 --- /dev/null +++ b/docs/TfvSubmissionInfo.md @@ -0,0 +1,18 @@ +# Bandwidth.Standard.Model.TfvSubmissionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BusinessAddress** | [**Address**](Address.md) | | [optional] +**BusinessContact** | [**Contact**](Contact.md) | | [optional] +**MessageVolume** | **int** | Estimated monthly volume of messages from the toll-free number. | [optional] +**UseCase** | **string** | The category of the use case. | [optional] +**UseCaseSummary** | **string** | A general idea of the use case and customer. | [optional] +**ProductionMessageContent** | **string** | Example of message content. | [optional] +**OptInWorkflow** | [**OptInWorkflow**](OptInWorkflow.md) | | [optional] +**AdditionalInformation** | **string** | Any additional information. | [optional] +**IsvReseller** | **string** | ISV name. | [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/TfvSubmissionWrapper.md b/docs/TfvSubmissionWrapper.md new file mode 100644 index 0000000..55b9b57 --- /dev/null +++ b/docs/TfvSubmissionWrapper.md @@ -0,0 +1,10 @@ +# Bandwidth.Standard.Model.TfvSubmissionWrapper + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Submission** | [**VerificationUpdateRequest**](VerificationUpdateRequest.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TollFreeVerificationApi.md b/docs/TollFreeVerificationApi.md new file mode 100644 index 0000000..fbbda62 --- /dev/null +++ b/docs/TollFreeVerificationApi.md @@ -0,0 +1,835 @@ +# Bandwidth.Standard.Api.TollFreeVerificationApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**CreateWebhookSubscription**](TollFreeVerificationApi.md#createwebhooksubscription) | **POST** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | Create Webhook Subscription | +| [**DeleteWebhookSubscription**](TollFreeVerificationApi.md#deletewebhooksubscription) | **DELETE** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Delete Webhook Subscription | +| [**GetTollFreeVerificationStatus**](TollFreeVerificationApi.md#gettollfreeverificationstatus) | **GET** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Get Toll-Free Verification Status | +| [**ListTollFreeUseCases**](TollFreeVerificationApi.md#listtollfreeusecases) | **GET** /tollFreeVerification/useCases | List Toll-Free Use Cases | +| [**ListWebhookSubscriptions**](TollFreeVerificationApi.md#listwebhooksubscriptions) | **GET** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | List Webhook Subscriptions | +| [**RequestTollFreeVerification**](TollFreeVerificationApi.md#requesttollfreeverification) | **POST** /accounts/{accountId}/tollFreeVerification | Request Toll-Free Verification | +| [**UpdateTollFreeVerificationRequest**](TollFreeVerificationApi.md#updatetollfreeverificationrequest) | **PUT** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Update Toll-Free Verification Request | +| [**UpdateWebhookSubscription**](TollFreeVerificationApi.md#updatewebhooksubscription) | **PUT** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Update Webhook Subscription | + + +# **CreateWebhookSubscription** +> WebhookSubscription CreateWebhookSubscription (string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema) + +Create Webhook Subscription + +Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class CreateWebhookSubscriptionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var webhookSubscriptionRequestSchema = new WebhookSubscriptionRequestSchema(); // WebhookSubscriptionRequestSchema | Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + + try + { + // Create Webhook Subscription + WebhookSubscription result = apiInstance.CreateWebhookSubscription(accountId, webhookSubscriptionRequestSchema); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.CreateWebhookSubscription: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateWebhookSubscriptionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Webhook Subscription + ApiResponse response = apiInstance.CreateWebhookSubscriptionWithHttpInfo(accountId, webhookSubscriptionRequestSchema); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.CreateWebhookSubscriptionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **webhookSubscriptionRequestSchema** | [**WebhookSubscriptionRequestSchema**](WebhookSubscriptionRequestSchema.md) | Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. | | + +### Return type + +[**WebhookSubscription**](WebhookSubscription.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Cannot find the requested resource. | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteWebhookSubscription** +> void DeleteWebhookSubscription (string accountId, string id) + +Delete Webhook Subscription + +Delete a webhook subscription by ID. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class DeleteWebhookSubscriptionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var id = 7bt57JcsVYJrN9K1OcV1Nu; // string | Webhook subscription ID + + try + { + // Delete Webhook Subscription + apiInstance.DeleteWebhookSubscription(accountId, id); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.DeleteWebhookSubscription: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteWebhookSubscriptionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Webhook Subscription + apiInstance.DeleteWebhookSubscriptionWithHttpInfo(accountId, id); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.DeleteWebhookSubscriptionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **id** | **string** | Webhook subscription ID | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Cannot find the requested resource. | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetTollFreeVerificationStatus** +> TfvStatus GetTollFreeVerificationStatus (string accountId, string phoneNumber) + +Get Toll-Free Verification Status + +Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class GetTollFreeVerificationStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var phoneNumber = +18885555555; // string | Valid Toll-Free telephone number in E.164 format. + + try + { + // Get Toll-Free Verification Status + TfvStatus result = apiInstance.GetTollFreeVerificationStatus(accountId, phoneNumber); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.GetTollFreeVerificationStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetTollFreeVerificationStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Toll-Free Verification Status + ApiResponse response = apiInstance.GetTollFreeVerificationStatusWithHttpInfo(accountId, phoneNumber); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.GetTollFreeVerificationStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **phoneNumber** | **string** | Valid Toll-Free telephone number in E.164 format. | | + +### Return type + +[**TfvStatus**](TfvStatus.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Cannot find the requested resource. | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ListTollFreeUseCases** +> List<string> ListTollFreeUseCases () + +List Toll-Free Use Cases + +Lists valid toll-free use cases. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class ListTollFreeUseCasesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + + try + { + // List Toll-Free Use Cases + List result = apiInstance.ListTollFreeUseCases(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.ListTollFreeUseCases: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListTollFreeUseCasesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Toll-Free Use Cases + ApiResponse> response = apiInstance.ListTollFreeUseCasesWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.ListTollFreeUseCasesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Cannot find the requested resource. | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ListWebhookSubscriptions** +> WebhookSubscriptionsListBody ListWebhookSubscriptions (string accountId) + +List Webhook Subscriptions + +Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class ListWebhookSubscriptionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + + try + { + // List Webhook Subscriptions + WebhookSubscriptionsListBody result = apiInstance.ListWebhookSubscriptions(accountId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.ListWebhookSubscriptions: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListWebhookSubscriptionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Webhook Subscriptions + ApiResponse response = apiInstance.ListWebhookSubscriptionsWithHttpInfo(accountId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.ListWebhookSubscriptionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | + +### Return type + +[**WebhookSubscriptionsListBody**](WebhookSubscriptionsListBody.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **RequestTollFreeVerification** +> void RequestTollFreeVerification (string accountId, VerificationRequest verificationRequest) + +Request Toll-Free Verification + +Submit a request for verification of a toll-free phone number. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class RequestTollFreeVerificationExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var verificationRequest = new VerificationRequest(); // VerificationRequest | Request for verification of a toll-free phone number. + + try + { + // Request Toll-Free Verification + apiInstance.RequestTollFreeVerification(accountId, verificationRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.RequestTollFreeVerification: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RequestTollFreeVerificationWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Request Toll-Free Verification + apiInstance.RequestTollFreeVerificationWithHttpInfo(accountId, verificationRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.RequestTollFreeVerificationWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **verificationRequest** | [**VerificationRequest**](VerificationRequest.md) | Request for verification of a toll-free phone number. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateTollFreeVerificationRequest** +> void UpdateTollFreeVerificationRequest (string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper) + +Update Toll-Free Verification Request + +Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class UpdateTollFreeVerificationRequestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var phoneNumber = +18885555555; // string | Valid Toll-Free telephone number in E.164 format. + var tfvSubmissionWrapper = new TfvSubmissionWrapper(); // TfvSubmissionWrapper | Update a request for verification of a toll-free phone number. + + try + { + // Update Toll-Free Verification Request + apiInstance.UpdateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.UpdateTollFreeVerificationRequest: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateTollFreeVerificationRequestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update Toll-Free Verification Request + apiInstance.UpdateTollFreeVerificationRequestWithHttpInfo(accountId, phoneNumber, tfvSubmissionWrapper); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.UpdateTollFreeVerificationRequestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **phoneNumber** | **string** | Valid Toll-Free telephone number in E.164 format. | | +| **tfvSubmissionWrapper** | [**TfvSubmissionWrapper**](TfvSubmissionWrapper.md) | Update a request for verification of a toll-free phone number. | | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateWebhookSubscription** +> WebhookSubscription UpdateWebhookSubscription (string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema) + +Update Webhook Subscription + +Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Example +{ + public class UpdateWebhookSubscriptionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure HTTP basic authorization: Basic + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new TollFreeVerificationApi(config); + var accountId = 9900000; // string | Your Bandwidth Account ID. + var id = 7bt57JcsVYJrN9K1OcV1Nu; // string | Webhook subscription ID + var webhookSubscriptionRequestSchema = new WebhookSubscriptionRequestSchema(); // WebhookSubscriptionRequestSchema | Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + + try + { + // Update Webhook Subscription + WebhookSubscription result = apiInstance.UpdateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling TollFreeVerificationApi.UpdateWebhookSubscription: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateWebhookSubscriptionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update Webhook Subscription + ApiResponse response = apiInstance.UpdateWebhookSubscriptionWithHttpInfo(accountId, id, webhookSubscriptionRequestSchema); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TollFreeVerificationApi.UpdateWebhookSubscriptionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string** | Your Bandwidth Account ID. | | +| **id** | **string** | Webhook subscription ID | | +| **webhookSubscriptionRequestSchema** | [**WebhookSubscriptionRequestSchema**](WebhookSubscriptionRequestSchema.md) | Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. | | + +### Return type + +[**WebhookSubscription**](WebhookSubscription.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Cannot find the requested resource. | - | +| **405** | Method Not Allowed | - | +| **429** | Too Many Requests | - | +| **500** | Internal Server Error | - | +| **503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/VerificationDenialWebhook.md b/docs/VerificationDenialWebhook.md new file mode 100644 index 0000000..823bfa3 --- /dev/null +++ b/docs/VerificationDenialWebhook.md @@ -0,0 +1,17 @@ +# Bandwidth.Standard.Model.VerificationDenialWebhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | User's account ID. | [optional] +**AdditionalDenialReasons** | [**List<AdditionalDenialReason>**](AdditionalDenialReason.md) | An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. | [optional] +**DeclineReasonDescription** | **string** | Explanation for why a verification request was declined. | [optional] +**DenialStatusCode** | **int** | Reason code for denial. | [optional] +**InternalTicketNumber** | **Guid** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. | [optional] +**PhoneNumber** | **string** | Toll-free telephone number in E.164 format. | [optional] +**ResubmitAllowed** | **bool** | Whether a Toll-Free Verification request qualifies for resubmission via PUT. | [optional] +**Status** | **string** | | [optional] [default to "UNVERIFIED"] + +[[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/VerificationRequest.md b/docs/VerificationRequest.md new file mode 100644 index 0000000..ba519d5 --- /dev/null +++ b/docs/VerificationRequest.md @@ -0,0 +1,19 @@ +# Bandwidth.Standard.Model.VerificationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BusinessAddress** | [**Address**](Address.md) | | +**BusinessContact** | [**Contact**](Contact.md) | | +**MessageVolume** | **int** | Estimated monthly volume of messages from the toll-free number. | +**PhoneNumbers** | **List<string>** | | +**UseCase** | **string** | The category of the use case. | +**UseCaseSummary** | **string** | A general idea of the use case and customer. | +**ProductionMessageContent** | **string** | Example of message content. | +**OptInWorkflow** | [**OptInWorkflow**](OptInWorkflow.md) | | +**AdditionalInformation** | **string** | Any additional information. | [optional] +**IsvReseller** | **string** | ISV name. | [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/VerificationUpdateRequest.md b/docs/VerificationUpdateRequest.md new file mode 100644 index 0000000..b61a771 --- /dev/null +++ b/docs/VerificationUpdateRequest.md @@ -0,0 +1,18 @@ +# Bandwidth.Standard.Model.VerificationUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BusinessAddress** | [**Address**](Address.md) | | +**BusinessContact** | [**Contact**](Contact.md) | | +**MessageVolume** | **int** | Estimated monthly volume of messages from the toll-free number. | +**UseCase** | **string** | The category of the use case. | +**UseCaseSummary** | **string** | A general idea of the use case and customer. | +**ProductionMessageContent** | **string** | Example of message content. | +**OptInWorkflow** | [**OptInWorkflow**](OptInWorkflow.md) | | +**AdditionalInformation** | **string** | Any additional information. | [optional] +**IsvReseller** | **string** | ISV name. | [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/VerificationWebhook.md b/docs/VerificationWebhook.md new file mode 100644 index 0000000..beb3236 --- /dev/null +++ b/docs/VerificationWebhook.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.VerificationWebhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | User's account ID. | [optional] +**PhoneNumber** | **string** | Toll-free telephone number in E.164 format. | [optional] +**Status** | **TfvCallbackStatusEnum** | | [optional] +**InternalTicketNumber** | **Guid** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/WebhookSubscription.md b/docs/WebhookSubscription.md new file mode 100644 index 0000000..90eb785 --- /dev/null +++ b/docs/WebhookSubscription.md @@ -0,0 +1,17 @@ +# Bandwidth.Standard.Model.WebhookSubscription +Information about a webhook that Bandwidth should send upon the completion of event customer has subscribed to. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] +**AccountId** | **string** | | [optional] +**CallbackUrl** | **string** | Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. | +**Type** | **WebhookSubscriptionTypeEnum** | | [optional] +**BasicAuthentication** | [**WebhookSubscriptionBasicAuthentication**](WebhookSubscriptionBasicAuthentication.md) | | [optional] +**CreatedDate** | **DateTime** | | [optional] +**ModifiedDate** | **DateTime** | | [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/WebhookSubscriptionBasicAuthentication.md b/docs/WebhookSubscriptionBasicAuthentication.md new file mode 100644 index 0000000..fb4c7a7 --- /dev/null +++ b/docs/WebhookSubscriptionBasicAuthentication.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.WebhookSubscriptionBasicAuthentication +Basic authentication credentials are not required, but if present, both username and password must be provided. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | | +**Password** | **string** | | + +[[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/WebhookSubscriptionRequestSchema.md b/docs/WebhookSubscriptionRequestSchema.md new file mode 100644 index 0000000..b687329 --- /dev/null +++ b/docs/WebhookSubscriptionRequestSchema.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.WebhookSubscriptionRequestSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BasicAuthentication** | [**TfvBasicAuthentication**](TfvBasicAuthentication.md) | | [optional] +**CallbackUrl** | **string** | Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. | +**SharedSecretKey** | **string** | An ASCII string submitted by the user as a shared secret key for generating an HMAC header for callbacks. | [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/WebhookSubscriptionTypeEnum.md b/docs/WebhookSubscriptionTypeEnum.md new file mode 100644 index 0000000..8f0dc35 --- /dev/null +++ b/docs/WebhookSubscriptionTypeEnum.md @@ -0,0 +1,9 @@ +# Bandwidth.Standard.Model.WebhookSubscriptionTypeEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/WebhookSubscriptionsListBody.md b/docs/WebhookSubscriptionsListBody.md new file mode 100644 index 0000000..a778a05 --- /dev/null +++ b/docs/WebhookSubscriptionsListBody.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.WebhookSubscriptionsListBody +A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | [**LinksObject**](LinksObject.md) | | [optional] +**Errors** | [**List<Error>**](Error.md) | | [optional] +**Data** | [**List<WebhookSubscription>**](WebhookSubscription.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/src/Bandwidth.Standard/Api/TollFreeVerificationApi.cs b/src/Bandwidth.Standard/Api/TollFreeVerificationApi.cs new file mode 100644 index 0000000..2344378 --- /dev/null +++ b/src/Bandwidth.Standard/Api/TollFreeVerificationApi.cs @@ -0,0 +1,1948 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Model; + +namespace Bandwidth.Standard.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITollFreeVerificationApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create Webhook Subscription + /// + /// + /// Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// WebhookSubscription + WebhookSubscription CreateWebhookSubscription(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0); + + /// + /// Create Webhook Subscription + /// + /// + /// Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscription + ApiResponse CreateWebhookSubscriptionWithHttpInfo(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0); + /// + /// Delete Webhook Subscription + /// + /// + /// Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// + void DeleteWebhookSubscription(string accountId, string id, int operationIndex = 0); + + /// + /// Delete Webhook Subscription + /// + /// + /// Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteWebhookSubscriptionWithHttpInfo(string accountId, string id, int operationIndex = 0); + /// + /// Get Toll-Free Verification Status + /// + /// + /// Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// TfvStatus + TfvStatus GetTollFreeVerificationStatus(string accountId, string phoneNumber, int operationIndex = 0); + + /// + /// Get Toll-Free Verification Status + /// + /// + /// Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// ApiResponse of TfvStatus + ApiResponse GetTollFreeVerificationStatusWithHttpInfo(string accountId, string phoneNumber, int operationIndex = 0); + /// + /// List Toll-Free Use Cases + /// + /// + /// Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + List ListTollFreeUseCases(int operationIndex = 0); + + /// + /// List Toll-Free Use Cases + /// + /// + /// Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + ApiResponse> ListTollFreeUseCasesWithHttpInfo(int operationIndex = 0); + /// + /// List Webhook Subscriptions + /// + /// + /// Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// WebhookSubscriptionsListBody + WebhookSubscriptionsListBody ListWebhookSubscriptions(string accountId, int operationIndex = 0); + + /// + /// List Webhook Subscriptions + /// + /// + /// Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscriptionsListBody + ApiResponse ListWebhookSubscriptionsWithHttpInfo(string accountId, int operationIndex = 0); + /// + /// Request Toll-Free Verification + /// + /// + /// Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// + void RequestTollFreeVerification(string accountId, VerificationRequest verificationRequest, int operationIndex = 0); + + /// + /// Request Toll-Free Verification + /// + /// + /// Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse RequestTollFreeVerificationWithHttpInfo(string accountId, VerificationRequest verificationRequest, int operationIndex = 0); + /// + /// Update Toll-Free Verification Request + /// + /// + /// Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// + void UpdateTollFreeVerificationRequest(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0); + + /// + /// Update Toll-Free Verification Request + /// + /// + /// Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateTollFreeVerificationRequestWithHttpInfo(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0); + /// + /// Update Webhook Subscription + /// + /// + /// Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// WebhookSubscription + WebhookSubscription UpdateWebhookSubscription(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0); + + /// + /// Update Webhook Subscription + /// + /// + /// Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscription + ApiResponse UpdateWebhookSubscriptionWithHttpInfo(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITollFreeVerificationApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create Webhook Subscription + /// + /// + /// Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscription + System.Threading.Tasks.Task CreateWebhookSubscriptionAsync(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create Webhook Subscription + /// + /// + /// Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscription) + System.Threading.Tasks.Task> CreateWebhookSubscriptionWithHttpInfoAsync(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete Webhook Subscription + /// + /// + /// Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteWebhookSubscriptionAsync(string accountId, string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete Webhook Subscription + /// + /// + /// Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteWebhookSubscriptionWithHttpInfoAsync(string accountId, string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Toll-Free Verification Status + /// + /// + /// Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TfvStatus + System.Threading.Tasks.Task GetTollFreeVerificationStatusAsync(string accountId, string phoneNumber, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Toll-Free Verification Status + /// + /// + /// Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TfvStatus) + System.Threading.Tasks.Task> GetTollFreeVerificationStatusWithHttpInfoAsync(string accountId, string phoneNumber, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List Toll-Free Use Cases + /// + /// + /// Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> ListTollFreeUseCasesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List Toll-Free Use Cases + /// + /// + /// Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> ListTollFreeUseCasesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List Webhook Subscriptions + /// + /// + /// Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscriptionsListBody + System.Threading.Tasks.Task ListWebhookSubscriptionsAsync(string accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List Webhook Subscriptions + /// + /// + /// Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscriptionsListBody) + System.Threading.Tasks.Task> ListWebhookSubscriptionsWithHttpInfoAsync(string accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Request Toll-Free Verification + /// + /// + /// Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task RequestTollFreeVerificationAsync(string accountId, VerificationRequest verificationRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Request Toll-Free Verification + /// + /// + /// Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> RequestTollFreeVerificationWithHttpInfoAsync(string accountId, VerificationRequest verificationRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update Toll-Free Verification Request + /// + /// + /// Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateTollFreeVerificationRequestAsync(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update Toll-Free Verification Request + /// + /// + /// Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateTollFreeVerificationRequestWithHttpInfoAsync(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update Webhook Subscription + /// + /// + /// Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscription + System.Threading.Tasks.Task UpdateWebhookSubscriptionAsync(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update Webhook Subscription + /// + /// + /// Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscription) + System.Threading.Tasks.Task> UpdateWebhookSubscriptionWithHttpInfoAsync(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ITollFreeVerificationApi : ITollFreeVerificationApiSync, ITollFreeVerificationApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class TollFreeVerificationApi : ITollFreeVerificationApi + { + private Bandwidth.Standard.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public TollFreeVerificationApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public TollFreeVerificationApi(string basePath) + { + this.Configuration = Bandwidth.Standard.Client.Configuration.MergeConfigurations( + Bandwidth.Standard.Client.GlobalConfiguration.Instance, + new Bandwidth.Standard.Client.Configuration { BasePath = basePath } + ); + this.Client = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public TollFreeVerificationApi(Bandwidth.Standard.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Bandwidth.Standard.Client.Configuration.MergeConfigurations( + Bandwidth.Standard.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Bandwidth.Standard.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public TollFreeVerificationApi(Bandwidth.Standard.Client.ISynchronousClient client, Bandwidth.Standard.Client.IAsynchronousClient asyncClient, Bandwidth.Standard.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Bandwidth.Standard.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Bandwidth.Standard.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Bandwidth.Standard.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Bandwidth.Standard.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Bandwidth.Standard.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Create Webhook Subscription Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// WebhookSubscription + public WebhookSubscription CreateWebhookSubscription(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = CreateWebhookSubscriptionWithHttpInfo(accountId, webhookSubscriptionRequestSchema); + return localVarResponse.Data; + } + + /// + /// Create Webhook Subscription Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscription + public Bandwidth.Standard.Client.ApiResponse CreateWebhookSubscriptionWithHttpInfo(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->CreateWebhookSubscription"); + } + + // verify the required parameter 'webhookSubscriptionRequestSchema' is set + if (webhookSubscriptionRequestSchema == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'webhookSubscriptionRequestSchema' when calling TollFreeVerificationApi->CreateWebhookSubscription"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = webhookSubscriptionRequestSchema; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.CreateWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create Webhook Subscription Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscription + public async System.Threading.Tasks.Task CreateWebhookSubscriptionAsync(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await CreateWebhookSubscriptionWithHttpInfoAsync(accountId, webhookSubscriptionRequestSchema, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create Webhook Subscription Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscription) + public async System.Threading.Tasks.Task> CreateWebhookSubscriptionWithHttpInfoAsync(string accountId, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->CreateWebhookSubscription"); + } + + // verify the required parameter 'webhookSubscriptionRequestSchema' is set + if (webhookSubscriptionRequestSchema == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'webhookSubscriptionRequestSchema' when calling TollFreeVerificationApi->CreateWebhookSubscription"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = webhookSubscriptionRequestSchema; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.CreateWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Webhook Subscription Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// + public void DeleteWebhookSubscription(string accountId, string id, int operationIndex = 0) + { + DeleteWebhookSubscriptionWithHttpInfo(accountId, id); + } + + /// + /// Delete Webhook Subscription Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Bandwidth.Standard.Client.ApiResponse DeleteWebhookSubscriptionWithHttpInfo(string accountId, string id, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->DeleteWebhookSubscription"); + } + + // verify the required parameter 'id' is set + if (id == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'id' when calling TollFreeVerificationApi->DeleteWebhookSubscription"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("id", Bandwidth.Standard.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.DeleteWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Webhook Subscription Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteWebhookSubscriptionAsync(string accountId, string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await DeleteWebhookSubscriptionWithHttpInfoAsync(accountId, id, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Webhook Subscription Delete a webhook subscription by ID. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteWebhookSubscriptionWithHttpInfoAsync(string accountId, string id, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->DeleteWebhookSubscription"); + } + + // verify the required parameter 'id' is set + if (id == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'id' when calling TollFreeVerificationApi->DeleteWebhookSubscription"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("id", Bandwidth.Standard.Client.ClientUtils.ParameterToString(id)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.DeleteWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Toll-Free Verification Status Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// TfvStatus + public TfvStatus GetTollFreeVerificationStatus(string accountId, string phoneNumber, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = GetTollFreeVerificationStatusWithHttpInfo(accountId, phoneNumber); + return localVarResponse.Data; + } + + /// + /// Get Toll-Free Verification Status Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// ApiResponse of TfvStatus + public Bandwidth.Standard.Client.ApiResponse GetTollFreeVerificationStatusWithHttpInfo(string accountId, string phoneNumber, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->GetTollFreeVerificationStatus"); + } + + // verify the required parameter 'phoneNumber' is set + if (phoneNumber == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'phoneNumber' when calling TollFreeVerificationApi->GetTollFreeVerificationStatus"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("phoneNumber", Bandwidth.Standard.Client.ClientUtils.ParameterToString(phoneNumber)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.GetTollFreeVerificationStatus"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetTollFreeVerificationStatus", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Toll-Free Verification Status Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TfvStatus + public async System.Threading.Tasks.Task GetTollFreeVerificationStatusAsync(string accountId, string phoneNumber, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await GetTollFreeVerificationStatusWithHttpInfoAsync(accountId, phoneNumber, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Toll-Free Verification Status Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TfvStatus) + public async System.Threading.Tasks.Task> GetTollFreeVerificationStatusWithHttpInfoAsync(string accountId, string phoneNumber, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->GetTollFreeVerificationStatus"); + } + + // verify the required parameter 'phoneNumber' is set + if (phoneNumber == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'phoneNumber' when calling TollFreeVerificationApi->GetTollFreeVerificationStatus"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("phoneNumber", Bandwidth.Standard.Client.ClientUtils.ParameterToString(phoneNumber)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.GetTollFreeVerificationStatus"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetTollFreeVerificationStatus", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Toll-Free Use Cases Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<string> + public List ListTollFreeUseCases(int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse> localVarResponse = ListTollFreeUseCasesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// List Toll-Free Use Cases Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<string> + public Bandwidth.Standard.Client.ApiResponse> ListTollFreeUseCasesWithHttpInfo(int operationIndex = 0) + { + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TollFreeVerificationApi.ListTollFreeUseCases"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/tollFreeVerification/useCases", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListTollFreeUseCases", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Toll-Free Use Cases Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> ListTollFreeUseCasesAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse> localVarResponse = await ListTollFreeUseCasesWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Toll-Free Use Cases Lists valid toll-free use cases. + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> ListTollFreeUseCasesWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "TollFreeVerificationApi.ListTollFreeUseCases"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/tollFreeVerification/useCases", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListTollFreeUseCases", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Webhook Subscriptions Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// WebhookSubscriptionsListBody + public WebhookSubscriptionsListBody ListWebhookSubscriptions(string accountId, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = ListWebhookSubscriptionsWithHttpInfo(accountId); + return localVarResponse.Data; + } + + /// + /// List Webhook Subscriptions Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscriptionsListBody + public Bandwidth.Standard.Client.ApiResponse ListWebhookSubscriptionsWithHttpInfo(string accountId, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->ListWebhookSubscriptions"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.ListWebhookSubscriptions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListWebhookSubscriptions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Webhook Subscriptions Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscriptionsListBody + public async System.Threading.Tasks.Task ListWebhookSubscriptionsAsync(string accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await ListWebhookSubscriptionsWithHttpInfoAsync(accountId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Webhook Subscriptions Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscriptionsListBody) + public async System.Threading.Tasks.Task> ListWebhookSubscriptionsWithHttpInfoAsync(string accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->ListWebhookSubscriptions"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + + localVarRequestOptions.Operation = "TollFreeVerificationApi.ListWebhookSubscriptions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListWebhookSubscriptions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Request Toll-Free Verification Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// + public void RequestTollFreeVerification(string accountId, VerificationRequest verificationRequest, int operationIndex = 0) + { + RequestTollFreeVerificationWithHttpInfo(accountId, verificationRequest); + } + + /// + /// Request Toll-Free Verification Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Bandwidth.Standard.Client.ApiResponse RequestTollFreeVerificationWithHttpInfo(string accountId, VerificationRequest verificationRequest, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->RequestTollFreeVerification"); + } + + // verify the required parameter 'verificationRequest' is set + if (verificationRequest == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'verificationRequest' when calling TollFreeVerificationApi->RequestTollFreeVerification"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = verificationRequest; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.RequestTollFreeVerification"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/accounts/{accountId}/tollFreeVerification", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestTollFreeVerification", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Request Toll-Free Verification Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task RequestTollFreeVerificationAsync(string accountId, VerificationRequest verificationRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await RequestTollFreeVerificationWithHttpInfoAsync(accountId, verificationRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Request Toll-Free Verification Submit a request for verification of a toll-free phone number. + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> RequestTollFreeVerificationWithHttpInfoAsync(string accountId, VerificationRequest verificationRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->RequestTollFreeVerification"); + } + + // verify the required parameter 'verificationRequest' is set + if (verificationRequest == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'verificationRequest' when calling TollFreeVerificationApi->RequestTollFreeVerification"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.Data = verificationRequest; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.RequestTollFreeVerification"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/accounts/{accountId}/tollFreeVerification", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RequestTollFreeVerification", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Toll-Free Verification Request Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// + public void UpdateTollFreeVerificationRequest(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0) + { + UpdateTollFreeVerificationRequestWithHttpInfo(accountId, phoneNumber, tfvSubmissionWrapper); + } + + /// + /// Update Toll-Free Verification Request Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Bandwidth.Standard.Client.ApiResponse UpdateTollFreeVerificationRequestWithHttpInfo(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + // verify the required parameter 'phoneNumber' is set + if (phoneNumber == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'phoneNumber' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + // verify the required parameter 'tfvSubmissionWrapper' is set + if (tfvSubmissionWrapper == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'tfvSubmissionWrapper' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("phoneNumber", Bandwidth.Standard.Client.ClientUtils.ParameterToString(phoneNumber)); // path parameter + localVarRequestOptions.Data = tfvSubmissionWrapper; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.UpdateTollFreeVerificationRequest"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateTollFreeVerificationRequest", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Toll-Free Verification Request Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateTollFreeVerificationRequestAsync(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await UpdateTollFreeVerificationRequestWithHttpInfoAsync(accountId, phoneNumber, tfvSubmissionWrapper, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update Toll-Free Verification Request Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Valid Toll-Free telephone number in E.164 format. + /// Update a request for verification of a toll-free phone number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateTollFreeVerificationRequestWithHttpInfoAsync(string accountId, string phoneNumber, TfvSubmissionWrapper tfvSubmissionWrapper, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + // verify the required parameter 'phoneNumber' is set + if (phoneNumber == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'phoneNumber' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + // verify the required parameter 'tfvSubmissionWrapper' is set + if (tfvSubmissionWrapper == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'tfvSubmissionWrapper' when calling TollFreeVerificationApi->UpdateTollFreeVerificationRequest"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("phoneNumber", Bandwidth.Standard.Client.ClientUtils.ParameterToString(phoneNumber)); // path parameter + localVarRequestOptions.Data = tfvSubmissionWrapper; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.UpdateTollFreeVerificationRequest"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateTollFreeVerificationRequest", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Webhook Subscription Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// WebhookSubscription + public WebhookSubscription UpdateWebhookSubscription(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = UpdateWebhookSubscriptionWithHttpInfo(accountId, id, webhookSubscriptionRequestSchema); + return localVarResponse.Data; + } + + /// + /// Update Webhook Subscription Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// ApiResponse of WebhookSubscription + public Bandwidth.Standard.Client.ApiResponse UpdateWebhookSubscriptionWithHttpInfo(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + // verify the required parameter 'id' is set + if (id == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'id' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + // verify the required parameter 'webhookSubscriptionRequestSchema' is set + if (webhookSubscriptionRequestSchema == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'webhookSubscriptionRequestSchema' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("id", Bandwidth.Standard.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = webhookSubscriptionRequestSchema; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.UpdateWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update Webhook Subscription Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of WebhookSubscription + public async System.Threading.Tasks.Task UpdateWebhookSubscriptionAsync(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Bandwidth.Standard.Client.ApiResponse localVarResponse = await UpdateWebhookSubscriptionWithHttpInfoAsync(accountId, id, webhookSubscriptionRequestSchema, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update Webhook Subscription Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). + /// + /// Thrown when fails to make API call + /// Your Bandwidth Account ID. + /// Webhook subscription ID + /// Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebhookSubscription) + public async System.Threading.Tasks.Task> UpdateWebhookSubscriptionWithHttpInfoAsync(string accountId, string id, WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'accountId' is set + if (accountId == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'accountId' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + // verify the required parameter 'id' is set + if (id == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'id' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + // verify the required parameter 'webhookSubscriptionRequestSchema' is set + if (webhookSubscriptionRequestSchema == null) + { + throw new Bandwidth.Standard.Client.ApiException(400, "Missing required parameter 'webhookSubscriptionRequestSchema' when calling TollFreeVerificationApi->UpdateWebhookSubscription"); + } + + + Bandwidth.Standard.Client.RequestOptions localVarRequestOptions = new Bandwidth.Standard.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Bandwidth.Standard.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Bandwidth.Standard.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("accountId", Bandwidth.Standard.Client.ClientUtils.ParameterToString(accountId)); // path parameter + localVarRequestOptions.PathParameters.Add("id", Bandwidth.Standard.Client.ClientUtils.ParameterToString(id)); // path parameter + localVarRequestOptions.Data = webhookSubscriptionRequestSchema; + + localVarRequestOptions.Operation = "TollFreeVerificationApi.UpdateWebhookSubscription"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Basic) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Bandwidth.Standard.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateWebhookSubscription", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/Bandwidth.Standard/Client/Configuration.cs b/src/Bandwidth.Standard/Client/Configuration.cs index 05daddb..8395e3d 100644 --- a/src/Bandwidth.Standard/Client/Configuration.cs +++ b/src/Bandwidth.Standard/Client/Configuration.cs @@ -34,7 +34,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.0.0"; + public const string Version = "1.0.0-dev"; /// /// Identifier for ISO 8601 DateTime Format @@ -113,7 +113,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0-dev/csharp"); BasePath = "http://localhost"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -561,6 +561,102 @@ public Configuration() }, } }, + { + "TollFreeVerificationApi.CreateWebhookSubscription", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.DeleteWebhookSubscription", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.GetTollFreeVerificationStatus", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.ListTollFreeUseCases", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.ListWebhookSubscriptions", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.RequestTollFreeVerification", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.UpdateTollFreeVerificationRequest", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, + { + "TollFreeVerificationApi.UpdateWebhookSubscription", new List> + { + { + new Dictionary + { + {"url", "https://api.bandwidth.com/api/v2"}, + {"description", "Production"} + } + }, + } + }, { "TranscriptionsApi.DeleteRealTimeTranscription", new List> { @@ -1004,7 +1100,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; + report += " SDK Package Version: 1.0.0-dev\n"; return report; } diff --git a/src/Bandwidth.Standard/Model/AdditionalDenialReason.cs b/src/Bandwidth.Standard/Model/AdditionalDenialReason.cs new file mode 100644 index 0000000..b96019c --- /dev/null +++ b/src/Bandwidth.Standard/Model/AdditionalDenialReason.cs @@ -0,0 +1,117 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// AdditionalDenialReason + /// + [DataContract(Name = "additionalDenialReason")] + public partial class AdditionalDenialReason : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AdditionalDenialReason() { } + /// + /// Initializes a new instance of the class. + /// + /// Reason code for denial. (required). + /// Explanation for why a verification request was declined. (required). + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. (required). + public AdditionalDenialReason(int statusCode = default(int), string reason = default(string), bool resubmitAllowed = default(bool)) + { + this.StatusCode = statusCode; + // to ensure "reason" is required (not null) + if (reason == null) + { + throw new ArgumentNullException("reason is a required property for AdditionalDenialReason and cannot be null"); + } + this.Reason = reason; + this.ResubmitAllowed = resubmitAllowed; + } + + /// + /// Reason code for denial. + /// + /// Reason code for denial. + /// 511 + [DataMember(Name = "statusCode", IsRequired = true, EmitDefaultValue = true)] + public int StatusCode { get; set; } + + /// + /// Explanation for why a verification request was declined. + /// + /// Explanation for why a verification request was declined. + /// Invalid Information - Can't Validate URL - Website is not accessible / not available + [DataMember(Name = "reason", IsRequired = true, EmitDefaultValue = true)] + public string Reason { get; set; } + + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// true + [DataMember(Name = "resubmitAllowed", IsRequired = true, EmitDefaultValue = true)] + public bool ResubmitAllowed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AdditionalDenialReason {\n"); + sb.Append(" StatusCode: ").Append(StatusCode).Append("\n"); + sb.Append(" Reason: ").Append(Reason).Append("\n"); + sb.Append(" ResubmitAllowed: ").Append(ResubmitAllowed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/Address.cs b/src/Bandwidth.Standard/Model/Address.cs new file mode 100644 index 0000000..3983926 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Address.cs @@ -0,0 +1,266 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Address + /// + [DataContract(Name = "address")] + public partial class Address : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Address() { } + /// + /// Initializes a new instance of the class. + /// + /// The name of the business using the toll-free number. (required). + /// The address of the business using the toll-free number. (required). + /// The address of the business using the toll-free number.. + /// The city of the business using the toll-free number. (required). + /// The state of the business using the toll-free number. (required). + /// The zip of the business using the toll-free number. (required). + /// The website of the business using the toll-free number. (required). + public Address(string name = default(string), string addr1 = default(string), string addr2 = default(string), string city = default(string), string state = default(string), string zip = default(string), string url = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Address and cannot be null"); + } + this.Name = name; + // to ensure "addr1" is required (not null) + if (addr1 == null) + { + throw new ArgumentNullException("addr1 is a required property for Address and cannot be null"); + } + this.Addr1 = addr1; + // to ensure "city" is required (not null) + if (city == null) + { + throw new ArgumentNullException("city is a required property for Address and cannot be null"); + } + this.City = city; + // to ensure "state" is required (not null) + if (state == null) + { + throw new ArgumentNullException("state is a required property for Address and cannot be null"); + } + this.State = state; + // to ensure "zip" is required (not null) + if (zip == null) + { + throw new ArgumentNullException("zip is a required property for Address and cannot be null"); + } + this.Zip = zip; + // to ensure "url" is required (not null) + if (url == null) + { + throw new ArgumentNullException("url is a required property for Address and cannot be null"); + } + this.Url = url; + this.Addr2 = addr2; + } + + /// + /// The name of the business using the toll-free number. + /// + /// The name of the business using the toll-free number. + /// Bandwidth Inc. + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// The address of the business using the toll-free number. + /// + /// The address of the business using the toll-free number. + /// 2230 Bandmate Way + [DataMember(Name = "addr1", IsRequired = true, EmitDefaultValue = true)] + public string Addr1 { get; set; } + + /// + /// The address of the business using the toll-free number. + /// + /// The address of the business using the toll-free number. + [DataMember(Name = "addr2", EmitDefaultValue = true)] + public string Addr2 { get; set; } + + /// + /// The city of the business using the toll-free number. + /// + /// The city of the business using the toll-free number. + /// Raleigh + [DataMember(Name = "city", IsRequired = true, EmitDefaultValue = true)] + public string City { get; set; } + + /// + /// The state of the business using the toll-free number. + /// + /// The state of the business using the toll-free number. + /// NC + [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] + public string State { get; set; } + + /// + /// The zip of the business using the toll-free number. + /// + /// The zip of the business using the toll-free number. + /// 27606 + [DataMember(Name = "zip", IsRequired = true, EmitDefaultValue = true)] + public string Zip { get; set; } + + /// + /// The website of the business using the toll-free number. + /// + /// The website of the business using the toll-free number. + /// https://www.example.com/path/to/resource + [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] + public string Url { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Address {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Addr1: ").Append(Addr1).Append("\n"); + sb.Append(" Addr2: ").Append(Addr2).Append("\n"); + sb.Append(" City: ").Append(City).Append("\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" Zip: ").Append(Zip).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Name (string) maxLength + if (this.Name != null && this.Name.Length > 500) + { + yield return new ValidationResult("Invalid value for Name, length must be less than 500.", new [] { "Name" }); + } + + // Name (string) minLength + if (this.Name != null && this.Name.Length < 1) + { + yield return new ValidationResult("Invalid value for Name, length must be greater than 1.", new [] { "Name" }); + } + + // Addr1 (string) maxLength + if (this.Addr1 != null && this.Addr1.Length > 500) + { + yield return new ValidationResult("Invalid value for Addr1, length must be less than 500.", new [] { "Addr1" }); + } + + // Addr1 (string) minLength + if (this.Addr1 != null && this.Addr1.Length < 1) + { + yield return new ValidationResult("Invalid value for Addr1, length must be greater than 1.", new [] { "Addr1" }); + } + + // Addr2 (string) maxLength + if (this.Addr2 != null && this.Addr2.Length > 500) + { + yield return new ValidationResult("Invalid value for Addr2, length must be less than 500.", new [] { "Addr2" }); + } + + // Addr2 (string) minLength + if (this.Addr2 != null && this.Addr2.Length < 0) + { + yield return new ValidationResult("Invalid value for Addr2, length must be greater than 0.", new [] { "Addr2" }); + } + + // City (string) maxLength + if (this.City != null && this.City.Length > 500) + { + yield return new ValidationResult("Invalid value for City, length must be less than 500.", new [] { "City" }); + } + + // City (string) minLength + if (this.City != null && this.City.Length < 1) + { + yield return new ValidationResult("Invalid value for City, length must be greater than 1.", new [] { "City" }); + } + + // State (string) maxLength + if (this.State != null && this.State.Length > 500) + { + yield return new ValidationResult("Invalid value for State, length must be less than 500.", new [] { "State" }); + } + + // State (string) minLength + if (this.State != null && this.State.Length < 1) + { + yield return new ValidationResult("Invalid value for State, length must be greater than 1.", new [] { "State" }); + } + + if (this.Zip != null) { + // Zip (string) pattern + Regex regexZip = new Regex(@"[- A-Za-z0-9]{0,500}", RegexOptions.CultureInvariant); + if (!regexZip.Match(this.Zip).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Zip, must match a pattern of " + regexZip, new [] { "Zip" }); + } + } + + // Url (string) maxLength + if (this.Url != null && this.Url.Length > 500) + { + yield return new ValidationResult("Invalid value for Url, length must be less than 500.", new [] { "Url" }); + } + + // Url (string) minLength + if (this.Url != null && this.Url.Length < 1) + { + yield return new ValidationResult("Invalid value for Url, length must be greater than 1.", new [] { "Url" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/Contact.cs b/src/Bandwidth.Standard/Model/Contact.cs new file mode 100644 index 0000000..b519ece --- /dev/null +++ b/src/Bandwidth.Standard/Model/Contact.cs @@ -0,0 +1,199 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Contact + /// + [DataContract(Name = "contact")] + public partial class Contact : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Contact() { } + /// + /// Initializes a new instance of the class. + /// + /// The first name of the business contact using the toll-free number. (required). + /// The last name of the business contact using the toll-free number. (required). + /// email (required). + /// Contact telephone number (required). + public Contact(string firstName = default(string), string lastName = default(string), string email = default(string), string phoneNumber = default(string)) + { + // to ensure "firstName" is required (not null) + if (firstName == null) + { + throw new ArgumentNullException("firstName is a required property for Contact and cannot be null"); + } + this.FirstName = firstName; + // to ensure "lastName" is required (not null) + if (lastName == null) + { + throw new ArgumentNullException("lastName is a required property for Contact and cannot be null"); + } + this.LastName = lastName; + // to ensure "email" is required (not null) + if (email == null) + { + throw new ArgumentNullException("email is a required property for Contact and cannot be null"); + } + this.Email = email; + // to ensure "phoneNumber" is required (not null) + if (phoneNumber == null) + { + throw new ArgumentNullException("phoneNumber is a required property for Contact and cannot be null"); + } + this.PhoneNumber = phoneNumber; + } + + /// + /// The first name of the business contact using the toll-free number. + /// + /// The first name of the business contact using the toll-free number. + /// John + [DataMember(Name = "firstName", IsRequired = true, EmitDefaultValue = true)] + public string FirstName { get; set; } + + /// + /// The last name of the business contact using the toll-free number. + /// + /// The last name of the business contact using the toll-free number. + /// Doe + [DataMember(Name = "lastName", IsRequired = true, EmitDefaultValue = true)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + /// foo@bar.com + [DataMember(Name = "email", IsRequired = true, EmitDefaultValue = true)] + public string Email { get; set; } + + /// + /// Contact telephone number + /// + /// Contact telephone number + /// +19192654500 + [DataMember(Name = "phoneNumber", IsRequired = true, EmitDefaultValue = true)] + public string PhoneNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Contact {\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // FirstName (string) maxLength + if (this.FirstName != null && this.FirstName.Length > 500) + { + yield return new ValidationResult("Invalid value for FirstName, length must be less than 500.", new [] { "FirstName" }); + } + + // FirstName (string) minLength + if (this.FirstName != null && this.FirstName.Length < 1) + { + yield return new ValidationResult("Invalid value for FirstName, length must be greater than 1.", new [] { "FirstName" }); + } + + // LastName (string) maxLength + if (this.LastName != null && this.LastName.Length > 500) + { + yield return new ValidationResult("Invalid value for LastName, length must be less than 500.", new [] { "LastName" }); + } + + // LastName (string) minLength + if (this.LastName != null && this.LastName.Length < 1) + { + yield return new ValidationResult("Invalid value for LastName, length must be greater than 1.", new [] { "LastName" }); + } + + // Email (string) maxLength + if (this.Email != null && this.Email.Length > 500) + { + yield return new ValidationResult("Invalid value for Email, length must be less than 500.", new [] { "Email" }); + } + + // Email (string) minLength + if (this.Email != null && this.Email.Length < 0) + { + yield return new ValidationResult("Invalid value for Email, length must be greater than 0.", new [] { "Email" }); + } + + if (this.Email != null) { + // Email (string) pattern + Regex regexEmail = new Regex(@"^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|""(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*"")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$", RegexOptions.CultureInvariant); + if (!regexEmail.Match(this.Email).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Email, must match a pattern of " + regexEmail, new [] { "Email" }); + } + } + + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 500) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 500.", new [] { "PhoneNumber" }); + } + + // PhoneNumber (string) minLength + if (this.PhoneNumber != null && this.PhoneNumber.Length < 1) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be greater than 1.", new [] { "PhoneNumber" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/Error.cs b/src/Bandwidth.Standard/Model/Error.cs new file mode 100644 index 0000000..5a78134 --- /dev/null +++ b/src/Bandwidth.Standard/Model/Error.cs @@ -0,0 +1,101 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Error + /// + [DataContract(Name = "error")] + public partial class Error : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// description. + /// telephoneNumbers. + public Error(int code = default(int), string description = default(string), List telephoneNumbers = default(List)) + { + this.Code = code; + this.Description = description; + this.TelephoneNumbers = telephoneNumbers; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets TelephoneNumbers + /// + [DataMember(Name = "telephoneNumbers", EmitDefaultValue = false)] + public List TelephoneNumbers { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Error {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" TelephoneNumbers: ").Append(TelephoneNumbers).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/FailureWebhook.cs b/src/Bandwidth.Standard/Model/FailureWebhook.cs new file mode 100644 index 0000000..728c0e6 --- /dev/null +++ b/src/Bandwidth.Standard/Model/FailureWebhook.cs @@ -0,0 +1,160 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// FailureWebhook + /// + [DataContract(Name = "failureWebhook")] + public partial class FailureWebhook : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// User's account ID.. + /// Toll-free telephone number in E.164 format.. + /// An error code indicating what error was encountered. This code can be interpreted as an HTTP status code in regards to the error that was encountered.. + /// A description of the error that was encountered.. + /// Details of the errors that were encountered when processing the request.. + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number.. + public FailureWebhook(string accountId = default(string), string phoneNumber = default(string), string errorCode = default(string), string errorDescription = default(string), List errors = default(List), Guid internalTicketNumber = default(Guid)) + { + this.AccountId = accountId; + this.PhoneNumber = phoneNumber; + this.ErrorCode = errorCode; + this.ErrorDescription = errorDescription; + this.Errors = errors; + this.InternalTicketNumber = internalTicketNumber; + } + + /// + /// User's account ID. + /// + /// User's account ID. + /// 1234567 + [DataMember(Name = "accountId", EmitDefaultValue = false)] + public string AccountId { get; set; } + + /// + /// Toll-free telephone number in E.164 format. + /// + /// Toll-free telephone number in E.164 format. + /// +18005555555 + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } + + /// + /// An error code indicating what error was encountered. This code can be interpreted as an HTTP status code in regards to the error that was encountered. + /// + /// An error code indicating what error was encountered. This code can be interpreted as an HTTP status code in regards to the error that was encountered. + /// 400 + [DataMember(Name = "errorCode", EmitDefaultValue = false)] + public string ErrorCode { get; set; } + + /// + /// A description of the error that was encountered. + /// + /// A description of the error that was encountered. + /// cannot process request. + [DataMember(Name = "errorDescription", EmitDefaultValue = false)] + public string ErrorDescription { get; set; } + + /// + /// Details of the errors that were encountered when processing the request. + /// + /// Details of the errors that were encountered when processing the request. + [DataMember(Name = "errors", EmitDefaultValue = false)] + public List Errors { get; set; } + + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// acde070d-8c4c-4f0d-9d8a-162843c10333 + [DataMember(Name = "internalTicketNumber", EmitDefaultValue = false)] + public Guid InternalTicketNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FailureWebhook {\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n"); + sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); + sb.Append(" ErrorDescription: ").Append(ErrorDescription).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append(" InternalTicketNumber: ").Append(InternalTicketNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 12.", new [] { "PhoneNumber" }); + } + + // PhoneNumber (string) minLength + if (this.PhoneNumber != null && this.PhoneNumber.Length < 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be greater than 12.", new [] { "PhoneNumber" }); + } + + if (this.PhoneNumber != null) { + // PhoneNumber (string) pattern + Regex regexPhoneNumber = new Regex(@"^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$", RegexOptions.CultureInvariant); + if (!regexPhoneNumber.Match(this.PhoneNumber).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, must match a pattern of " + regexPhoneNumber, new [] { "PhoneNumber" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/LinksObject.cs b/src/Bandwidth.Standard/Model/LinksObject.cs new file mode 100644 index 0000000..d52a26a --- /dev/null +++ b/src/Bandwidth.Standard/Model/LinksObject.cs @@ -0,0 +1,114 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// LinksObject + /// + [DataContract(Name = "linksObject")] + public partial class LinksObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The first (or only) page of results matching the query.. + /// If more results exist than specified by 'size', this link returns the next page of 'size' results.. + /// If the results are more than one page, this link returns the previous page of 'size' results.. + /// If more results exist than specified by 'size', this link return the last page of result.. + public LinksObject(string first = default(string), string next = default(string), string previous = default(string), string last = default(string)) + { + this.First = first; + this.Next = next; + this.Previous = previous; + this.Last = last; + } + + /// + /// The first (or only) page of results matching the query. + /// + /// The first (or only) page of results matching the query. + [DataMember(Name = "first", EmitDefaultValue = false)] + public string First { get; set; } + + /// + /// If more results exist than specified by 'size', this link returns the next page of 'size' results. + /// + /// If more results exist than specified by 'size', this link returns the next page of 'size' results. + [DataMember(Name = "next", EmitDefaultValue = false)] + public string Next { get; set; } + + /// + /// If the results are more than one page, this link returns the previous page of 'size' results. + /// + /// If the results are more than one page, this link returns the previous page of 'size' results. + [DataMember(Name = "previous", EmitDefaultValue = false)] + public string Previous { get; set; } + + /// + /// If more results exist than specified by 'size', this link return the last page of result. + /// + /// If more results exist than specified by 'size', this link return the last page of result. + [DataMember(Name = "last", EmitDefaultValue = false)] + public string Last { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LinksObject {\n"); + sb.Append(" First: ").Append(First).Append("\n"); + sb.Append(" Next: ").Append(Next).Append("\n"); + sb.Append(" Previous: ").Append(Previous).Append("\n"); + sb.Append(" Last: ").Append(Last).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/OptInWorkflow.cs b/src/Bandwidth.Standard/Model/OptInWorkflow.cs new file mode 100644 index 0000000..0e81c57 --- /dev/null +++ b/src/Bandwidth.Standard/Model/OptInWorkflow.cs @@ -0,0 +1,120 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// OptInWorkflow + /// + [DataContract(Name = "optInWorkflow")] + public partial class OptInWorkflow : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected OptInWorkflow() { } + /// + /// Initializes a new instance of the class. + /// + /// description (required). + /// imageUrls (required). + public OptInWorkflow(string description = default(string), List imageUrls = default(List)) + { + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for OptInWorkflow and cannot be null"); + } + this.Description = description; + // to ensure "imageUrls" is required (not null) + if (imageUrls == null) + { + throw new ArgumentNullException("imageUrls is a required property for OptInWorkflow and cannot be null"); + } + this.ImageUrls = imageUrls; + } + + /// + /// Gets or Sets Description + /// + /// Opt In Flow + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets ImageUrls + /// + [DataMember(Name = "imageUrls", IsRequired = true, EmitDefaultValue = true)] + public List ImageUrls { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OptInWorkflow {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" ImageUrls: ").Append(ImageUrls).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Description (string) maxLength + if (this.Description != null && this.Description.Length > 500) + { + yield return new ValidationResult("Invalid value for Description, length must be less than 500.", new [] { "Description" }); + } + + // Description (string) minLength + if (this.Description != null && this.Description.Length < 1) + { + yield return new ValidationResult("Invalid value for Description, length must be greater than 1.", new [] { "Description" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TelephoneNumber.cs b/src/Bandwidth.Standard/Model/TelephoneNumber.cs new file mode 100644 index 0000000..5a4f242 --- /dev/null +++ b/src/Bandwidth.Standard/Model/TelephoneNumber.cs @@ -0,0 +1,84 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// TelephoneNumber + /// + [DataContract(Name = "telephoneNumber")] + public partial class TelephoneNumber : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Simple Telephone Number.. + public TelephoneNumber(string varTelephoneNumber = default(string)) + { + this.VarTelephoneNumber = varTelephoneNumber; + } + + /// + /// Simple Telephone Number. + /// + /// Simple Telephone Number. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string VarTelephoneNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TelephoneNumber {\n"); + sb.Append(" VarTelephoneNumber: ").Append(VarTelephoneNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvBasicAuthentication.cs b/src/Bandwidth.Standard/Model/TfvBasicAuthentication.cs new file mode 100644 index 0000000..2c53bd9 --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvBasicAuthentication.cs @@ -0,0 +1,119 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// TfvBasicAuthentication + /// + [DataContract(Name = "tfvBasicAuthentication")] + public partial class TfvBasicAuthentication : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TfvBasicAuthentication() { } + /// + /// Initializes a new instance of the class. + /// + /// username (required). + /// password (required). + public TfvBasicAuthentication(string username = default(string), string password = default(string)) + { + // to ensure "username" is required (not null) + if (username == null) + { + throw new ArgumentNullException("username is a required property for TfvBasicAuthentication and cannot be null"); + } + this.Username = username; + // to ensure "password" is required (not null) + if (password == null) + { + throw new ArgumentNullException("password is a required property for TfvBasicAuthentication and cannot be null"); + } + this.Password = password; + } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] + public string Username { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TfvBasicAuthentication {\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Username (string) maxLength + if (this.Username != null && this.Username.Length > 100) + { + yield return new ValidationResult("Invalid value for Username, length must be less than 100.", new [] { "Username" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 200) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 200.", new [] { "Password" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvCallbackStatusEnum.cs b/src/Bandwidth.Standard/Model/TfvCallbackStatusEnum.cs new file mode 100644 index 0000000..79dd709 --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvCallbackStatusEnum.cs @@ -0,0 +1,48 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines tfvCallbackStatusEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TfvCallbackStatusEnum + { + /// + /// Enum VERIFIED for value: VERIFIED + /// + [EnumMember(Value = "VERIFIED")] + VERIFIED = 1, + + /// + /// Enum UNVERIFIED for value: UNVERIFIED + /// + [EnumMember(Value = "UNVERIFIED")] + UNVERIFIED = 2 + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvError.cs b/src/Bandwidth.Standard/Model/TfvError.cs new file mode 100644 index 0000000..411726b --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvError.cs @@ -0,0 +1,105 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// A generic error object. + /// + [DataContract(Name = "tfvError")] + public partial class TfvError : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// type. + /// description. + /// Each key of this errors object refers to a field of the submitted object (using dot notation for nested objects), with the field being a key to an array of one or more errors for that field.. + public TfvError(string type = default(string), string description = default(string), Object errors = default(Object)) + { + this.Type = type; + this.Description = description; + this.Errors = errors; + } + + /// + /// Gets or Sets Type + /// + /// Error Type + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Description + /// + /// Error Message + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Each key of this errors object refers to a field of the submitted object (using dot notation for nested objects), with the field being a key to an array of one or more errors for that field. + /// + /// Each key of this errors object refers to a field of the submitted object (using dot notation for nested objects), with the field being a key to an array of one or more errors for that field. + /// {"field":"error message"} + [DataMember(Name = "errors", EmitDefaultValue = false)] + public Object Errors { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TfvError {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvStatus.cs b/src/Bandwidth.Standard/Model/TfvStatus.cs new file mode 100644 index 0000000..d26f634 --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvStatus.cs @@ -0,0 +1,179 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// TfvStatus + /// + [DataContract(Name = "tfvStatus")] + public partial class TfvStatus : IValidatableObject + { + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + public TfvStatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// Toll-free telephone number in E.164 format.. + /// status. + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads.. + /// Explanation for why a verification request was declined.. + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT.. + /// Date and time the verification request was created.. + /// Date and time the verification request was last modified.. + /// submission. + public TfvStatus(string phoneNumber = default(string), TfvStatusEnum? status = default(TfvStatusEnum?), Guid internalTicketNumber = default(Guid), string declineReasonDescription = default(string), bool resubmitAllowed = default(bool), DateTime createdDateTime = default(DateTime), DateTime modifiedDateTime = default(DateTime), TfvSubmissionInfo submission = default(TfvSubmissionInfo)) + { + this.PhoneNumber = phoneNumber; + this.Status = status; + this.InternalTicketNumber = internalTicketNumber; + this.DeclineReasonDescription = declineReasonDescription; + this.ResubmitAllowed = resubmitAllowed; + this.CreatedDateTime = createdDateTime; + this.ModifiedDateTime = modifiedDateTime; + this.Submission = submission; + } + + /// + /// Toll-free telephone number in E.164 format. + /// + /// Toll-free telephone number in E.164 format. + /// +18005555555 + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } + + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. + /// acde070d-8c4c-4f0d-9d8a-162843c10333 + [DataMember(Name = "internalTicketNumber", EmitDefaultValue = false)] + public Guid InternalTicketNumber { get; set; } + + /// + /// Explanation for why a verification request was declined. + /// + /// Explanation for why a verification request was declined. + /// Invalid Information - Can't Validate URL - Website is not accessible / not available + [DataMember(Name = "declineReasonDescription", EmitDefaultValue = false)] + public string DeclineReasonDescription { get; set; } + + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// true + [DataMember(Name = "resubmitAllowed", EmitDefaultValue = true)] + public bool ResubmitAllowed { get; set; } + + /// + /// Date and time the verification request was created. + /// + /// Date and time the verification request was created. + /// 2021-06-08T06:45:13Z + [DataMember(Name = "createdDateTime", EmitDefaultValue = false)] + public DateTime CreatedDateTime { get; set; } + + /// + /// Date and time the verification request was last modified. + /// + /// Date and time the verification request was last modified. + /// 2021-06-08T06:45:13Z + [DataMember(Name = "modifiedDateTime", EmitDefaultValue = false)] + public DateTime ModifiedDateTime { get; set; } + + /// + /// Gets or Sets Submission + /// + [DataMember(Name = "submission", EmitDefaultValue = false)] + public TfvSubmissionInfo Submission { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TfvStatus {\n"); + sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" InternalTicketNumber: ").Append(InternalTicketNumber).Append("\n"); + sb.Append(" DeclineReasonDescription: ").Append(DeclineReasonDescription).Append("\n"); + sb.Append(" ResubmitAllowed: ").Append(ResubmitAllowed).Append("\n"); + sb.Append(" CreatedDateTime: ").Append(CreatedDateTime).Append("\n"); + sb.Append(" ModifiedDateTime: ").Append(ModifiedDateTime).Append("\n"); + sb.Append(" Submission: ").Append(Submission).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 12.", new [] { "PhoneNumber" }); + } + + // PhoneNumber (string) minLength + if (this.PhoneNumber != null && this.PhoneNumber.Length < 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be greater than 12.", new [] { "PhoneNumber" }); + } + + if (this.PhoneNumber != null) { + // PhoneNumber (string) pattern + Regex regexPhoneNumber = new Regex(@"^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$", RegexOptions.CultureInvariant); + if (!regexPhoneNumber.Match(this.PhoneNumber).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, must match a pattern of " + regexPhoneNumber, new [] { "PhoneNumber" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvStatusEnum.cs b/src/Bandwidth.Standard/Model/TfvStatusEnum.cs new file mode 100644 index 0000000..f71910f --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvStatusEnum.cs @@ -0,0 +1,66 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines tfvStatusEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TfvStatusEnum + { + /// + /// Enum VERIFIED for value: VERIFIED + /// + [EnumMember(Value = "VERIFIED")] + VERIFIED = 1, + + /// + /// Enum UNVERIFIED for value: UNVERIFIED + /// + [EnumMember(Value = "UNVERIFIED")] + UNVERIFIED = 2, + + /// + /// Enum PENDING for value: PENDING + /// + [EnumMember(Value = "PENDING")] + PENDING = 3, + + /// + /// Enum PARTIALLYVERIFIED for value: PARTIALLY_VERIFIED + /// + [EnumMember(Value = "PARTIALLY_VERIFIED")] + PARTIALLYVERIFIED = 4, + + /// + /// Enum INVALIDSTATUS for value: INVALID_STATUS + /// + [EnumMember(Value = "INVALID_STATUS")] + INVALIDSTATUS = 5 + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvSubmissionInfo.cs b/src/Bandwidth.Standard/Model/TfvSubmissionInfo.cs new file mode 100644 index 0000000..bd1d76a --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvSubmissionInfo.cs @@ -0,0 +1,239 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// TfvSubmissionInfo + /// + [DataContract(Name = "tfvSubmissionInfo")] + public partial class TfvSubmissionInfo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// businessAddress. + /// businessContact. + /// Estimated monthly volume of messages from the toll-free number.. + /// The category of the use case.. + /// A general idea of the use case and customer.. + /// Example of message content.. + /// optInWorkflow. + /// Any additional information.. + /// ISV name.. + public TfvSubmissionInfo(Address businessAddress = default(Address), Contact businessContact = default(Contact), int messageVolume = default(int), string useCase = default(string), string useCaseSummary = default(string), string productionMessageContent = default(string), OptInWorkflow optInWorkflow = default(OptInWorkflow), string additionalInformation = default(string), string isvReseller = default(string)) + { + this.BusinessAddress = businessAddress; + this.BusinessContact = businessContact; + this.MessageVolume = messageVolume; + this.UseCase = useCase; + this.UseCaseSummary = useCaseSummary; + this.ProductionMessageContent = productionMessageContent; + this.OptInWorkflow = optInWorkflow; + this.AdditionalInformation = additionalInformation; + this.IsvReseller = isvReseller; + } + + /// + /// Gets or Sets BusinessAddress + /// + [DataMember(Name = "businessAddress", EmitDefaultValue = false)] + public Address BusinessAddress { get; set; } + + /// + /// Gets or Sets BusinessContact + /// + [DataMember(Name = "businessContact", EmitDefaultValue = false)] + public Contact BusinessContact { get; set; } + + /// + /// Estimated monthly volume of messages from the toll-free number. + /// + /// Estimated monthly volume of messages from the toll-free number. + /// 10000 + [DataMember(Name = "messageVolume", EmitDefaultValue = false)] + public int MessageVolume { get; set; } + + /// + /// The category of the use case. + /// + /// The category of the use case. + /// 2FA + [DataMember(Name = "useCase", EmitDefaultValue = false)] + public string UseCase { get; set; } + + /// + /// A general idea of the use case and customer. + /// + /// A general idea of the use case and customer. + /// Text summarizing the use case for the toll-free number + [DataMember(Name = "useCaseSummary", EmitDefaultValue = false)] + public string UseCaseSummary { get; set; } + + /// + /// Example of message content. + /// + /// Example of message content. + /// Production message content + [DataMember(Name = "productionMessageContent", EmitDefaultValue = false)] + public string ProductionMessageContent { get; set; } + + /// + /// Gets or Sets OptInWorkflow + /// + [DataMember(Name = "optInWorkflow", EmitDefaultValue = false)] + public OptInWorkflow OptInWorkflow { get; set; } + + /// + /// Any additional information. + /// + /// Any additional information. + /// Any additional information + [DataMember(Name = "additionalInformation", EmitDefaultValue = true)] + public string AdditionalInformation { get; set; } + + /// + /// ISV name. + /// + /// ISV name. + /// Test ISV + [DataMember(Name = "isvReseller", EmitDefaultValue = true)] + public string IsvReseller { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TfvSubmissionInfo {\n"); + sb.Append(" BusinessAddress: ").Append(BusinessAddress).Append("\n"); + sb.Append(" BusinessContact: ").Append(BusinessContact).Append("\n"); + sb.Append(" MessageVolume: ").Append(MessageVolume).Append("\n"); + sb.Append(" UseCase: ").Append(UseCase).Append("\n"); + sb.Append(" UseCaseSummary: ").Append(UseCaseSummary).Append("\n"); + sb.Append(" ProductionMessageContent: ").Append(ProductionMessageContent).Append("\n"); + sb.Append(" OptInWorkflow: ").Append(OptInWorkflow).Append("\n"); + sb.Append(" AdditionalInformation: ").Append(AdditionalInformation).Append("\n"); + sb.Append(" IsvReseller: ").Append(IsvReseller).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // MessageVolume (int) maximum + if (this.MessageVolume > (int)10000000) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value less than or equal to 10000000.", new [] { "MessageVolume" }); + } + + // MessageVolume (int) minimum + if (this.MessageVolume < (int)10) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value greater than or equal to 10.", new [] { "MessageVolume" }); + } + + // UseCase (string) maxLength + if (this.UseCase != null && this.UseCase.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCase, length must be less than 500.", new [] { "UseCase" }); + } + + // UseCase (string) minLength + if (this.UseCase != null && this.UseCase.Length < 0) + { + yield return new ValidationResult("Invalid value for UseCase, length must be greater than 0.", new [] { "UseCase" }); + } + + // UseCaseSummary (string) maxLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be less than 500.", new [] { "UseCaseSummary" }); + } + + // UseCaseSummary (string) minLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length < 0) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be greater than 0.", new [] { "UseCaseSummary" }); + } + + // ProductionMessageContent (string) maxLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length > 500) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be less than 500.", new [] { "ProductionMessageContent" }); + } + + // ProductionMessageContent (string) minLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length < 0) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be greater than 0.", new [] { "ProductionMessageContent" }); + } + + // AdditionalInformation (string) maxLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length > 500) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be less than 500.", new [] { "AdditionalInformation" }); + } + + // AdditionalInformation (string) minLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length < 0) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be greater than 0.", new [] { "AdditionalInformation" }); + } + + // IsvReseller (string) maxLength + if (this.IsvReseller != null && this.IsvReseller.Length > 500) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be less than 500.", new [] { "IsvReseller" }); + } + + // IsvReseller (string) minLength + if (this.IsvReseller != null && this.IsvReseller.Length < 0) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be greater than 0.", new [] { "IsvReseller" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/TfvSubmissionWrapper.cs b/src/Bandwidth.Standard/Model/TfvSubmissionWrapper.cs new file mode 100644 index 0000000..3d38000 --- /dev/null +++ b/src/Bandwidth.Standard/Model/TfvSubmissionWrapper.cs @@ -0,0 +1,83 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// TfvSubmissionWrapper + /// + [DataContract(Name = "tfvSubmissionWrapper")] + public partial class TfvSubmissionWrapper : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// submission. + public TfvSubmissionWrapper(VerificationUpdateRequest submission = default(VerificationUpdateRequest)) + { + this.Submission = submission; + } + + /// + /// Gets or Sets Submission + /// + [DataMember(Name = "submission", EmitDefaultValue = false)] + public VerificationUpdateRequest Submission { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TfvSubmissionWrapper {\n"); + sb.Append(" Submission: ").Append(Submission).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/VerificationDenialWebhook.cs b/src/Bandwidth.Standard/Model/VerificationDenialWebhook.cs new file mode 100644 index 0000000..7444d32 --- /dev/null +++ b/src/Bandwidth.Standard/Model/VerificationDenialWebhook.cs @@ -0,0 +1,183 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// VerificationDenialWebhook + /// + [DataContract(Name = "verificationDenialWebhook")] + public partial class VerificationDenialWebhook : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// User's account ID.. + /// An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply.. + /// Explanation for why a verification request was declined.. + /// Reason code for denial.. + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number.. + /// Toll-free telephone number in E.164 format.. + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT.. + /// status (default to "UNVERIFIED"). + public VerificationDenialWebhook(string accountId = default(string), List additionalDenialReasons = default(List), string declineReasonDescription = default(string), int denialStatusCode = default(int), Guid internalTicketNumber = default(Guid), string phoneNumber = default(string), bool resubmitAllowed = default(bool), string status = @"UNVERIFIED") + { + this.AccountId = accountId; + this.AdditionalDenialReasons = additionalDenialReasons; + this.DeclineReasonDescription = declineReasonDescription; + this.DenialStatusCode = denialStatusCode; + this.InternalTicketNumber = internalTicketNumber; + this.PhoneNumber = phoneNumber; + this.ResubmitAllowed = resubmitAllowed; + // use default value if no "status" provided + this.Status = status ?? @"UNVERIFIED"; + } + + /// + /// User's account ID. + /// + /// User's account ID. + /// 1234567 + [DataMember(Name = "accountId", EmitDefaultValue = false)] + public string AccountId { get; set; } + + /// + /// An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. + /// + /// An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. + /// [{"statusCode":512,"reason":"Reason A","resubmitAllowed":true},{"statusCode":513,"reason":"Reason B","resubmitAllowed":true}] + [DataMember(Name = "additionalDenialReasons", EmitDefaultValue = false)] + public List AdditionalDenialReasons { get; set; } + + /// + /// Explanation for why a verification request was declined. + /// + /// Explanation for why a verification request was declined. + /// Invalid Information - Can't Validate URL - Website is not accessible / not available + [DataMember(Name = "declineReasonDescription", EmitDefaultValue = false)] + public string DeclineReasonDescription { get; set; } + + /// + /// Reason code for denial. + /// + /// Reason code for denial. + /// 511 + [DataMember(Name = "denialStatusCode", EmitDefaultValue = false)] + public int DenialStatusCode { get; set; } + + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// acde070d-8c4c-4f0d-9d8a-162843c10333 + [DataMember(Name = "internalTicketNumber", EmitDefaultValue = false)] + public Guid InternalTicketNumber { get; set; } + + /// + /// Toll-free telephone number in E.164 format. + /// + /// Toll-free telephone number in E.164 format. + /// +18005555555 + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } + + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// + /// Whether a Toll-Free Verification request qualifies for resubmission via PUT. + /// true + [DataMember(Name = "resubmitAllowed", EmitDefaultValue = true)] + public bool ResubmitAllowed { get; set; } + + /// + /// Gets or Sets Status + /// + /// UNVERIFIED + [DataMember(Name = "status", EmitDefaultValue = false)] + public string Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VerificationDenialWebhook {\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" AdditionalDenialReasons: ").Append(AdditionalDenialReasons).Append("\n"); + sb.Append(" DeclineReasonDescription: ").Append(DeclineReasonDescription).Append("\n"); + sb.Append(" DenialStatusCode: ").Append(DenialStatusCode).Append("\n"); + sb.Append(" InternalTicketNumber: ").Append(InternalTicketNumber).Append("\n"); + sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n"); + sb.Append(" ResubmitAllowed: ").Append(ResubmitAllowed).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 12.", new [] { "PhoneNumber" }); + } + + // PhoneNumber (string) minLength + if (this.PhoneNumber != null && this.PhoneNumber.Length < 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be greater than 12.", new [] { "PhoneNumber" }); + } + + if (this.PhoneNumber != null) { + // PhoneNumber (string) pattern + Regex regexPhoneNumber = new Regex(@"^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$", RegexOptions.CultureInvariant); + if (!regexPhoneNumber.Match(this.PhoneNumber).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, must match a pattern of " + regexPhoneNumber, new [] { "PhoneNumber" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/VerificationRequest.cs b/src/Bandwidth.Standard/Model/VerificationRequest.cs new file mode 100644 index 0000000..3bac172 --- /dev/null +++ b/src/Bandwidth.Standard/Model/VerificationRequest.cs @@ -0,0 +1,285 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// VerificationRequest + /// + [DataContract(Name = "verificationRequest")] + public partial class VerificationRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected VerificationRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// businessAddress (required). + /// businessContact (required). + /// Estimated monthly volume of messages from the toll-free number. (required). + /// phoneNumbers (required). + /// The category of the use case. (required). + /// A general idea of the use case and customer. (required). + /// Example of message content. (required). + /// optInWorkflow (required). + /// Any additional information.. + /// ISV name.. + public VerificationRequest(Address businessAddress = default(Address), Contact businessContact = default(Contact), int messageVolume = default(int), List phoneNumbers = default(List), string useCase = default(string), string useCaseSummary = default(string), string productionMessageContent = default(string), OptInWorkflow optInWorkflow = default(OptInWorkflow), string additionalInformation = default(string), string isvReseller = default(string)) + { + // to ensure "businessAddress" is required (not null) + if (businessAddress == null) + { + throw new ArgumentNullException("businessAddress is a required property for VerificationRequest and cannot be null"); + } + this.BusinessAddress = businessAddress; + // to ensure "businessContact" is required (not null) + if (businessContact == null) + { + throw new ArgumentNullException("businessContact is a required property for VerificationRequest and cannot be null"); + } + this.BusinessContact = businessContact; + this.MessageVolume = messageVolume; + // to ensure "phoneNumbers" is required (not null) + if (phoneNumbers == null) + { + throw new ArgumentNullException("phoneNumbers is a required property for VerificationRequest and cannot be null"); + } + this.PhoneNumbers = phoneNumbers; + // to ensure "useCase" is required (not null) + if (useCase == null) + { + throw new ArgumentNullException("useCase is a required property for VerificationRequest and cannot be null"); + } + this.UseCase = useCase; + // to ensure "useCaseSummary" is required (not null) + if (useCaseSummary == null) + { + throw new ArgumentNullException("useCaseSummary is a required property for VerificationRequest and cannot be null"); + } + this.UseCaseSummary = useCaseSummary; + // to ensure "productionMessageContent" is required (not null) + if (productionMessageContent == null) + { + throw new ArgumentNullException("productionMessageContent is a required property for VerificationRequest and cannot be null"); + } + this.ProductionMessageContent = productionMessageContent; + // to ensure "optInWorkflow" is required (not null) + if (optInWorkflow == null) + { + throw new ArgumentNullException("optInWorkflow is a required property for VerificationRequest and cannot be null"); + } + this.OptInWorkflow = optInWorkflow; + this.AdditionalInformation = additionalInformation; + this.IsvReseller = isvReseller; + } + + /// + /// Gets or Sets BusinessAddress + /// + [DataMember(Name = "businessAddress", IsRequired = true, EmitDefaultValue = true)] + public Address BusinessAddress { get; set; } + + /// + /// Gets or Sets BusinessContact + /// + [DataMember(Name = "businessContact", IsRequired = true, EmitDefaultValue = true)] + public Contact BusinessContact { get; set; } + + /// + /// Estimated monthly volume of messages from the toll-free number. + /// + /// Estimated monthly volume of messages from the toll-free number. + /// 10000 + [DataMember(Name = "messageVolume", IsRequired = true, EmitDefaultValue = true)] + public int MessageVolume { get; set; } + + /// + /// Gets or Sets PhoneNumbers + /// + [DataMember(Name = "phoneNumbers", IsRequired = true, EmitDefaultValue = true)] + public List PhoneNumbers { get; set; } + + /// + /// The category of the use case. + /// + /// The category of the use case. + /// 2FA + [DataMember(Name = "useCase", IsRequired = true, EmitDefaultValue = true)] + public string UseCase { get; set; } + + /// + /// A general idea of the use case and customer. + /// + /// A general idea of the use case and customer. + [DataMember(Name = "useCaseSummary", IsRequired = true, EmitDefaultValue = true)] + public string UseCaseSummary { get; set; } + + /// + /// Example of message content. + /// + /// Example of message content. + [DataMember(Name = "productionMessageContent", IsRequired = true, EmitDefaultValue = true)] + public string ProductionMessageContent { get; set; } + + /// + /// Gets or Sets OptInWorkflow + /// + [DataMember(Name = "optInWorkflow", IsRequired = true, EmitDefaultValue = true)] + public OptInWorkflow OptInWorkflow { get; set; } + + /// + /// Any additional information. + /// + /// Any additional information. + [DataMember(Name = "additionalInformation", EmitDefaultValue = true)] + public string AdditionalInformation { get; set; } + + /// + /// ISV name. + /// + /// ISV name. + /// Test ISV + [DataMember(Name = "isvReseller", EmitDefaultValue = true)] + public string IsvReseller { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VerificationRequest {\n"); + sb.Append(" BusinessAddress: ").Append(BusinessAddress).Append("\n"); + sb.Append(" BusinessContact: ").Append(BusinessContact).Append("\n"); + sb.Append(" MessageVolume: ").Append(MessageVolume).Append("\n"); + sb.Append(" PhoneNumbers: ").Append(PhoneNumbers).Append("\n"); + sb.Append(" UseCase: ").Append(UseCase).Append("\n"); + sb.Append(" UseCaseSummary: ").Append(UseCaseSummary).Append("\n"); + sb.Append(" ProductionMessageContent: ").Append(ProductionMessageContent).Append("\n"); + sb.Append(" OptInWorkflow: ").Append(OptInWorkflow).Append("\n"); + sb.Append(" AdditionalInformation: ").Append(AdditionalInformation).Append("\n"); + sb.Append(" IsvReseller: ").Append(IsvReseller).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // MessageVolume (int) maximum + if (this.MessageVolume > (int)10000000) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value less than or equal to 10000000.", new [] { "MessageVolume" }); + } + + // MessageVolume (int) minimum + if (this.MessageVolume < (int)10) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value greater than or equal to 10.", new [] { "MessageVolume" }); + } + + // UseCase (string) maxLength + if (this.UseCase != null && this.UseCase.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCase, length must be less than 500.", new [] { "UseCase" }); + } + + // UseCase (string) minLength + if (this.UseCase != null && this.UseCase.Length < 0) + { + yield return new ValidationResult("Invalid value for UseCase, length must be greater than 0.", new [] { "UseCase" }); + } + + // UseCaseSummary (string) maxLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be less than 500.", new [] { "UseCaseSummary" }); + } + + // UseCaseSummary (string) minLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length < 1) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be greater than 1.", new [] { "UseCaseSummary" }); + } + + // ProductionMessageContent (string) maxLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length > 500) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be less than 500.", new [] { "ProductionMessageContent" }); + } + + // ProductionMessageContent (string) minLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length < 1) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be greater than 1.", new [] { "ProductionMessageContent" }); + } + + // AdditionalInformation (string) maxLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length > 500) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be less than 500.", new [] { "AdditionalInformation" }); + } + + // AdditionalInformation (string) minLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length < 0) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be greater than 0.", new [] { "AdditionalInformation" }); + } + + // IsvReseller (string) maxLength + if (this.IsvReseller != null && this.IsvReseller.Length > 500) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be less than 500.", new [] { "IsvReseller" }); + } + + // IsvReseller (string) minLength + if (this.IsvReseller != null && this.IsvReseller.Length < 0) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be greater than 0.", new [] { "IsvReseller" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/VerificationUpdateRequest.cs b/src/Bandwidth.Standard/Model/VerificationUpdateRequest.cs new file mode 100644 index 0000000..bc8df75 --- /dev/null +++ b/src/Bandwidth.Standard/Model/VerificationUpdateRequest.cs @@ -0,0 +1,271 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// VerificationUpdateRequest + /// + [DataContract(Name = "verificationUpdateRequest")] + public partial class VerificationUpdateRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected VerificationUpdateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// businessAddress (required). + /// businessContact (required). + /// Estimated monthly volume of messages from the toll-free number. (required). + /// The category of the use case. (required). + /// A general idea of the use case and customer. (required). + /// Example of message content. (required). + /// optInWorkflow (required). + /// Any additional information.. + /// ISV name.. + public VerificationUpdateRequest(Address businessAddress = default(Address), Contact businessContact = default(Contact), int messageVolume = default(int), string useCase = default(string), string useCaseSummary = default(string), string productionMessageContent = default(string), OptInWorkflow optInWorkflow = default(OptInWorkflow), string additionalInformation = default(string), string isvReseller = default(string)) + { + // to ensure "businessAddress" is required (not null) + if (businessAddress == null) + { + throw new ArgumentNullException("businessAddress is a required property for VerificationUpdateRequest and cannot be null"); + } + this.BusinessAddress = businessAddress; + // to ensure "businessContact" is required (not null) + if (businessContact == null) + { + throw new ArgumentNullException("businessContact is a required property for VerificationUpdateRequest and cannot be null"); + } + this.BusinessContact = businessContact; + this.MessageVolume = messageVolume; + // to ensure "useCase" is required (not null) + if (useCase == null) + { + throw new ArgumentNullException("useCase is a required property for VerificationUpdateRequest and cannot be null"); + } + this.UseCase = useCase; + // to ensure "useCaseSummary" is required (not null) + if (useCaseSummary == null) + { + throw new ArgumentNullException("useCaseSummary is a required property for VerificationUpdateRequest and cannot be null"); + } + this.UseCaseSummary = useCaseSummary; + // to ensure "productionMessageContent" is required (not null) + if (productionMessageContent == null) + { + throw new ArgumentNullException("productionMessageContent is a required property for VerificationUpdateRequest and cannot be null"); + } + this.ProductionMessageContent = productionMessageContent; + // to ensure "optInWorkflow" is required (not null) + if (optInWorkflow == null) + { + throw new ArgumentNullException("optInWorkflow is a required property for VerificationUpdateRequest and cannot be null"); + } + this.OptInWorkflow = optInWorkflow; + this.AdditionalInformation = additionalInformation; + this.IsvReseller = isvReseller; + } + + /// + /// Gets or Sets BusinessAddress + /// + [DataMember(Name = "businessAddress", IsRequired = true, EmitDefaultValue = true)] + public Address BusinessAddress { get; set; } + + /// + /// Gets or Sets BusinessContact + /// + [DataMember(Name = "businessContact", IsRequired = true, EmitDefaultValue = true)] + public Contact BusinessContact { get; set; } + + /// + /// Estimated monthly volume of messages from the toll-free number. + /// + /// Estimated monthly volume of messages from the toll-free number. + /// 10000 + [DataMember(Name = "messageVolume", IsRequired = true, EmitDefaultValue = true)] + public int MessageVolume { get; set; } + + /// + /// The category of the use case. + /// + /// The category of the use case. + /// 2FA + [DataMember(Name = "useCase", IsRequired = true, EmitDefaultValue = true)] + public string UseCase { get; set; } + + /// + /// A general idea of the use case and customer. + /// + /// A general idea of the use case and customer. + [DataMember(Name = "useCaseSummary", IsRequired = true, EmitDefaultValue = true)] + public string UseCaseSummary { get; set; } + + /// + /// Example of message content. + /// + /// Example of message content. + [DataMember(Name = "productionMessageContent", IsRequired = true, EmitDefaultValue = true)] + public string ProductionMessageContent { get; set; } + + /// + /// Gets or Sets OptInWorkflow + /// + [DataMember(Name = "optInWorkflow", IsRequired = true, EmitDefaultValue = true)] + public OptInWorkflow OptInWorkflow { get; set; } + + /// + /// Any additional information. + /// + /// Any additional information. + [DataMember(Name = "additionalInformation", EmitDefaultValue = true)] + public string AdditionalInformation { get; set; } + + /// + /// ISV name. + /// + /// ISV name. + /// Test ISV + [DataMember(Name = "isvReseller", EmitDefaultValue = true)] + public string IsvReseller { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VerificationUpdateRequest {\n"); + sb.Append(" BusinessAddress: ").Append(BusinessAddress).Append("\n"); + sb.Append(" BusinessContact: ").Append(BusinessContact).Append("\n"); + sb.Append(" MessageVolume: ").Append(MessageVolume).Append("\n"); + sb.Append(" UseCase: ").Append(UseCase).Append("\n"); + sb.Append(" UseCaseSummary: ").Append(UseCaseSummary).Append("\n"); + sb.Append(" ProductionMessageContent: ").Append(ProductionMessageContent).Append("\n"); + sb.Append(" OptInWorkflow: ").Append(OptInWorkflow).Append("\n"); + sb.Append(" AdditionalInformation: ").Append(AdditionalInformation).Append("\n"); + sb.Append(" IsvReseller: ").Append(IsvReseller).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // MessageVolume (int) maximum + if (this.MessageVolume > (int)10000000) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value less than or equal to 10000000.", new [] { "MessageVolume" }); + } + + // MessageVolume (int) minimum + if (this.MessageVolume < (int)10) + { + yield return new ValidationResult("Invalid value for MessageVolume, must be a value greater than or equal to 10.", new [] { "MessageVolume" }); + } + + // UseCase (string) maxLength + if (this.UseCase != null && this.UseCase.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCase, length must be less than 500.", new [] { "UseCase" }); + } + + // UseCase (string) minLength + if (this.UseCase != null && this.UseCase.Length < 0) + { + yield return new ValidationResult("Invalid value for UseCase, length must be greater than 0.", new [] { "UseCase" }); + } + + // UseCaseSummary (string) maxLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length > 500) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be less than 500.", new [] { "UseCaseSummary" }); + } + + // UseCaseSummary (string) minLength + if (this.UseCaseSummary != null && this.UseCaseSummary.Length < 0) + { + yield return new ValidationResult("Invalid value for UseCaseSummary, length must be greater than 0.", new [] { "UseCaseSummary" }); + } + + // ProductionMessageContent (string) maxLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length > 500) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be less than 500.", new [] { "ProductionMessageContent" }); + } + + // ProductionMessageContent (string) minLength + if (this.ProductionMessageContent != null && this.ProductionMessageContent.Length < 0) + { + yield return new ValidationResult("Invalid value for ProductionMessageContent, length must be greater than 0.", new [] { "ProductionMessageContent" }); + } + + // AdditionalInformation (string) maxLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length > 500) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be less than 500.", new [] { "AdditionalInformation" }); + } + + // AdditionalInformation (string) minLength + if (this.AdditionalInformation != null && this.AdditionalInformation.Length < 0) + { + yield return new ValidationResult("Invalid value for AdditionalInformation, length must be greater than 0.", new [] { "AdditionalInformation" }); + } + + // IsvReseller (string) maxLength + if (this.IsvReseller != null && this.IsvReseller.Length > 500) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be less than 500.", new [] { "IsvReseller" }); + } + + // IsvReseller (string) minLength + if (this.IsvReseller != null && this.IsvReseller.Length < 0) + { + yield return new ValidationResult("Invalid value for IsvReseller, length must be greater than 0.", new [] { "IsvReseller" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/VerificationWebhook.cs b/src/Bandwidth.Standard/Model/VerificationWebhook.cs new file mode 100644 index 0000000..6318cfa --- /dev/null +++ b/src/Bandwidth.Standard/Model/VerificationWebhook.cs @@ -0,0 +1,137 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// VerificationWebhook + /// + [DataContract(Name = "verificationWebhook")] + public partial class VerificationWebhook : IValidatableObject + { + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + public TfvCallbackStatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// User's account ID.. + /// Toll-free telephone number in E.164 format.. + /// status. + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number.. + public VerificationWebhook(string accountId = default(string), string phoneNumber = default(string), TfvCallbackStatusEnum? status = default(TfvCallbackStatusEnum?), Guid internalTicketNumber = default(Guid)) + { + this.AccountId = accountId; + this.PhoneNumber = phoneNumber; + this.Status = status; + this.InternalTicketNumber = internalTicketNumber; + } + + /// + /// User's account ID. + /// + /// User's account ID. + /// 1234567 + [DataMember(Name = "accountId", EmitDefaultValue = false)] + public string AccountId { get; set; } + + /// + /// Toll-free telephone number in E.164 format. + /// + /// Toll-free telephone number in E.164 format. + /// +18005555555 + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } + + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// + /// Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + /// acde070d-8c4c-4f0d-9d8a-162843c10333 + [DataMember(Name = "internalTicketNumber", EmitDefaultValue = false)] + public Guid InternalTicketNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VerificationWebhook {\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" PhoneNumber: ").Append(PhoneNumber).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" InternalTicketNumber: ").Append(InternalTicketNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 12.", new [] { "PhoneNumber" }); + } + + // PhoneNumber (string) minLength + if (this.PhoneNumber != null && this.PhoneNumber.Length < 12) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be greater than 12.", new [] { "PhoneNumber" }); + } + + if (this.PhoneNumber != null) { + // PhoneNumber (string) pattern + Regex regexPhoneNumber = new Regex(@"^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$", RegexOptions.CultureInvariant); + if (!regexPhoneNumber.Match(this.PhoneNumber).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, must match a pattern of " + regexPhoneNumber, new [] { "PhoneNumber" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/WebhookSubscription.cs b/src/Bandwidth.Standard/Model/WebhookSubscription.cs new file mode 100644 index 0000000..a93ce38 --- /dev/null +++ b/src/Bandwidth.Standard/Model/WebhookSubscription.cs @@ -0,0 +1,174 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Information about a webhook that Bandwidth should send upon the completion of event customer has subscribed to. + /// + [DataContract(Name = "webhookSubscription")] + public partial class WebhookSubscription : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public WebhookSubscriptionTypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebhookSubscription() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// accountId. + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. (required). + /// type. + /// basicAuthentication. + /// createdDate. + /// modifiedDate. + public WebhookSubscription(string id = default(string), string accountId = default(string), string callbackUrl = default(string), WebhookSubscriptionTypeEnum? type = default(WebhookSubscriptionTypeEnum?), WebhookSubscriptionBasicAuthentication basicAuthentication = default(WebhookSubscriptionBasicAuthentication), DateTime createdDate = default(DateTime), DateTime modifiedDate = default(DateTime)) + { + // to ensure "callbackUrl" is required (not null) + if (callbackUrl == null) + { + throw new ArgumentNullException("callbackUrl is a required property for WebhookSubscription and cannot be null"); + } + this.CallbackUrl = callbackUrl; + this.Id = id; + this.AccountId = accountId; + this.Type = type; + this.BasicAuthentication = basicAuthentication; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + } + + /// + /// Gets or Sets Id + /// + /// 7hICGStfAfeGxEq3N0lQwO + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets AccountId + /// + /// 1234567 + [DataMember(Name = "accountId", EmitDefaultValue = false)] + public string AccountId { get; set; } + + /// + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. + /// + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. + /// https://www.example.com/path/to/resource + [DataMember(Name = "callbackUrl", IsRequired = true, EmitDefaultValue = true)] + public string CallbackUrl { get; set; } + + /// + /// Gets or Sets BasicAuthentication + /// + [DataMember(Name = "basicAuthentication", EmitDefaultValue = false)] + public WebhookSubscriptionBasicAuthentication BasicAuthentication { get; set; } + + /// + /// Gets or Sets CreatedDate + /// + /// 2023-05-15T13:56:39.965Z + [DataMember(Name = "createdDate", EmitDefaultValue = false)] + public DateTime CreatedDate { get; set; } + + /// + /// Gets or Sets ModifiedDate + /// + /// 2023-05-15T13:56:39.965Z + [DataMember(Name = "modifiedDate", EmitDefaultValue = false)] + public DateTime ModifiedDate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebhookSubscription {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" CallbackUrl: ").Append(CallbackUrl).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" BasicAuthentication: ").Append(BasicAuthentication).Append("\n"); + sb.Append(" CreatedDate: ").Append(CreatedDate).Append("\n"); + sb.Append(" ModifiedDate: ").Append(ModifiedDate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // CallbackUrl (string) maxLength + if (this.CallbackUrl != null && this.CallbackUrl.Length > 2000) + { + yield return new ValidationResult("Invalid value for CallbackUrl, length must be less than 2000.", new [] { "CallbackUrl" }); + } + + // CallbackUrl (string) minLength + if (this.CallbackUrl != null && this.CallbackUrl.Length < 0) + { + yield return new ValidationResult("Invalid value for CallbackUrl, length must be greater than 0.", new [] { "CallbackUrl" }); + } + + if (this.CallbackUrl != null) { + // CallbackUrl (string) pattern + Regex regexCallbackUrl = new Regex(@"^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)", RegexOptions.CultureInvariant); + if (!regexCallbackUrl.Match(this.CallbackUrl).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CallbackUrl, must match a pattern of " + regexCallbackUrl, new [] { "CallbackUrl" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/WebhookSubscriptionBasicAuthentication.cs b/src/Bandwidth.Standard/Model/WebhookSubscriptionBasicAuthentication.cs new file mode 100644 index 0000000..e047c53 --- /dev/null +++ b/src/Bandwidth.Standard/Model/WebhookSubscriptionBasicAuthentication.cs @@ -0,0 +1,119 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Basic authentication credentials are not required, but if present, both username and password must be provided. + /// + [DataContract(Name = "webhookSubscription_basicAuthentication")] + public partial class WebhookSubscriptionBasicAuthentication : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebhookSubscriptionBasicAuthentication() { } + /// + /// Initializes a new instance of the class. + /// + /// username (required). + /// password (required). + public WebhookSubscriptionBasicAuthentication(string username = default(string), string password = default(string)) + { + // to ensure "username" is required (not null) + if (username == null) + { + throw new ArgumentNullException("username is a required property for WebhookSubscriptionBasicAuthentication and cannot be null"); + } + this.Username = username; + // to ensure "password" is required (not null) + if (password == null) + { + throw new ArgumentNullException("password is a required property for WebhookSubscriptionBasicAuthentication and cannot be null"); + } + this.Password = password; + } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] + public string Username { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebhookSubscriptionBasicAuthentication {\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Username (string) maxLength + if (this.Username != null && this.Username.Length > 100) + { + yield return new ValidationResult("Invalid value for Username, length must be less than 100.", new [] { "Username" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 200) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 200.", new [] { "Password" }); + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/WebhookSubscriptionRequestSchema.cs b/src/Bandwidth.Standard/Model/WebhookSubscriptionRequestSchema.cs new file mode 100644 index 0000000..3bed1a5 --- /dev/null +++ b/src/Bandwidth.Standard/Model/WebhookSubscriptionRequestSchema.cs @@ -0,0 +1,157 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// WebhookSubscriptionRequestSchema + /// + [DataContract(Name = "webhookSubscriptionRequestSchema")] + public partial class WebhookSubscriptionRequestSchema : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebhookSubscriptionRequestSchema() { } + /// + /// Initializes a new instance of the class. + /// + /// basicAuthentication. + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. (required). + /// An ASCII string submitted by the user as a shared secret key for generating an HMAC header for callbacks.. + public WebhookSubscriptionRequestSchema(TfvBasicAuthentication basicAuthentication = default(TfvBasicAuthentication), string callbackUrl = default(string), string sharedSecretKey = default(string)) + { + // to ensure "callbackUrl" is required (not null) + if (callbackUrl == null) + { + throw new ArgumentNullException("callbackUrl is a required property for WebhookSubscriptionRequestSchema and cannot be null"); + } + this.CallbackUrl = callbackUrl; + this.BasicAuthentication = basicAuthentication; + this.SharedSecretKey = sharedSecretKey; + } + + /// + /// Gets or Sets BasicAuthentication + /// + [DataMember(Name = "basicAuthentication", EmitDefaultValue = false)] + public TfvBasicAuthentication BasicAuthentication { get; set; } + + /// + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. + /// + /// Callback URL to receive status updates from Bandwidth. When a webhook subscription is registered with Bandwidth under a given account ID, it will be used to send status updates for all requests submitted under that account ID. + /// https://www.example.com/path/to/resource + [DataMember(Name = "callbackUrl", IsRequired = true, EmitDefaultValue = true)] + public string CallbackUrl { get; set; } + + /// + /// An ASCII string submitted by the user as a shared secret key for generating an HMAC header for callbacks. + /// + /// An ASCII string submitted by the user as a shared secret key for generating an HMAC header for callbacks. + /// This is my $3cret + [DataMember(Name = "sharedSecretKey", EmitDefaultValue = true)] + public string SharedSecretKey { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebhookSubscriptionRequestSchema {\n"); + sb.Append(" BasicAuthentication: ").Append(BasicAuthentication).Append("\n"); + sb.Append(" CallbackUrl: ").Append(CallbackUrl).Append("\n"); + sb.Append(" SharedSecretKey: ").Append(SharedSecretKey).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // CallbackUrl (string) maxLength + if (this.CallbackUrl != null && this.CallbackUrl.Length > 2000) + { + yield return new ValidationResult("Invalid value for CallbackUrl, length must be less than 2000.", new [] { "CallbackUrl" }); + } + + // CallbackUrl (string) minLength + if (this.CallbackUrl != null && this.CallbackUrl.Length < 0) + { + yield return new ValidationResult("Invalid value for CallbackUrl, length must be greater than 0.", new [] { "CallbackUrl" }); + } + + if (this.CallbackUrl != null) { + // CallbackUrl (string) pattern + Regex regexCallbackUrl = new Regex(@"^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)", RegexOptions.CultureInvariant); + if (!regexCallbackUrl.Match(this.CallbackUrl).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CallbackUrl, must match a pattern of " + regexCallbackUrl, new [] { "CallbackUrl" }); + } + } + + // SharedSecretKey (string) maxLength + if (this.SharedSecretKey != null && this.SharedSecretKey.Length > 64) + { + yield return new ValidationResult("Invalid value for SharedSecretKey, length must be less than 64.", new [] { "SharedSecretKey" }); + } + + // SharedSecretKey (string) minLength + if (this.SharedSecretKey != null && this.SharedSecretKey.Length < 16) + { + yield return new ValidationResult("Invalid value for SharedSecretKey, length must be greater than 16.", new [] { "SharedSecretKey" }); + } + + if (this.SharedSecretKey != null) { + // SharedSecretKey (string) pattern + Regex regexSharedSecretKey = new Regex(@"^[ -~]{16,64}$", RegexOptions.CultureInvariant); + if (!regexSharedSecretKey.Match(this.SharedSecretKey).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SharedSecretKey, must match a pattern of " + regexSharedSecretKey, new [] { "SharedSecretKey" }); + } + } + + yield break; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/WebhookSubscriptionTypeEnum.cs b/src/Bandwidth.Standard/Model/WebhookSubscriptionTypeEnum.cs new file mode 100644 index 0000000..b4a14d2 --- /dev/null +++ b/src/Bandwidth.Standard/Model/WebhookSubscriptionTypeEnum.cs @@ -0,0 +1,48 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// Defines webhookSubscriptionTypeEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WebhookSubscriptionTypeEnum + { + /// + /// Enum TOLLFREEVERIFICATIONSTATUS for value: TOLLFREE_VERIFICATION_STATUS + /// + [EnumMember(Value = "TOLLFREE_VERIFICATION_STATUS")] + TOLLFREEVERIFICATIONSTATUS = 1, + + /// + /// Enum MESSAGINGPORTOUTAPPROVALSTATUS for value: MESSAGING_PORTOUT_APPROVAL_STATUS + /// + [EnumMember(Value = "MESSAGING_PORTOUT_APPROVAL_STATUS")] + MESSAGINGPORTOUTAPPROVALSTATUS = 2 + } + +} diff --git a/src/Bandwidth.Standard/Model/WebhookSubscriptionsListBody.cs b/src/Bandwidth.Standard/Model/WebhookSubscriptionsListBody.cs new file mode 100644 index 0000000..8d1782c --- /dev/null +++ b/src/Bandwidth.Standard/Model/WebhookSubscriptionsListBody.cs @@ -0,0 +1,111 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated). + /// + [DataContract(Name = "webhookSubscriptionsListBody")] + public partial class WebhookSubscriptionsListBody : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebhookSubscriptionsListBody() { } + /// + /// Initializes a new instance of the class. + /// + /// links. + /// errors. + /// data (required). + public WebhookSubscriptionsListBody(LinksObject links = default(LinksObject), List errors = default(List), List data = default(List)) + { + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for WebhookSubscriptionsListBody and cannot be null"); + } + this.Data = data; + this.Links = links; + this.Errors = errors; + } + + /// + /// Gets or Sets Links + /// + [DataMember(Name = "links", EmitDefaultValue = false)] + public LinksObject Links { get; set; } + + /// + /// Gets or Sets Errors + /// + [DataMember(Name = "errors", EmitDefaultValue = false)] + public List Errors { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public List Data { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebhookSubscriptionsListBody {\n"); + sb.Append(" Links: ").Append(Links).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} From f699fba709f3a2d90dec03f38c6fce38a74655c8 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 17 Feb 2025 10:29:54 -0500 Subject: [PATCH 2/6] regenerate with version --- Bandwidth.Standard.sln | 10 +++++----- README.md | 2 +- src/Bandwidth.Standard/Client/Configuration.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Bandwidth.Standard.sln b/Bandwidth.Standard.sln index e4762cb..60b9633 100644 --- a/Bandwidth.Standard.sln +++ b/Bandwidth.Standard.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{3736A9B2-3939-4BA1-8755-A7F84F9A40CC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{DDDF742A-20C3-4C63-9E4A-64D5D21514B0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard.Test", "src\Bandwidth.Standard.Test\Bandwidth.Standard.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3736A9B2-3939-4BA1-8755-A7F84F9A40CC}.Release|Any CPU.Build.0 = Release|Any CPU + {DDDF742A-20C3-4C63-9E4A-64D5D21514B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDDF742A-20C3-4C63-9E4A-64D5D21514B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDDF742A-20C3-4C63-9E4A-64D5D21514B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDDF742A-20C3-4C63-9E4A-64D5D21514B0}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/README.md b/README.md index 277d935..3fb1c7c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Bandwidth's Communication APIs This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- SDK version: 1.0.0-dev +- SDK version: 1.0.0 - Generator version: 7.7.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com) diff --git a/src/Bandwidth.Standard/Client/Configuration.cs b/src/Bandwidth.Standard/Client/Configuration.cs index 8395e3d..8d38d02 100644 --- a/src/Bandwidth.Standard/Client/Configuration.cs +++ b/src/Bandwidth.Standard/Client/Configuration.cs @@ -34,7 +34,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.0.0-dev"; + public const string Version = "1.0.0"; /// /// Identifier for ISO 8601 DateTime Format @@ -113,7 +113,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0-dev/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); BasePath = "http://localhost"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -1100,7 +1100,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0-dev\n"; + report += " SDK Package Version: 1.0.0\n"; return report; } From 3451eebbc2cc66fc01006cd071da18d5ce4efb51 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 17 Feb 2025 11:31:31 -0500 Subject: [PATCH 3/6] unit test cleanup --- .../Unit/Model/CallbackTypeEnumTests.cs | 2 +- .../Unit/Model/CodeRequestTests.cs | 13 +++-- .../Unit/Model/CreateCallResponseTests.cs | 38 +++++++------ .../Unit/Model/CreateCallTests.cs | 54 ++++++++++++------- .../Model/CreateMessageRequestErrorTests.cs | 16 ++++-- .../Unit/Model/LookupRequestTests.cs | 7 +-- .../Unit/Model/MessageCallbackMessageTests.cs | 17 +++++- .../Unit/Model/MessageCallbackTests.cs | 34 +++++++++--- .../Unit/Model/MessageRequestTests.cs | 6 ++- .../Unit/Model/MessagingRequestErrorTests.cs | 7 +-- .../Unit/Model/VerifyCodeRequestTests.cs | 9 ++-- 11 files changed, 141 insertions(+), 62 deletions(-) diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CallbackTypeEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CallbackTypeEnumTests.cs index c97dedf..b39aead 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CallbackTypeEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CallbackTypeEnumTests.cs @@ -20,7 +20,7 @@ using System.Reflection; using Newtonsoft.Json; -namespace Bandwidth.Standard.Test.Model +namespace Bandwidth.Standard.Test.Unit.Model { /// /// Class for testing CallbackTypeEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CodeRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CodeRequestTests.cs index e5b1c40..2e66688 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CodeRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CodeRequestTests.cs @@ -31,7 +31,14 @@ public class CodeRequestTests : IDisposable public CodeRequestTests() { - instance = new CodeRequest(to: "+19195551234", from: "+19195554321", applicationId: "66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1", message: "Your temporary {NAME} {SCOPE} code is {CODE}"); + instance = new CodeRequest( + to: "+19195551234", + from: "+19195554321", + applicationId: "66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1", + scope: "2FA", + message: "Your temporary {NAME} {SCOPE} code is {CODE}", + digits: 6 + ); } public void Dispose() @@ -73,7 +80,6 @@ public void FromTest() [Fact] public void ApplicationIdTest() { - instance.ApplicationId = "66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1"; Assert.IsType(instance.ApplicationId); Assert.Equal("66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1", instance.ApplicationId); } @@ -83,7 +89,6 @@ public void ApplicationIdTest() [Fact] public void ScopeTest() { - instance.Scope = "2FA"; Assert.IsType(instance.Scope); Assert.Equal("2FA", instance.Scope); } @@ -93,7 +98,6 @@ public void ScopeTest() [Fact] public void MessageTest() { - instance.Message = "Your temporary {NAME} {SCOPE} code is {CODE}"; Assert.IsType(instance.Message); Assert.Equal("Your temporary {NAME} {SCOPE} code is {CODE}", instance.Message); } @@ -103,7 +107,6 @@ public void MessageTest() [Fact] public void DigitsTest() { - instance.Digits = 6; Assert.IsType(instance.Digits); Assert.Equal(6, instance.Digits); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs index b965676..db9fdee 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs @@ -31,7 +31,29 @@ public class CreateCallResponseTests : IDisposable public CreateCallResponseTests() { - instance = new CreateCallResponse(applicationId: "04e88489-df02-4e34-a0ee-27a91849555f", accountId: "04e88489-df02-4e34-a0ee-27a91849555f", callId: "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85", to: "+19195551234", from: "+19195554321", callUrl: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85", answerUrl: "https://myServer.example/bandwidth/webhooks/answer"); + instance = new CreateCallResponse( + applicationId: "04e88489-df02-4e34-a0ee-27a91849555f", + accountId: "04e88489-df02-4e34-a0ee-27a91849555f", + callId: "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85", + to: "+19195551234", + from: "+19195554321", + callUrl: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85", + answerUrl: "https://myServer.example/bandwidth/webhooks/answer", + enqueuedTime: new DateTime(2020, 1, 1), + callTimeout: 30, + callbackTimeout: 15, + tag: "test", + answerMethod: CallbackMethodEnum.POST, + answerFallbackMethod: CallbackMethodEnum.POST, + answerFallbackUrl: "https://fallbackTest.url/", + disconnectMethod: CallbackMethodEnum.POST, + disconnectUrl: "https://disconnectTest.url/", + username: "username", + password: "password", + fallbackUsername: "fallbackUsername", + fallbackPassword: "fallbackPassword", + priority: 1 + ); } public void Dispose() @@ -100,7 +122,6 @@ public void FromTest() [Fact] public void EnqueuedTimeTest() { - instance.EnqueuedTime = new DateTime(2020, 1, 1); Assert.IsType(instance.EnqueuedTime); Assert.Equal(new DateTime(2020, 1, 1), instance.EnqueuedTime); } @@ -119,7 +140,6 @@ public void CallUrlTest() [Fact] public void CallTimeoutTest() { - instance.CallTimeout = 30; Assert.IsType(instance.CallTimeout); Assert.Equal(30, instance.CallTimeout); } @@ -129,7 +149,6 @@ public void CallTimeoutTest() [Fact] public void CallbackTimeoutTest() { - instance.CallbackTimeout = 15; Assert.IsType(instance.CallbackTimeout); Assert.Equal(15, instance.CallbackTimeout); } @@ -139,7 +158,6 @@ public void CallbackTimeoutTest() [Fact] public void TagTest() { - instance.Tag = "test"; Assert.IsType(instance.Tag); Assert.Equal("test", instance.Tag); } @@ -149,7 +167,6 @@ public void TagTest() [Fact] public void AnswerMethodTest() { - instance.AnswerMethod = CallbackMethodEnum.POST; Assert.IsType(instance.AnswerMethod); Assert.Equal(CallbackMethodEnum.POST, instance.AnswerMethod); } @@ -168,7 +185,6 @@ public void AnswerUrlTest() [Fact] public void AnswerFallbackMethodTest() { - instance.AnswerFallbackMethod = CallbackMethodEnum.POST; Assert.IsType(instance.AnswerFallbackMethod); Assert.Equal(CallbackMethodEnum.POST, instance.AnswerFallbackMethod); } @@ -178,7 +194,6 @@ public void AnswerFallbackMethodTest() [Fact] public void AnswerFallbackUrlTest() { - instance.AnswerFallbackUrl = "https://fallbackTest.url/"; Assert.IsType(instance.AnswerFallbackUrl); Assert.Equal("https://fallbackTest.url/", instance.AnswerFallbackUrl); } @@ -188,7 +203,6 @@ public void AnswerFallbackUrlTest() [Fact] public void DisconnectMethodTest() { - instance.DisconnectMethod = CallbackMethodEnum.POST; Assert.IsType(instance.DisconnectMethod); Assert.Equal(CallbackMethodEnum.POST, instance.DisconnectMethod); } @@ -198,7 +212,6 @@ public void DisconnectMethodTest() [Fact] public void DisconnectUrlTest() { - instance.DisconnectUrl = "https://disconnectTest.url/"; Assert.IsType(instance.DisconnectUrl); Assert.Equal("https://disconnectTest.url/", instance.DisconnectUrl); } @@ -208,7 +221,6 @@ public void DisconnectUrlTest() [Fact] public void UsernameTest() { - instance.Username = "username"; Assert.IsType(instance.Username); Assert.Equal("username", instance.Username); } @@ -218,7 +230,6 @@ public void UsernameTest() [Fact] public void PasswordTest() { - instance.Password = "password"; Assert.IsType(instance.Password); Assert.Equal("password", instance.Password); } @@ -228,7 +239,6 @@ public void PasswordTest() [Fact] public void FallbackUsernameTest() { - instance.FallbackUsername = "fallbackUsername"; Assert.IsType(instance.FallbackUsername); Assert.Equal("fallbackUsername", instance.FallbackUsername); } @@ -238,7 +248,6 @@ public void FallbackUsernameTest() [Fact] public void FallbackPasswordTest() { - instance.FallbackPassword = "fallbackPassword"; Assert.IsType(instance.FallbackPassword); Assert.Equal("fallbackPassword", instance.FallbackPassword); } @@ -248,7 +257,6 @@ public void FallbackPasswordTest() [Fact] public void PriorityTest() { - instance.Priority = 1; Assert.IsType(instance.Priority); Assert.Equal(1, instance.Priority); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs index 58c10fe..02d5be2 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs @@ -28,10 +28,44 @@ namespace Bandwidth.Standard.Test.Unit.Model public class CreateCallTests : IDisposable { private CreateCall instance; + private MachineDetectionConfiguration machineDetection; public CreateCallTests() { - instance = new CreateCall(to: "+19195551234", from: "+19195554321", applicationId: "1234-qwer-5679-tyui", answerUrl: "https://www.myCallbackServer.example/webhooks/answer"); + machineDetection = new MachineDetectionConfiguration( + mode: MachineDetectionModeEnum.Async, + callbackUrl: "https://test.url/", + callbackMethod: CallbackMethodEnum.POST, + username: "username", + password: "password", + fallbackUrl: "https://fallbackTest.url/", + fallbackMethod: CallbackMethodEnum.POST, + fallbackUsername: "fallbackUsername", + fallbackPassword: "fallbackPassword" + ); + + instance = new CreateCall( + to: "+19195551234", + from: "+19195554321", + applicationId: "1234-qwer-5679-tyui", + answerUrl: "https://www.myCallbackServer.example/webhooks/answer", + displayName: "John Doe", + uui: "1234567890abcdef", + answerMethod: CallbackMethodEnum.POST, + username: "username", + password: "password", + answerFallbackUrl: "https://fallbackTest.url/", + answerFallbackMethod: CallbackMethodEnum.POST, + fallbackUsername: "fallbackUsername", + fallbackPassword: "fallbackPassword", + disconnectUrl: "https://disconnectTest.url/", + disconnectMethod: CallbackMethodEnum.POST, + callTimeout: 30, + callbackTimeout: 15, + machineDetection: machineDetection, + priority: 1, + tag: "test" + ); } public void Dispose() @@ -73,7 +107,6 @@ public void FromTest() [Fact] public void DisplayNameTest() { - instance.DisplayName = "John Doe"; Assert.IsType(instance.DisplayName); Assert.Equal("John Doe", instance.DisplayName); } @@ -83,7 +116,6 @@ public void DisplayNameTest() [Fact] public void UuiTest() { - instance.Uui = "1234567890abcdef"; Assert.IsType(instance.Uui); Assert.Equal("1234567890abcdef", instance.Uui); } @@ -102,7 +134,6 @@ public void ApplicationIdTest() [Fact] public void AnswerUrlTest() { - instance.AnswerUrl = "https://www.myCallbackServer.example/webhooks/answer"; Assert.IsType(instance.AnswerUrl); Assert.Equal("https://www.myCallbackServer.example/webhooks/answer", instance.AnswerUrl); } @@ -112,7 +143,6 @@ public void AnswerUrlTest() [Fact] public void AnswerMethodTest() { - instance.AnswerMethod = CallbackMethodEnum.POST; Assert.IsType(instance.AnswerMethod); Assert.Equal(CallbackMethodEnum.POST, instance.AnswerMethod); } @@ -122,7 +152,6 @@ public void AnswerMethodTest() [Fact] public void UsernameTest() { - instance.Username = "username"; Assert.IsType(instance.Username); Assert.Equal("username", instance.Username); } @@ -132,7 +161,6 @@ public void UsernameTest() [Fact] public void PasswordTest() { - instance.Password = "password"; Assert.IsType(instance.Password); Assert.Equal("password", instance.Password); } @@ -142,7 +170,6 @@ public void PasswordTest() [Fact] public void AnswerFallbackUrlTest() { - instance.AnswerFallbackUrl = "https://fallbackTest.url/"; Assert.IsType(instance.AnswerFallbackUrl); Assert.Equal("https://fallbackTest.url/", instance.AnswerFallbackUrl); } @@ -152,7 +179,6 @@ public void AnswerFallbackUrlTest() [Fact] public void AnswerFallbackMethodTest() { - instance.AnswerFallbackMethod = CallbackMethodEnum.POST; Assert.IsType(instance.AnswerFallbackMethod); Assert.Equal(CallbackMethodEnum.POST, instance.AnswerFallbackMethod); } @@ -162,7 +188,6 @@ public void AnswerFallbackMethodTest() [Fact] public void FallbackUsernameTest() { - instance.FallbackUsername = "fallbackUsername"; Assert.IsType(instance.FallbackUsername); Assert.Equal("fallbackUsername", instance.FallbackUsername); } @@ -172,7 +197,6 @@ public void FallbackUsernameTest() [Fact] public void FallbackPasswordTest() { - instance.FallbackPassword = "fallbackPassword"; Assert.IsType(instance.FallbackPassword); Assert.Equal("fallbackPassword", instance.FallbackPassword); } @@ -182,7 +206,6 @@ public void FallbackPasswordTest() [Fact] public void DisconnectUrlTest() { - instance.DisconnectUrl = "https://disconnectTest.url/"; Assert.IsType(instance.DisconnectUrl); Assert.Equal("https://disconnectTest.url/", instance.DisconnectUrl); } @@ -192,7 +215,6 @@ public void DisconnectUrlTest() [Fact] public void DisconnectMethodTest() { - instance.DisconnectMethod = CallbackMethodEnum.POST; Assert.IsType(instance.DisconnectMethod); Assert.Equal(CallbackMethodEnum.POST, instance.DisconnectMethod); } @@ -202,7 +224,6 @@ public void DisconnectMethodTest() [Fact] public void CallTimeoutTest() { - instance.CallTimeout = 30; Assert.IsType(instance.CallTimeout); Assert.Equal(30, instance.CallTimeout); } @@ -212,7 +233,6 @@ public void CallTimeoutTest() [Fact] public void CallbackTimeoutTest() { - instance.CallbackTimeout = 15; Assert.IsType(instance.CallbackTimeout); Assert.Equal(15, instance.CallbackTimeout); } @@ -222,8 +242,8 @@ public void CallbackTimeoutTest() [Fact] public void MachineDetectionTest() { - instance.MachineDetection = new MachineDetectionConfiguration(mode: MachineDetectionModeEnum.Async, callbackUrl: "https://test.url/", callbackMethod: CallbackMethodEnum.POST, username: "username", password: "password", fallbackUrl: "https://fallbackTest.url/", fallbackMethod: CallbackMethodEnum.POST, fallbackUsername: "fallbackUsername", fallbackPassword: "fallbackPassword"); Assert.IsType(instance.MachineDetection); + Assert.Equal(machineDetection, instance.MachineDetection); } /// /// Test the property 'Priority' @@ -231,7 +251,6 @@ public void MachineDetectionTest() [Fact] public void PriorityTest() { - instance.Priority = 1; Assert.IsType(instance.Priority); Assert.Equal(1, instance.Priority); } @@ -241,7 +260,6 @@ public void PriorityTest() [Fact] public void TagTest() { - instance.Tag = "test"; Assert.IsType(instance.Tag); Assert.Equal("test", instance.Tag); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateMessageRequestErrorTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateMessageRequestErrorTests.cs index febee72..95f17b4 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateMessageRequestErrorTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateMessageRequestErrorTests.cs @@ -28,10 +28,22 @@ namespace Bandwidth.Standard.Test.Unit.Model public class CreateMessageRequestErrorTests : IDisposable { private CreateMessageRequestError instance; + private List fieldErrors; public CreateMessageRequestErrorTests() { - instance = new CreateMessageRequestError(type: "type", description: "description"); + fieldErrors = new List() { + new FieldError( + fieldName: "from", + description: "`invalid` must be replaced with a valid E164 formatted telephone number" + ) + }; + + instance = new CreateMessageRequestError( + type: "type", + description: "description", + fieldErrors: fieldErrors + ); } public void Dispose() @@ -73,8 +85,6 @@ public void DescriptionTest() [Fact] public void FieldErrorsTest() { - var fieldErrors = new List() { new FieldError("from", "`invalid` must be replaced with a valid E164 formatted telephone number") }; - instance.FieldErrors = fieldErrors; Assert.IsType>(instance.FieldErrors); Assert.Equal(fieldErrors, instance.FieldErrors); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LookupRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LookupRequestTests.cs index ce436f4..af0ae9d 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LookupRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LookupRequestTests.cs @@ -31,7 +31,9 @@ public class LookupRequestTests : IDisposable public LookupRequestTests() { - instance = new LookupRequest(new List { "+19195551234" }); + instance = new LookupRequest( + tns: new List { "+19195551234" } + ); } public void Dispose() @@ -55,9 +57,8 @@ public void LookupRequestInstanceTest() [Fact] public void TnsTest() { - instance.Tns = new List { "+15551234567" }; Assert.IsType>(instance.Tns); - Assert.Equal(new List { "+15551234567" }, instance.Tns); + Assert.Equal(new List { "+19195551234" }, instance.Tns); } } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackMessageTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackMessageTests.cs index 54810b2..f2ac525 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackMessageTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackMessageTests.cs @@ -20,7 +20,7 @@ using System.Reflection; using Newtonsoft.Json; -namespace Bandwidth.Standard.Test.Model +namespace Bandwidth.Standard.Test.Unit.Model { /// /// Class for testing MessageCallbackMessage @@ -35,7 +35,20 @@ public class MessageCallbackMessageTests : IDisposable public MessageCallbackMessageTests() { - instance = new MessageCallbackMessage(); + instance = new MessageCallbackMessage( + id: "test", + owner: "test", + applicationId: "test", + time: new DateTime(2020, 1, 1), + segmentCount: 1, + direction: MessageDirectionEnum.In, + to: new List { "+15551234567" }, + from: "+15557654321", + text: "Hello World", + tag: "test", + media: new List { "https://test.url/" }, + priority: PriorityEnum.Default + ); } public void Dispose() diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackTests.cs index 8288d21..8bd102e 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MessageCallbackTests.cs @@ -20,7 +20,7 @@ using System.Reflection; using Newtonsoft.Json; -namespace Bandwidth.Standard.Test.Model +namespace Bandwidth.Standard.Test.Unit.Model { /// /// Class for testing MessageCallback @@ -32,10 +32,33 @@ namespace Bandwidth.Standard.Test.Model public class MessageCallbackTests : IDisposable { private MessageCallback instance; + private MessageCallbackMessage message; public MessageCallbackTests() { - instance = new MessageCallback(); + message = new MessageCallbackMessage( + id: "test", + owner: "test", + applicationId: "test", + time: new DateTime(2020, 1, 1), + segmentCount: 1, + direction: MessageDirectionEnum.In, + to: new List { "+15551234567" }, + from: "+15557654321", + text: "Hello World", + tag: "test", + media: new List { "https://test.url/" }, + priority: PriorityEnum.Default + ); + + instance = new MessageCallback( + time: new DateTime(2020, 1, 1), + type: CallbackTypeEnum.Received, + to: "+19195551234", + description: "test", + message: message, + errorCode: 123 + ); } public void Dispose() @@ -58,7 +81,6 @@ public void MessageCallbackInstanceTest() [Fact] public void TimeTest() { - instance.Time = new DateTime(2020, 1, 1); Assert.IsType(instance.Time); Assert.Equal(new DateTime(2020, 1, 1), instance.Time); } @@ -69,7 +91,6 @@ public void TimeTest() [Fact] public void TypeTest() { - instance.Type = CallbackTypeEnum.Received; Assert.IsType(instance.Type); Assert.Equal(CallbackTypeEnum.Received, instance.Type); } @@ -80,7 +101,6 @@ public void TypeTest() [Fact] public void ToTest() { - instance.To = "+19195551234"; Assert.IsType(instance.To); Assert.Equal("+19195551234", instance.To); } @@ -91,7 +111,6 @@ public void ToTest() [Fact] public void DescriptionTest() { - instance.Description = "test"; Assert.IsType(instance.Description); Assert.Equal("test", instance.Description); } @@ -102,8 +121,8 @@ public void DescriptionTest() [Fact] public void MessageTest() { - instance.Message = new MessageCallbackMessage(); Assert.IsType(instance.Message); + Assert.Equal(message, instance.Message); } /// @@ -112,7 +131,6 @@ public void MessageTest() [Fact] public void ErrorCodeTest() { - instance.ErrorCode = 123; Assert.IsType(instance.ErrorCode); Assert.Equal(123, instance.ErrorCode); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MessageRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MessageRequestTests.cs index 7b5be8b..cf852d4 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MessageRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MessageRequestTests.cs @@ -31,7 +31,11 @@ public class MessageRequestTests : IDisposable public MessageRequestTests() { - instance = new MessageRequest("123-456-abcd", new List { "+15557654321" }, "+15551113333"); + instance = new MessageRequest( + applicationId: "123-456-abcd", + to: new List { "+15557654321" }, + from: "+15551113333" + ); } public void Dispose() diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MessagingRequestErrorTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MessagingRequestErrorTests.cs index 28e87ee..b91c2d8 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MessagingRequestErrorTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MessagingRequestErrorTests.cs @@ -31,7 +31,10 @@ public class MessagingRequestErrorTests : IDisposable public MessagingRequestErrorTests() { - instance = new MessagingRequestError(type: "type", description: "description"); + instance = new MessagingRequestError( + type: "type", + description: "description" + ); } public void Dispose() @@ -55,7 +58,6 @@ public void MessagingRequestErrorInstanceTest() [Fact] public void TypeTest() { - instance.Type = "type"; Assert.IsType(instance.Type); Assert.Equal("type", instance.Type); } @@ -65,7 +67,6 @@ public void TypeTest() [Fact] public void DescriptionTest() { - instance.Description = "description"; Assert.IsType(instance.Description); Assert.Equal("description", instance.Description); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/VerifyCodeRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/VerifyCodeRequestTests.cs index f8718f0..2206705 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/VerifyCodeRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/VerifyCodeRequestTests.cs @@ -31,7 +31,12 @@ public class VerifyCodeRequestTests : IDisposable public VerifyCodeRequestTests() { - instance = new VerifyCodeRequest(to: "+19195551234", code: "123456"); + instance = new VerifyCodeRequest( + to: "+19195551234", + code: "123456", + scope: "2FA", + expirationTimeInMinutes: 3 + ); } public void Dispose() @@ -64,7 +69,6 @@ public void ToTest() [Fact] public void ScopeTest() { - instance.Scope = "2FA"; Assert.IsType(instance.Scope); Assert.Equal("2FA", instance.Scope); } @@ -74,7 +78,6 @@ public void ScopeTest() [Fact] public void ExpirationTimeInMinutesTest() { - instance.ExpirationTimeInMinutes = 3; Assert.IsType(instance.ExpirationTimeInMinutes); Assert.Equal(3, instance.ExpirationTimeInMinutes); } From 2ef5dc405ab5fe7720a4e46f5e5d8b66604a2fa7 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 17 Feb 2025 16:30:58 -0500 Subject: [PATCH 4/6] model unit tests --- .../Unit/Model/AdditionalDenialReasonTests.cs | 85 +++++++++ .../Unit/Model/AddressTests.cs | 129 +++++++++++++ .../Unit/Model/ContactTests.cs | 96 ++++++++++ .../Unit/Model/ErrorTests.cs | 88 +++++++++ .../Unit/Model/FailureWebhookTests.cs | 119 ++++++++++++ .../Unit/Model/LinksObjectTests.cs | 96 ++++++++++ .../Unit/Model/OptInWorkflowTests.cs | 74 ++++++++ .../Unit/Model/TelephoneNumberTests.cs | 62 ++++++ .../Unit/Model/TfvBasicAuthenticationTests.cs | 74 ++++++++ .../Unit/Model/TfvCallbackStatusEnumTests.cs | 53 ++++++ .../Unit/Model/TfvErrorTests.cs | 91 +++++++++ .../Unit/Model/TfvStatusEnumTests.cs | 52 ++++++ .../Unit/Model/TfvStatusTests.cs | 142 ++++++++++++++ .../Unit/Model/TfvSubmissionInfoTests.cs | 176 ++++++++++++++++++ .../Unit/Model/TfvSubmissionWrapperTests.cs | 93 +++++++++ .../Model/VerificationDenialWebhookTests.cs | 148 +++++++++++++++ .../Unit/Model/VerificationRequestTests.cs | 175 +++++++++++++++++ .../Model/VerificationUpdateRequestTests.cs | 164 ++++++++++++++++ .../Unit/Model/VerificationWebhookTests.cs | 97 ++++++++++ ...ookSubscriptionBasicAuthenticationTests.cs | 74 ++++++++ .../WebhookSubscriptionRequestSchemaTests.cs | 89 +++++++++ .../Unit/Model/WebhookSubscriptionTests.cs | 133 +++++++++++++ .../Model/WebhookSubscriptionTypeEnumTests.cs | 51 +++++ .../WebhookSubscriptionsListBodyTests.cs | 82 ++++++++ 24 files changed, 2443 insertions(+) create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/AdditionalDenialReasonTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/AddressTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/ContactTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/ErrorTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/FailureWebhookTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/LinksObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/OptInWorkflowTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TelephoneNumberTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvBasicAuthenticationTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvCallbackStatusEnumTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvErrorTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvStatusEnumTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvStatusTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionInfoTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionWrapperTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/VerificationDenialWebhookTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/VerificationRequestTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/VerificationUpdateRequestTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/VerificationWebhookTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionBasicAuthenticationTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionRequestSchemaTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTypeEnumTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionsListBodyTests.cs diff --git a/src/Bandwidth.Standard.Test/Unit/Model/AdditionalDenialReasonTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/AdditionalDenialReasonTests.cs new file mode 100644 index 0000000..f84a119 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/AdditionalDenialReasonTests.cs @@ -0,0 +1,85 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing AdditionalDenialReason + /// + public class AdditionalDenialReasonTests : IDisposable + { + private AdditionalDenialReason instance; + + public AdditionalDenialReasonTests() + { + instance = new AdditionalDenialReason( + statusCode: 1, + reason: "reason", + resubmitAllowed: true + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalDenialReason + /// + [Fact] + public void AdditionalDenialReasonInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'StatusCode' + /// + [Fact] + public void StatusCodeTest() + { + Assert.IsType(instance.StatusCode); + Assert.Equal(1, instance.StatusCode); + } + + /// + /// Test the property 'Reason' + /// + [Fact] + public void ReasonTest() + { + Assert.IsType(instance.Reason); + Assert.Equal("reason", instance.Reason); + } + + /// + /// Test the property 'ResubmitAllowed' + /// + [Fact] + public void ResubmitAllowedTest() + { + Assert.IsType(instance.ResubmitAllowed); + Assert.Equal(true, instance.ResubmitAllowed); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/AddressTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/AddressTests.cs new file mode 100644 index 0000000..048610f --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/AddressTests.cs @@ -0,0 +1,129 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing Address + /// + public class AddressTests : IDisposable + { + private Address instance; + + public AddressTests() + { + instance = new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Address + /// + [Fact] + public void AddressInstanceTest() + { + Assert.IsType
(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + Assert.IsType(instance.Name); + Assert.Equal("name", instance.Name); + } + + /// + /// Test the property 'Addr1' + /// + [Fact] + public void Addr1Test() + { + Assert.IsType(instance.Addr1); + Assert.Equal("addr1", instance.Addr1); + } + + /// + /// Test the property 'Addr2' + /// + [Fact] + public void Addr2Test() + { + Assert.IsType(instance.Addr2); + Assert.Equal("addr2", instance.Addr2); + } + + /// + /// Test the property 'City' + /// + [Fact] + public void CityTest() + { + Assert.IsType(instance.City); + Assert.Equal("city", instance.City); + } + + /// + /// Test the property 'State' + /// + [Fact] + public void StateTest() + { + Assert.IsType(instance.State); + Assert.Equal("state", instance.State); + } + + /// + /// Test the property 'Zip' + /// + [Fact] + public void ZipTest() + { + Assert.IsType(instance.Zip); + Assert.Equal("zip", instance.Zip); + } + + /// + /// Test the property 'Url' + /// + [Fact] + public void UrlTest() + { + Assert.IsType(instance.Url); + Assert.Equal("url", instance.Url); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/ContactTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/ContactTests.cs new file mode 100644 index 0000000..164447b --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/ContactTests.cs @@ -0,0 +1,96 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing Contact + /// + public class ContactTests : IDisposable + { + private Contact instance; + + public ContactTests() + { + instance = new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Contact + /// + [Fact] + public void ContactInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + Assert.IsType(instance.FirstName); + Assert.Equal("John", instance.FirstName); + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + Assert.IsType(instance.LastName); + Assert.Equal("Doe", instance.LastName); + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + Assert.IsType(instance.Email); + Assert.Equal("email@email.com", instance.Email); + } + + /// + /// Test the property 'PhoneNumber' + /// + [Fact] + public void PhoneNumberTest() + { + Assert.IsType(instance.PhoneNumber); + Assert.Equal("+1234567890", instance.PhoneNumber); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/ErrorTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/ErrorTests.cs new file mode 100644 index 0000000..18f78e2 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/ErrorTests.cs @@ -0,0 +1,88 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing Error + /// + public class ErrorTests : IDisposable + { + private Error instance; + private TelephoneNumber telephoneNumber; + + public ErrorTests() + { + telephoneNumber = new TelephoneNumber(varTelephoneNumber: "1234567890"); + + instance = new Error( + code: 123456, + description: "Test Description", + telephoneNumbers: new List { telephoneNumber } + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Error + /// + [Fact] + public void ErrorInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + Assert.IsType(instance.Code); + Assert.Equal(123456, instance.Code); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + Assert.IsType(instance.Description); + Assert.Equal("Test Description", instance.Description); + } + + /// + /// Test the property 'TelephoneNumbers' + /// + [Fact] + public void TelephoneNumbersTest() + { + Assert.IsType>(instance.TelephoneNumbers); + Assert.Equal(telephoneNumber, instance.TelephoneNumbers.First()); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/FailureWebhookTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/FailureWebhookTests.cs new file mode 100644 index 0000000..923a9e3 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/FailureWebhookTests.cs @@ -0,0 +1,119 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing FailureWebhook + /// + public class FailureWebhookTests : IDisposable + { + private FailureWebhook instance; + private Guid guid = Guid.NewGuid(); + + public FailureWebhookTests() + { + instance = new FailureWebhook( + accountId: "accountId", + phoneNumber: "phoneNumber", + errorCode: "errorCode", + errorDescription: "errorDescription", + errors: new List { "error" }, + internalTicketNumber: guid + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FailureWebhook + /// + [Fact] + public void FailureWebhookInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'AccountId' + /// + [Fact] + public void AccountIdTest() + { + Assert.IsType(instance.AccountId); + Assert.Equal("accountId", instance.AccountId); + } + + /// + /// Test the property 'PhoneNumber' + /// + [Fact] + public void PhoneNumberTest() + { + Assert.IsType(instance.PhoneNumber); + Assert.Equal("phoneNumber", instance.PhoneNumber); + } + + /// + /// Test the property 'ErrorCode' + /// + [Fact] + public void ErrorCodeTest() + { + Assert.IsType(instance.ErrorCode); + Assert.Equal("errorCode", instance.ErrorCode); + } + + /// + /// Test the property 'ErrorDescription' + /// + [Fact] + public void ErrorDescriptionTest() + { + Assert.IsType(instance.ErrorDescription); + Assert.Equal("errorDescription", instance.ErrorDescription); + } + + /// + /// Test the property 'Errors' + /// + [Fact] + public void ErrorsTest() + { + Assert.IsType>(instance.Errors); + Assert.Equal(new List { "error" }, instance.Errors); + } + + /// + /// Test the property 'InternalTicketNumber' + /// + [Fact] + public void InternalTicketNumberTest() + { + Assert.IsType(instance.InternalTicketNumber); + Assert.Equal(guid, instance.InternalTicketNumber); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LinksObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LinksObjectTests.cs new file mode 100644 index 0000000..79898f7 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/LinksObjectTests.cs @@ -0,0 +1,96 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing LinksObject + /// + public class LinksObjectTests : IDisposable + { + private LinksObject instance; + + public LinksObjectTests() + { + instance = new LinksObject( + first: "https://api.cat.com/v1/links/first", + next: "https://api.cat.com/v1/links/nmxt", + previous: "https://api.cat.com/v1/links/previous", + last: "https://api.cat.com/v1/links/last" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LinksObject + /// + [Fact] + public void LinksObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'First' + /// + [Fact] + public void FirstTest() + { + Assert.IsType(instance.First); + Assert.Equal("https://api.cat.com/v1/links/first", instance.First); + } + + /// + /// Test the property 'Next' + /// + [Fact] + public void NextTest() + { + Assert.IsType(instance.Next); + Assert.Equal("https://api.cat.com/v1/links/nmxt", instance.Next); + } + + /// + /// Test the property 'Previous' + /// + [Fact] + public void PreviousTest() + { + Assert.IsType(instance.Previous); + Assert.Equal("https://api.cat.com/v1/links/previous", instance.Previous); + } + + /// + /// Test the property 'Last' + /// + [Fact] + public void LastTest() + { + Assert.IsType(instance.Last); + Assert.Equal("https://api.cat.com/v1/links/last", instance.Last); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/OptInWorkflowTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/OptInWorkflowTests.cs new file mode 100644 index 0000000..5720d11 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/OptInWorkflowTests.cs @@ -0,0 +1,74 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing OptInWorkflow + /// + public class OptInWorkflowTests : IDisposable + { + private OptInWorkflow instance; + + public OptInWorkflowTests() + { + instance = new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OptInWorkflow + /// + [Fact] + public void OptInWorkflowInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + Assert.IsType(instance.Description); + Assert.Equal("description", instance.Description); + } + + /// + /// Test the property 'ImageUrls' + /// + [Fact] + public void ImageUrlsTest() + { + Assert.IsType>(instance.ImageUrls); + Assert.Equal(new List { "imageUrls" }, instance.ImageUrls); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TelephoneNumberTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TelephoneNumberTests.cs new file mode 100644 index 0000000..b1867ef --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TelephoneNumberTests.cs @@ -0,0 +1,62 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TelephoneNumber + /// + public class TelephoneNumberTests : IDisposable + { + private TelephoneNumber instance; + + public TelephoneNumberTests() + { + instance = new TelephoneNumber( + varTelephoneNumber: "+1919551234" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TelephoneNumber + /// + [Fact] + public void TelephoneNumberInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'VarTelephoneNumber' + /// + [Fact] + public void VarTelephoneNumberTest() + { + Assert.Equal("+1919551234", instance.VarTelephoneNumber); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvBasicAuthenticationTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvBasicAuthenticationTests.cs new file mode 100644 index 0000000..dbebc1b --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvBasicAuthenticationTests.cs @@ -0,0 +1,74 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvBasicAuthentication + /// + public class TfvBasicAuthenticationTests : IDisposable + { + private TfvBasicAuthentication instance; + + public TfvBasicAuthenticationTests() + { + instance = new TfvBasicAuthentication( + username: "username", + password: "password" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvBasicAuthentication + /// + [Fact] + public void TfvBasicAuthenticationInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + Assert.IsType(instance.Username); + Assert.Equal("username", instance.Username); + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + Assert.IsType(instance.Password); + Assert.Equal("password", instance.Password); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvCallbackStatusEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvCallbackStatusEnumTests.cs new file mode 100644 index 0000000..a29ef16 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvCallbackStatusEnumTests.cs @@ -0,0 +1,53 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvCallbackStatusEnum + /// + public class TfvCallbackStatusEnumTests : IDisposable + { + private TfvCallbackStatusEnum instance; + + public TfvCallbackStatusEnumTests() + { + instance = new TfvCallbackStatusEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvCallbackStatusEnum + /// + [Fact] + public void TfvCallbackStatusEnumInstanceTest() + { + Assert.IsType(instance); + Assert.Equal("VERIFIED", TfvCallbackStatusEnum.VERIFIED.ToString()); + Assert.Equal("UNVERIFIED", TfvCallbackStatusEnum.UNVERIFIED.ToString()); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvErrorTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvErrorTests.cs new file mode 100644 index 0000000..94aeb8c --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvErrorTests.cs @@ -0,0 +1,91 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvError + /// + public class TfvErrorTests : IDisposable + { + private TfvError instance; + private Dictionary errors; + + public TfvErrorTests() + { + errors = new Dictionary { + { "username", "Username is required." }, + { "email", "Invalid email format." } + }; + + instance = new TfvError( + type: "type", + description: "description", + errors: errors + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvError + /// + [Fact] + public void TfvErrorInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + Assert.IsType(instance.Type); + Assert.Equal("type", instance.Type); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + Assert.IsType(instance.Type); + Assert.Equal("description", instance.Description); + } + + /// + /// Test the property 'Errors' + /// + [Fact] + public void ErrorsTest() + { + Assert.IsType>(instance.Errors); + Assert.Equal(errors, instance.Errors); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusEnumTests.cs new file mode 100644 index 0000000..bfc8e27 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusEnumTests.cs @@ -0,0 +1,52 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvStatusEnum + /// + public class TfvStatusEnumTests : IDisposable + { + private TfvStatusEnum instance; + + public TfvStatusEnumTests() + { + instance = new TfvStatusEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvStatusEnum + /// + [Fact] + public void TfvStatusEnumInstanceTest() + { + Assert.IsType(instance); + + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusTests.cs new file mode 100644 index 0000000..093f807 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvStatusTests.cs @@ -0,0 +1,142 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvStatus + /// + public class TfvStatusTests : IDisposable + { + private TfvStatus instance; + private Guid internalTicketNumber = Guid.NewGuid(); + private TfvSubmissionInfo submission = new TfvSubmissionInfo(); + + public TfvStatusTests() + { + instance = new TfvStatus( + phoneNumber: "phoneNumber", + status: TfvStatusEnum.PENDING, + internalTicketNumber: internalTicketNumber, + declineReasonDescription: "declineReasonDescription", + resubmitAllowed: true, + createdDateTime: DateTime.Parse("2023-10-01T00:00:00Z"), + modifiedDateTime: DateTime.Parse("2023-10-01T00:00:00Z"), + submission: submission + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvStatus + /// + [Fact] + public void TfvStatusInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'PhoneNumber' + /// + [Fact] + public void PhoneNumberTest() + { + Assert.IsType(instance.PhoneNumber); + Assert.Equal("phoneNumber", instance.PhoneNumber); + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + Assert.IsType(instance.Status); + Assert.Equal(TfvStatusEnum.PENDING, instance.Status); + } + + /// + /// Test the property 'InternalTicketNumber' + /// + [Fact] + public void InternalTicketNumberTest() + { + Assert.IsType(instance.InternalTicketNumber); + Assert.Equal(internalTicketNumber, instance.InternalTicketNumber); + } + + /// + /// Test the property 'DeclineReasonDescription' + /// + [Fact] + public void DeclineReasonDescriptionTest() + { + Assert.IsType(instance.DeclineReasonDescription); + Assert.Equal("declineReasonDescription", instance.DeclineReasonDescription); + } + + /// + /// Test the property 'ResubmitAllowed' + /// + [Fact] + public void ResubmitAllowedTest() + { + Assert.IsType(instance.ResubmitAllowed); + Assert.Equal(true, instance.ResubmitAllowed); + } + + /// + /// Test the property 'CreatedDateTime' + /// + [Fact] + public void CreatedDateTimeTest() + { + Assert.IsType(instance.CreatedDateTime); + Assert.Equal(DateTime.Parse("2023-10-01T00:00:00Z"), instance.CreatedDateTime); + } + + /// + /// Test the property 'ModifiedDateTime' + /// + [Fact] + public void ModifiedDateTimeTest() + { + Assert.IsType(instance.ModifiedDateTime); + Assert.Equal(DateTime.Parse("2023-10-01T00:00:00Z"), instance.ModifiedDateTime); + } + + /// + /// Test the property 'Submission' + /// + [Fact] + public void SubmissionTest() + { + Assert.IsType(instance.Submission); + Assert.Equal(submission, instance.Submission); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionInfoTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionInfoTests.cs new file mode 100644 index 0000000..cf8b233 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionInfoTests.cs @@ -0,0 +1,176 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvSubmissionInfo + /// + public class TfvSubmissionInfoTests : IDisposable + { + private TfvSubmissionInfo instance; + private Address businessAddress; + private Contact businessContact; + private OptInWorkflow optInWorkflow; + + public TfvSubmissionInfoTests() + { + businessAddress = new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ); + + businessContact = new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ); + + optInWorkflow = new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ); + + instance = new TfvSubmissionInfo( + businessAddress: businessAddress, + businessContact: businessContact, + messageVolume: 100, + useCase: "test", + useCaseSummary: "test", + productionMessageContent: "test", + optInWorkflow: optInWorkflow, + additionalInformation: "test", + isvReseller: "test" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvSubmissionInfo + /// + [Fact] + public void TfvSubmissionInfoInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'BusinessAddress' + /// + [Fact] + public void BusinessAddressTest() + { + Assert.IsType
(instance.BusinessAddress); + Assert.Equal(businessAddress, instance.BusinessAddress); + } + + /// + /// Test the property 'BusinessContact' + /// + [Fact] + public void BusinessContactTest() + { + Assert.IsType(instance.BusinessContact); + Assert.Equal(businessContact, instance.BusinessContact); + } + + /// + /// Test the property 'MessageVolume' + /// + [Fact] + public void MessageVolumeTest() + { + Assert.IsType(instance.MessageVolume); + Assert.Equal(100, instance.MessageVolume); + } + + /// + /// Test the property 'UseCase' + /// + [Fact] + public void UseCaseTest() + { + Assert.IsType(instance.UseCase); + Assert.Equal("test", instance.UseCase); + } + + /// + /// Test the property 'UseCaseSummary' + /// + [Fact] + public void UseCaseSummaryTest() + { + Assert.IsType(instance.UseCaseSummary); + Assert.Equal("test", instance.UseCaseSummary); + } + + /// + /// Test the property 'ProductionMessageContent' + /// + [Fact] + public void ProductionMessageContentTest() + { + Assert.IsType(instance.ProductionMessageContent); + Assert.Equal("test", instance.ProductionMessageContent); + } + + /// + /// Test the property 'OptInWorkflow' + /// + [Fact] + public void OptInWorkflowTest() + { + Assert.IsType(instance.OptInWorkflow); + Assert.Equal(optInWorkflow, instance.OptInWorkflow); + } + + /// + /// Test the property 'AdditionalInformation' + /// + [Fact] + public void AdditionalInformationTest() + { + Assert.IsType(instance.AdditionalInformation); + Assert.Equal("test", instance.AdditionalInformation); + } + + /// + /// Test the property 'IsvReseller' + /// + [Fact] + public void IsvResellerTest() + { + Assert.IsType(instance.IsvReseller); + Assert.Equal("test", instance.IsvReseller); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionWrapperTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionWrapperTests.cs new file mode 100644 index 0000000..0e6950f --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/TfvSubmissionWrapperTests.cs @@ -0,0 +1,93 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing TfvSubmissionWrapper + /// + + public class TfvSubmissionWrapperTests : IDisposable + { + private TfvSubmissionWrapper instance; + private VerificationUpdateRequest submission; + + public TfvSubmissionWrapperTests() + { + submission = new VerificationUpdateRequest( + businessAddress: new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ), + businessContact: new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ), + messageVolume: 100, + useCase: "test", + useCaseSummary: "test", + productionMessageContent: "test", + optInWorkflow: new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ), + additionalInformation: "test", + isvReseller: "test" + ); + + instance = new TfvSubmissionWrapper( + submission: submission + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TfvSubmissionWrapper + /// + [Fact] + public void TfvSubmissionWrapperInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Submission' + /// + [Fact] + public void SubmissionTest() + { + Assert.IsType(instance.Submission); + Assert.Equal(submission, instance.Submission); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/VerificationDenialWebhookTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/VerificationDenialWebhookTests.cs new file mode 100644 index 0000000..2c32cb3 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/VerificationDenialWebhookTests.cs @@ -0,0 +1,148 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing VerificationDenialWebhook + /// + public class VerificationDenialWebhookTests : IDisposable + { + private VerificationDenialWebhook instance; + private AdditionalDenialReason additionalDenialReason; + private Guid internalTicketNumber = Guid.NewGuid(); + + public VerificationDenialWebhookTests() + { + additionalDenialReason = new AdditionalDenialReason( + statusCode: 512, + reason: "Reason A", + resubmitAllowed: true + ); + + instance = new VerificationDenialWebhook( + accountId: "accountId", + additionalDenialReasons: new List { additionalDenialReason }, + declineReasonDescription: "declineReasonDescription", + denialStatusCode: 511, + internalTicketNumber: internalTicketNumber, + phoneNumber: "+18005551234", + resubmitAllowed: true, + status: "status" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationDenialWebhook + /// + [Fact] + public void VerificationDenialWebhookInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'AccountId' + /// + [Fact] + public void AccountIdTest() + { + Assert.IsType(instance.AccountId); + Assert.Equal("accountId", instance.AccountId); + } + + /// + /// Test the property 'AdditionalDenialReasons' + /// + [Fact] + public void AdditionalDenialReasonsTest() + { + Assert.IsType>(instance.AdditionalDenialReasons); + Assert.Equal(additionalDenialReason, instance.AdditionalDenialReasons.First()); + } + + /// + /// Test the property 'DeclineReasonDescription' + /// + [Fact] + public void DeclineReasonDescriptionTest() + { + Assert.IsType(instance.DeclineReasonDescription); + Assert.Equal("declineReasonDescription", instance.DeclineReasonDescription); + } + + /// + /// Test the property 'DenialStatusCode' + /// + [Fact] + public void DenialStatusCodeTest() + { + Assert.IsType(instance.DenialStatusCode); + Assert.Equal(511, instance.DenialStatusCode); + } + + /// + /// Test the property 'InternalTicketNumber' + /// + [Fact] + public void InternalTicketNumberTest() + { + Assert.IsType(instance.InternalTicketNumber); + Assert.Equal(internalTicketNumber, instance.InternalTicketNumber); + } + + /// + /// Test the property 'PhoneNumber' + /// + [Fact] + public void PhoneNumberTest() + { + Assert.IsType(instance.PhoneNumber); + Assert.Equal("+18005551234", instance.PhoneNumber); + } + + /// + /// Test the property 'ResubmitAllowed' + /// + [Fact] + public void ResubmitAllowedTest() + { + Assert.IsType(instance.ResubmitAllowed); + Assert.Equal(true, instance.ResubmitAllowed); + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + Assert.IsType(instance.Status); + Assert.Equal("status", instance.Status); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/VerificationRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/VerificationRequestTests.cs new file mode 100644 index 0000000..c4f6056 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/VerificationRequestTests.cs @@ -0,0 +1,175 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing VerificationRequest + /// + public class VerificationRequestTests : IDisposable + { + private VerificationRequest instance; + + public VerificationRequestTests() + { + instance = new VerificationRequest( + businessAddress: new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ), + businessContact: new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ), + messageVolume: 100, + phoneNumbers: new List { "+1234567890" }, + useCase: "test", + useCaseSummary: "test", + productionMessageContent: "test", + optInWorkflow: new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ), + additionalInformation: "test", + isvReseller: "test" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationRequest + /// + [Fact] + public void VerificationRequestInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'BusinessAddress' + /// + [Fact] + public void BusinessAddressTest() + { + Assert.IsType
(instance.BusinessAddress); + } + + /// + /// Test the property 'BusinessContact' + /// + [Fact] + public void BusinessContactTest() + { + Assert.IsType(instance.BusinessContact); + } + + /// + /// Test the property 'MessageVolume' + /// + [Fact] + public void MessageVolumeTest() + { + Assert.IsType(instance.MessageVolume); + Assert.Equal(100, instance.MessageVolume); + } + + /// + /// Test the property 'PhoneNumbers' + /// + [Fact] + public void PhoneNumbersTest() + { + Assert.IsType>(instance.PhoneNumbers); + Assert.Equal(new List { "+1234567890" }, instance.PhoneNumbers); + } + + /// + /// Test the property 'UseCase' + /// + [Fact] + public void UseCaseTest() + { + Assert.IsType(instance.UseCase); + Assert.Equal("test", instance.UseCase); + } + + /// + /// Test the property 'UseCaseSummary' + /// + [Fact] + public void UseCaseSummaryTest() + { + Assert.IsType(instance.UseCaseSummary); + Assert.Equal("test", instance.UseCaseSummary); + } + + /// + /// Test the property 'ProductionMessageContent' + /// + [Fact] + public void ProductionMessageContentTest() + { + Assert.IsType(instance.ProductionMessageContent); + Assert.Equal("test", instance.ProductionMessageContent); + } + + /// + /// Test the property 'OptInWorkflow' + /// + [Fact] + public void OptInWorkflowTest() + { + Assert.IsType(instance.OptInWorkflow); + } + + /// + /// Test the property 'AdditionalInformation' + /// + [Fact] + public void AdditionalInformationTest() + { + Assert.IsType(instance.AdditionalInformation); + Assert.Equal("test", instance.AdditionalInformation); + } + + /// + /// Test the property 'IsvReseller' + /// + [Fact] + public void IsvResellerTest() + { + Assert.IsType(instance.IsvReseller); + Assert.Equal("test", instance.IsvReseller); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/VerificationUpdateRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/VerificationUpdateRequestTests.cs new file mode 100644 index 0000000..1a60733 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/VerificationUpdateRequestTests.cs @@ -0,0 +1,164 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing VerificationUpdateRequest + /// + public class VerificationUpdateRequestTests : IDisposable + { + private VerificationUpdateRequest instance; + + public VerificationUpdateRequestTests() + { + instance = new VerificationUpdateRequest( + businessAddress: new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ), + businessContact: new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ), + messageVolume: 100, + useCase: "test", + useCaseSummary: "test", + productionMessageContent: "test", + optInWorkflow: new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ), + additionalInformation: "test", + isvReseller: "test" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationUpdateRequest + /// + [Fact] + public void VerificationUpdateRequestInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'BusinessAddress' + /// + [Fact] + public void BusinessAddressTest() + { + Assert.IsType
(instance.BusinessAddress); + } + + /// + /// Test the property 'BusinessContact' + /// + [Fact] + public void BusinessContactTest() + { + Assert.IsType(instance.BusinessContact); + } + + /// + /// Test the property 'MessageVolume' + /// + [Fact] + public void MessageVolumeTest() + { + Assert.IsType(instance.MessageVolume); + Assert.Equal(100, instance.MessageVolume); + } + + /// + /// Test the property 'UseCase' + /// + [Fact] + public void UseCaseTest() + { + Assert.IsType(instance.UseCase); + Assert.Equal("test", instance.UseCase); + } + + /// + /// Test the property 'UseCaseSummary' + /// + [Fact] + public void UseCaseSummaryTest() + { + Assert.IsType(instance.UseCaseSummary); + Assert.Equal("test", instance.UseCaseSummary); + } + + /// + /// Test the property 'ProductionMessageContent' + /// + [Fact] + public void ProductionMessageContentTest() + { + Assert.IsType(instance.ProductionMessageContent); + Assert.Equal("test", instance.ProductionMessageContent); + } + + /// + /// Test the property 'OptInWorkflow' + /// + [Fact] + public void OptInWorkflowTest() + { + Assert.IsType(instance.OptInWorkflow); + } + + /// + /// Test the property 'AdditionalInformation' + /// + [Fact] + public void AdditionalInformationTest() + { + Assert.IsType(instance.AdditionalInformation); + Assert.Equal("test", instance.AdditionalInformation); + } + + /// + /// Test the property 'IsvReseller' + /// + [Fact] + public void IsvResellerTest() + { + Assert.IsType(instance.IsvReseller); + Assert.Equal("test", instance.IsvReseller); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/VerificationWebhookTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/VerificationWebhookTests.cs new file mode 100644 index 0000000..ae3cecf --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/VerificationWebhookTests.cs @@ -0,0 +1,97 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing VerificationWebhook + /// + public class VerificationWebhookTests : IDisposable + { + private VerificationWebhook instance; + private Guid internalTicketNumber = Guid.NewGuid(); + + public VerificationWebhookTests() + { + instance = new VerificationWebhook( + accountId: "accountId", + phoneNumber: "+1919551234", + status: TfvCallbackStatusEnum.VERIFIED, + internalTicketNumber: internalTicketNumber + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationWebhook + /// + [Fact] + public void VerificationWebhookInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'AccountId' + /// + [Fact] + public void AccountIdTest() + { + Assert.IsType(instance.AccountId); + Assert.Equal("accountId", instance.AccountId); + } + + /// + /// Test the property 'PhoneNumber' + /// + [Fact] + public void PhoneNumberTest() + { + Assert.IsType(instance.PhoneNumber); + Assert.Equal("+1919551234", instance.PhoneNumber); + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + Assert.IsType(instance.Status); + Assert.Equal(TfvCallbackStatusEnum.VERIFIED, instance.Status); + } + + /// + /// Test the property 'InternalTicketNumber' + /// + [Fact] + public void InternalTicketNumberTest() + { + Assert.IsType(instance.InternalTicketNumber); + Assert.Equal(internalTicketNumber, instance.InternalTicketNumber); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionBasicAuthenticationTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionBasicAuthenticationTests.cs new file mode 100644 index 0000000..ea59be5 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionBasicAuthenticationTests.cs @@ -0,0 +1,74 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing WebhookSubscriptionBasicAuthentication + /// + public class WebhookSubscriptionBasicAuthenticationTests : IDisposable + { + private WebhookSubscriptionBasicAuthentication instance; + + public WebhookSubscriptionBasicAuthenticationTests() + { + instance = new WebhookSubscriptionBasicAuthentication( + username: "username", + password: "password" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebhookSubscriptionBasicAuthentication + /// + [Fact] + public void WebhookSubscriptionBasicAuthenticationInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + Assert.IsType(instance.Username); + Assert.Equal("username", instance.Username); + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + Assert.IsType(instance.Password); + Assert.Equal("password", instance.Password); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionRequestSchemaTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionRequestSchemaTests.cs new file mode 100644 index 0000000..0ddd6ea --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionRequestSchemaTests.cs @@ -0,0 +1,89 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing WebhookSubscriptionRequestSchema + /// + public class WebhookSubscriptionRequestSchemaTests : IDisposable + { + private WebhookSubscriptionRequestSchema instance; + + public WebhookSubscriptionRequestSchemaTests() + { + instance = new WebhookSubscriptionRequestSchema( + basicAuthentication: new TfvBasicAuthentication( + username: "username", + password: "password" + ), + callbackUrl: "https://example.com/callback", + sharedSecretKey: "sharedSecretKey" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebhookSubscriptionRequestSchema + /// + [Fact] + public void WebhookSubscriptionRequestSchemaInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'BasicAuthentication' + /// + [Fact] + public void BasicAuthenticationTest() + { + Assert.IsType(instance.BasicAuthentication); + Assert.Equal("username", instance.BasicAuthentication.Username); + Assert.Equal("password", instance.BasicAuthentication.Password); + } + + /// + /// Test the property 'CallbackUrl' + /// + [Fact] + public void CallbackUrlTest() + { + Assert.IsType(instance.CallbackUrl); + Assert.Equal("https://example.com/callback", instance.CallbackUrl); + } + + /// + /// Test the property 'SharedSecretKey' + /// + [Fact] + public void SharedSecretKeyTest() + { + Assert.IsType(instance.SharedSecretKey); + Assert.Equal("sharedSecretKey", instance.SharedSecretKey); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTests.cs new file mode 100644 index 0000000..e72c75b --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTests.cs @@ -0,0 +1,133 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing WebhookSubscription + /// + public class WebhookSubscriptionTests : IDisposable + { + private WebhookSubscription instance; + + public WebhookSubscriptionTests() + { + instance = new WebhookSubscription( + id: "id", + accountId: "accountId", + callbackUrl: "callbackUrl", + type: WebhookSubscriptionTypeEnum.TOLLFREEVERIFICATIONSTATUS, + basicAuthentication: new WebhookSubscriptionBasicAuthentication( + username: "username", + password: "password" + ), + createdDate: DateTime.Parse("2023-10-01T00:00:00Z"), + modifiedDate: DateTime.Parse("2023-10-01T00:00:00Z") + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebhookSubscription + /// + [Fact] + public void WebhookSubscriptionInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + Assert.IsType(instance.Id); + Assert.Equal("id", instance.Id); + } + + /// + /// Test the property 'AccountId' + /// + [Fact] + public void AccountIdTest() + { + Assert.IsType(instance.AccountId); + Assert.Equal("accountId", instance.AccountId); + } + + /// + /// Test the property 'CallbackUrl' + /// + [Fact] + public void CallbackUrlTest() + { + Assert.IsType(instance.CallbackUrl); + Assert.Equal("callbackUrl", instance.CallbackUrl); + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + Assert.IsType(instance.Type); + Assert.Equal(WebhookSubscriptionTypeEnum.TOLLFREEVERIFICATIONSTATUS, instance.Type); + } + + /// + /// Test the property 'BasicAuthentication' + /// + [Fact] + public void BasicAuthenticationTest() + { + Assert.IsType(instance.BasicAuthentication); + Assert.Equal("username", instance.BasicAuthentication.Username); + Assert.Equal("password", instance.BasicAuthentication.Password); + } + + /// + /// Test the property 'CreatedDate' + /// + [Fact] + public void CreatedDateTest() + { + Assert.IsType(instance.CreatedDate); + Assert.Equal(DateTime.Parse("2023-10-01T00:00:00Z"), instance.CreatedDate); + } + + /// + /// Test the property 'ModifiedDate' + /// + [Fact] + public void ModifiedDateTest() + { + Assert.IsType(instance.ModifiedDate); + Assert.Equal(DateTime.Parse("2023-10-01T00:00:00Z"), instance.ModifiedDate); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTypeEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTypeEnumTests.cs new file mode 100644 index 0000000..f9f1fe7 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionTypeEnumTests.cs @@ -0,0 +1,51 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing WebhookSubscriptionTypeEnum + /// + public class WebhookSubscriptionTypeEnumTests : IDisposable + { + private WebhookSubscriptionTypeEnum instance; + + public WebhookSubscriptionTypeEnumTests() + { + instance = new WebhookSubscriptionTypeEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebhookSubscriptionTypeEnum + /// + [Fact] + public void WebhookSubscriptionTypeEnumInstanceTest() + { + Assert.IsType(instance); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionsListBodyTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionsListBodyTests.cs new file mode 100644 index 0000000..b66586a --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/WebhookSubscriptionsListBodyTests.cs @@ -0,0 +1,82 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing WebhookSubscriptionsListBody + /// + public class WebhookSubscriptionsListBodyTests : IDisposable + { + private WebhookSubscriptionsListBody instance; + + public WebhookSubscriptionsListBodyTests() + { + instance = new WebhookSubscriptionsListBody( + links: new LinksObject(), + errors: new List(), + data: new List() + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of WebhookSubscriptionsListBody + /// + [Fact] + public void WebhookSubscriptionsListBodyInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Links' + /// + [Fact] + public void LinksTest() + { + Assert.IsType(instance.Links); + } + + /// + /// Test the property 'Errors' + /// + [Fact] + public void ErrorsTest() + { + Assert.IsType>(instance.Errors); + } + + /// + /// Test the property 'Data' + /// + [Fact] + public void DataTest() + { + Assert.IsType>(instance.Data); + } + } +} From 85f914a338e16016e64214d2919cf99f7f2c45e9 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 17 Feb 2025 16:50:06 -0500 Subject: [PATCH 5/6] smoke test --- .../TollFreeVerificationIntegrationTests.cs | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 src/Bandwidth.Standard.Test/Smoke/TollFreeVerificationIntegrationTests.cs diff --git a/src/Bandwidth.Standard.Test/Smoke/TollFreeVerificationIntegrationTests.cs b/src/Bandwidth.Standard.Test/Smoke/TollFreeVerificationIntegrationTests.cs new file mode 100644 index 0000000..28f5c4b --- /dev/null +++ b/src/Bandwidth.Standard.Test/Smoke/TollFreeVerificationIntegrationTests.cs @@ -0,0 +1,155 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Api; +// uncomment below to import models +//using Bandwidth.Standard.Model; + +namespace Bandwidth.Standard.Test.Smoke +{ + /// + /// Class for testing TollFreeVerificationApi + /// + public class TollFreeVerificationSmokeTests : IDisposable + { + private TollFreeVerificationApi instance; + private string accountId; + private Configuration configuration; + + + public TollFreeVerificationSmokeTests() + { + instance = new TollFreeVerificationApi(); + accountId = Environment.GetEnvironmentVariable("BW_ACCOUNT_ID"); + + // Authorized API Client + configuration = new Configuration(); + configuration.Username = Environment.GetEnvironmentVariable("BW_USERNAME"); + configuration.Password = Environment.GetEnvironmentVariable("BW_PASSWORD"); + instance = new TollFreeVerificationApi(configuration); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TollFreeVerificationApi + /// + [Fact] + public void InstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test CreateWebhookSubscription + /// + [Fact] + public void CreateWebhookSubscriptionTest() + { + //string accountId = null; + //WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema = null; + //var response = instance.CreateWebhookSubscription(accountId, webhookSubscriptionRequestSchema); + //Assert.IsType(response); + } + + /// + /// Test DeleteWebhookSubscription + /// + [Fact] + public void DeleteWebhookSubscriptionTest() + { + //string accountId = null; + //string id = null; + //instance.DeleteWebhookSubscription(accountId, id); + } + + /// + /// Test GetTollFreeVerificationStatus + /// + [Fact] + public void GetTollFreeVerificationStatusTest() + { + //string accountId = null; + //string phoneNumber = null; + //var response = instance.GetTollFreeVerificationStatus(accountId, phoneNumber); + //Assert.IsType(response); + } + + /// + /// Test ListTollFreeUseCases + /// + [Fact] + public void ListTollFreeUseCasesTest() + { + var response = instance.ListTollFreeUseCases(); + Assert.IsType>(response); + } + + /// + /// Test ListWebhookSubscriptions + /// + [Fact] + public void ListWebhookSubscriptionsTest() + { + //string accountId = null; + //var response = instance.ListWebhookSubscriptions(accountId); + //Assert.IsType(response); + } + + /// + /// Test RequestTollFreeVerification + /// + [Fact] + public void RequestTollFreeVerificationTest() + { + //string accountId = null; + //VerificationRequest verificationRequest = null; + //instance.RequestTollFreeVerification(accountId, verificationRequest); + } + + /// + /// Test UpdateTollFreeVerificationRequest + /// + [Fact] + public void UpdateTollFreeVerificationRequestTest() + { + //string accountId = null; + //string phoneNumber = null; + //TfvSubmissionWrapper tfvSubmissionWrapper = null; + //instance.UpdateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper); + } + + /// + /// Test UpdateWebhookSubscription + /// + [Fact] + public void UpdateWebhookSubscriptionTest() + { + //string accountId = null; + //string id = null; + //WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema = null; + //var response = instance.UpdateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema); + //Assert.IsType(response); + } + } +} From 70680aa1ab17882b6baf730160094ad818db808c Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Feb 2025 15:56:41 -0500 Subject: [PATCH 6/6] api unit tests --- .../Unit/Api/TollFreeVerificationApiTests.cs | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 src/Bandwidth.Standard.Test/Unit/Api/TollFreeVerificationApiTests.cs diff --git a/src/Bandwidth.Standard.Test/Unit/Api/TollFreeVerificationApiTests.cs b/src/Bandwidth.Standard.Test/Unit/Api/TollFreeVerificationApiTests.cs new file mode 100644 index 0000000..2831c1d --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Api/TollFreeVerificationApiTests.cs @@ -0,0 +1,192 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Bandwidth.Standard.Client; +using Bandwidth.Standard.Api; +using Bandwidth.Standard.Model; + +namespace Bandwidth.Standard.Test.Unit.Api +{ + /// + /// Class for testing TollFreeVerificationApi + /// + public class TollFreeVerificationApiTests : IDisposable + { + private TollFreeVerificationApi instance; + private Configuration configuration; + + private string accountId = "9900000"; + private string subscriptionId = "test-id-1234"; + private string tfPhoneNumber = "18005551234"; + + private WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema; + private Dictionary verification; + + public TollFreeVerificationApiTests() + { + configuration = new Configuration(); + // configuration.BasePath = "http://127.0.0.1:4010"; + configuration.Username = Environment.GetEnvironmentVariable("BW_USERNAME"); + configuration.Password = Environment.GetEnvironmentVariable("BW_PASSWORD"); + instance = new TollFreeVerificationApi(configuration); + + webhookSubscriptionRequestSchema = new WebhookSubscriptionRequestSchema( + basicAuthentication: new TfvBasicAuthentication( + username: "username", + password: "password" + ), + callbackUrl: "https://example.com", + sharedSecretKey: "shared-secret-key" + ); + + verification = new Dictionary + { + { "businessAddress", new Address( + name: "name", + addr1: "addr1", + addr2: "addr2", + city: "city", + state: "state", + zip: "zip", + url: "url" + ) }, + { "businessContact", new Contact( + firstName: "John", + lastName: "Doe", + email: "email@email.com", + phoneNumber: "+1234567890" + ) }, + { "messageVolume", 12 }, + { "useCase", "useCase" }, + { "useCaseSummary", "useCaseSummary" }, + { "productionMessageContent", "productionMessageContent" }, + { "optInWorkflow", new OptInWorkflow( + description: "description", + imageUrls: new List { "imageUrls" } + ) }, + { "additionalInformation", "additionalInformation" }, + { "isvReseller", "isvReseller" } + }; + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TollFreeVerificationApi + /// + [Fact] + public void InstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test CreateWebhookSubscription + /// + [Fact] + public void CreateWebhookSubscriptionTest() + { + // var response = instance.CreateWebhookSubscriptionWithHttpInfo(accountId, webhookSubscriptionRequestSchema); + // Assert.IsType(response); + } + + /// + /// Test DeleteWebhookSubscription + /// + [Fact] + public void DeleteWebhookSubscriptionTest() + { + //string accountId = null; + //string id = null; + //instance.DeleteWebhookSubscription(accountId, id); + } + + /// + /// Test GetTollFreeVerificationStatus + /// + [Fact] + public void GetTollFreeVerificationStatusTest() + { + //string accountId = null; + //string phoneNumber = null; + //var response = instance.GetTollFreeVerificationStatus(accountId, phoneNumber); + //Assert.IsType(response); + } + + /// + /// Test ListTollFreeUseCases + /// + [Fact] + public void ListTollFreeUseCasesTest() + { + //var response = instance.ListTollFreeUseCases(); + //Assert.IsType>(response); + } + + /// + /// Test ListWebhookSubscriptions + /// + [Fact] + public void ListWebhookSubscriptionsTest() + { + //string accountId = null; + //var response = instance.ListWebhookSubscriptions(accountId); + //Assert.IsType(response); + } + + /// + /// Test RequestTollFreeVerification + /// + [Fact] + public void RequestTollFreeVerificationTest() + { + //string accountId = null; + //VerificationRequest verificationRequest = null; + //instance.RequestTollFreeVerification(accountId, verificationRequest); + } + + /// + /// Test UpdateTollFreeVerificationRequest + /// + [Fact] + public void UpdateTollFreeVerificationRequestTest() + { + //string accountId = null; + //string phoneNumber = null; + //TfvSubmissionWrapper tfvSubmissionWrapper = null; + //instance.UpdateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper); + } + + /// + /// Test UpdateWebhookSubscription + /// + [Fact] + public void UpdateWebhookSubscriptionTest() + { + //string accountId = null; + //string id = null; + //WebhookSubscriptionRequestSchema webhookSubscriptionRequestSchema = null; + //var response = instance.UpdateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema); + //Assert.IsType(response); + } + } +}