From c67fd663579e751637ddff155bc32632f656bfd0 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Nov 2025 11:53:48 -0500 Subject: [PATCH 1/5] SWI-8645 Fix Multi-Channel Messaging Schemas --- .openapi-generator/FILES | 28 +- Bandwidth.Standard.sln | 10 +- README.md | 14 +- api/openapi.yaml | 162 +++++++---- bandwidth.yml | 100 +++++-- ...md => MultiChannelChannelListMMSObject.md} | 4 +- ...ltiChannelChannelListMMSResponseObject.md} | 4 +- docs/MultiChannelChannelListObjectBase.md | 12 + docs/MultiChannelChannelListOwnerObject.md | 10 + docs/MultiChannelChannelListRBMObject.md | 13 + ...hannelChannelListRBMObjectAllOfContent.md} | 6 +- ...ultiChannelChannelListRBMResponseObject.md | 14 + docs/MultiChannelChannelListRequestObject.md | 13 + docs/MultiChannelChannelListResponseObject.md | 14 + docs/MultiChannelChannelListSMSObject.md | 13 + ...ultiChannelChannelListSMSResponseObject.md | 14 + docs/MultiChannelMessageRequest.md | 2 +- docs/MultiChannelMessageResponseData.md | 2 +- .../Model/MultiChannelAction.cs | 150 ++++------ ...cs => MultiChannelChannelListMMSObject.cs} | 24 +- ...ltiChannelChannelListMMSResponseObject.cs} | 26 +- .../MultiChannelChannelListObjectBase.cs | 120 ++++++++ .../MultiChannelChannelListOwnerObject.cs | 94 ++++++ .../Model/MultiChannelChannelListRBMObject.cs | 134 +++++++++ ...hannelChannelListRBMObjectAllOfContent.cs} | 152 ++-------- ...ultiChannelChannelListRBMResponseObject.cs | 149 ++++++++++ .../MultiChannelChannelListRequestObject.cs | 272 ++++++++++++++++++ .../MultiChannelChannelListResponseObject.cs | 272 ++++++++++++++++++ .../Model/MultiChannelChannelListSMSObject.cs | 134 +++++++++ ...ultiChannelChannelListSMSResponseObject.cs | 149 ++++++++++ .../Model/MultiChannelMessageRequest.cs | 4 +- .../Model/MultiChannelMessageResponseData.cs | 4 +- src/Bandwidth.Standard/Model/RbmActionBase.cs | 2 +- .../Model/RbmSuggestionResponse.cs | 2 +- 34 files changed, 1770 insertions(+), 353 deletions(-) rename docs/{MultiChannelChannelListObject.md => MultiChannelChannelListMMSObject.md} (78%) rename docs/{MultiChannelMessageResponseDataChannelListInner.md => MultiChannelChannelListMMSResponseObject.md} (79%) create mode 100644 docs/MultiChannelChannelListObjectBase.md create mode 100644 docs/MultiChannelChannelListOwnerObject.md create mode 100644 docs/MultiChannelChannelListRBMObject.md rename docs/{MultiChannelChannelListObjectContent.md => MultiChannelChannelListRBMObjectAllOfContent.md} (75%) create mode 100644 docs/MultiChannelChannelListRBMResponseObject.md create mode 100644 docs/MultiChannelChannelListRequestObject.md create mode 100644 docs/MultiChannelChannelListResponseObject.md create mode 100644 docs/MultiChannelChannelListSMSObject.md create mode 100644 docs/MultiChannelChannelListSMSResponseObject.md rename src/Bandwidth.Standard/Model/{MultiChannelChannelListObject.cs => MultiChannelChannelListMMSObject.cs} (83%) rename src/Bandwidth.Standard/Model/{MultiChannelMessageResponseDataChannelListInner.cs => MultiChannelChannelListMMSResponseObject.cs} (81%) create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListObjectBase.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListOwnerObject.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObject.cs rename src/Bandwidth.Standard/Model/{MultiChannelChannelListObjectContent.cs => MultiChannelChannelListRBMObjectAllOfContent.cs} (55%) create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListRBMResponseObject.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListRequestObject.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListResponseObject.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListSMSObject.cs create mode 100644 src/Bandwidth.Standard/Model/MultiChannelChannelListSMSResponseObject.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 75008e1..2450528 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -100,14 +100,22 @@ docs/MmsMessageContentFile.md docs/MultiChannelAction.md docs/MultiChannelActionCalendarEvent.md docs/MultiChannelApi.md -docs/MultiChannelChannelListObject.md -docs/MultiChannelChannelListObjectContent.md +docs/MultiChannelChannelListMMSObject.md +docs/MultiChannelChannelListMMSResponseObject.md +docs/MultiChannelChannelListObjectBase.md +docs/MultiChannelChannelListOwnerObject.md +docs/MultiChannelChannelListRBMObject.md +docs/MultiChannelChannelListRBMObjectAllOfContent.md +docs/MultiChannelChannelListRBMResponseObject.md +docs/MultiChannelChannelListRequestObject.md +docs/MultiChannelChannelListResponseObject.md +docs/MultiChannelChannelListSMSObject.md +docs/MultiChannelChannelListSMSResponseObject.md docs/MultiChannelError.md docs/MultiChannelMessageChannelEnum.md docs/MultiChannelMessageContent.md docs/MultiChannelMessageRequest.md docs/MultiChannelMessageResponseData.md -docs/MultiChannelMessageResponseDataChannelListInner.md docs/OptInWorkflow.md docs/PageInfo.md docs/PhoneNumberLookupApi.md @@ -300,14 +308,22 @@ src/Bandwidth.Standard/Model/MmsMessageContent.cs src/Bandwidth.Standard/Model/MmsMessageContentFile.cs src/Bandwidth.Standard/Model/MultiChannelAction.cs src/Bandwidth.Standard/Model/MultiChannelActionCalendarEvent.cs -src/Bandwidth.Standard/Model/MultiChannelChannelListObject.cs -src/Bandwidth.Standard/Model/MultiChannelChannelListObjectContent.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListMMSObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListMMSResponseObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListObjectBase.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListOwnerObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObjectAllOfContent.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListRBMResponseObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListRequestObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListResponseObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListSMSObject.cs +src/Bandwidth.Standard/Model/MultiChannelChannelListSMSResponseObject.cs src/Bandwidth.Standard/Model/MultiChannelError.cs src/Bandwidth.Standard/Model/MultiChannelMessageChannelEnum.cs src/Bandwidth.Standard/Model/MultiChannelMessageContent.cs src/Bandwidth.Standard/Model/MultiChannelMessageRequest.cs src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs -src/Bandwidth.Standard/Model/MultiChannelMessageResponseDataChannelListInner.cs src/Bandwidth.Standard/Model/OptInWorkflow.cs src/Bandwidth.Standard/Model/PageInfo.cs src/Bandwidth.Standard/Model/PriorityEnum.cs diff --git a/Bandwidth.Standard.sln b/Bandwidth.Standard.sln index 4203f4d..a681fdd 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", "{570BF58B-19EF-4D3F-A07B-952C5E040D9C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{90963038-62D5-4C4E-931F-91B8A5342BAC}" 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 - {570BF58B-19EF-4D3F-A07B-952C5E040D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {570BF58B-19EF-4D3F-A07B-952C5E040D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {570BF58B-19EF-4D3F-A07B-952C5E040D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {570BF58B-19EF-4D3F-A07B-952C5E040D9C}.Release|Any CPU.Build.0 = Release|Any CPU + {90963038-62D5-4C4E-931F-91B8A5342BAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90963038-62D5-4C4E-931F-91B8A5342BAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90963038-62D5-4C4E-931F-91B8A5342BAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90963038-62D5-4C4E-931F-91B8A5342BAC}.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 023d502..00b0a95 100644 --- a/README.md +++ b/README.md @@ -255,14 +255,22 @@ Class | Method | HTTP request | Description - [Model.MmsMessageContentFile](docs/MmsMessageContentFile.md) - [Model.MultiChannelAction](docs/MultiChannelAction.md) - [Model.MultiChannelActionCalendarEvent](docs/MultiChannelActionCalendarEvent.md) - - [Model.MultiChannelChannelListObject](docs/MultiChannelChannelListObject.md) - - [Model.MultiChannelChannelListObjectContent](docs/MultiChannelChannelListObjectContent.md) + - [Model.MultiChannelChannelListMMSObject](docs/MultiChannelChannelListMMSObject.md) + - [Model.MultiChannelChannelListMMSResponseObject](docs/MultiChannelChannelListMMSResponseObject.md) + - [Model.MultiChannelChannelListObjectBase](docs/MultiChannelChannelListObjectBase.md) + - [Model.MultiChannelChannelListOwnerObject](docs/MultiChannelChannelListOwnerObject.md) + - [Model.MultiChannelChannelListRBMObject](docs/MultiChannelChannelListRBMObject.md) + - [Model.MultiChannelChannelListRBMObjectAllOfContent](docs/MultiChannelChannelListRBMObjectAllOfContent.md) + - [Model.MultiChannelChannelListRBMResponseObject](docs/MultiChannelChannelListRBMResponseObject.md) + - [Model.MultiChannelChannelListRequestObject](docs/MultiChannelChannelListRequestObject.md) + - [Model.MultiChannelChannelListResponseObject](docs/MultiChannelChannelListResponseObject.md) + - [Model.MultiChannelChannelListSMSObject](docs/MultiChannelChannelListSMSObject.md) + - [Model.MultiChannelChannelListSMSResponseObject](docs/MultiChannelChannelListSMSResponseObject.md) - [Model.MultiChannelError](docs/MultiChannelError.md) - [Model.MultiChannelMessageChannelEnum](docs/MultiChannelMessageChannelEnum.md) - [Model.MultiChannelMessageContent](docs/MultiChannelMessageContent.md) - [Model.MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) - [Model.MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md) - - [Model.MultiChannelMessageResponseDataChannelListInner](docs/MultiChannelMessageResponseDataChannelListInner.md) - [Model.OptInWorkflow](docs/OptInWorkflow.md) - [Model.PageInfo](docs/PageInfo.md) - [Model.PriorityEnum](docs/PriorityEnum.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index b4d8100..cfdbd76 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8997,6 +8997,12 @@ components: maxItems: 11 type: array multiChannelAction: + anyOf: + - $ref: '#/components/schemas/rbmActionBase' + - $ref: '#/components/schemas/rbmActionDial' + - $ref: '#/components/schemas/rbmActionViewLocation' + - $ref: '#/components/schemas/multiChannelActionCalendarEvent' + - $ref: '#/components/schemas/rbmActionOpenUrl' discriminator: mapping: REPLY: '#/components/schemas/rbmActionBase' @@ -9006,13 +9012,7 @@ components: OPEN_URL: '#/components/schemas/rbmActionOpenUrl' REQUEST_LOCATION: '#/components/schemas/rbmActionBase' propertyName: type - oneOf: - - $ref: '#/components/schemas/rbmActionBase' - - $ref: '#/components/schemas/rbmActionDial' - - $ref: '#/components/schemas/rbmActionViewLocation' - - $ref: '#/components/schemas/multiChannelActionCalendarEvent' - - $ref: '#/components/schemas/rbmActionOpenUrl' - multiChannelChannelListObject: + multiChannelChannelListObjectBase: properties: from: description: The sender ID of the message. This could be an alphanumeric @@ -9026,14 +9026,109 @@ components: type: string channel: $ref: '#/components/schemas/multiChannelMessageChannelEnum' - content: - $ref: '#/components/schemas/multiChannelChannelListObject_content' required: - applicationId - channel - - content - from type: object + multiChannelChannelListRBMObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - properties: + content: + $ref: '#/components/schemas/multiChannelChannelListRBMObject_allOf_content' + type: object + required: + - content + multiChannelChannelListSMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - properties: + content: + $ref: '#/components/schemas/smsMessageContent' + type: object + required: + - content + multiChannelChannelListMMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - properties: + content: + $ref: '#/components/schemas/mmsMessageContent' + type: object + required: + - content + multiChannelChannelListRBMResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + example: + owner: owner + channel: RBM + from: BandwidthRBM + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + content: + suggestions: + - postbackData: !!binary |- + U0dWc2JHOGdkMjl5YkdRPQ== + text: Hello world + type: REPLY + - postbackData: !!binary |- + U0dWc2JHOGdkMjl5YkdRPQ== + text: Hello world + type: REPLY + - postbackData: !!binary |- + U0dWc2JHOGdkMjl5YkdRPQ== + text: Hello world + type: REPLY + - postbackData: !!binary |- + U0dWc2JHOGdkMjl5YkdRPQ== + text: Hello world + type: REPLY + - postbackData: !!binary |- + U0dWc2JHOGdkMjl5YkdRPQ== + text: Hello world + type: REPLY + text: Hello world + multiChannelChannelListSMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListMMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListRequestObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + discriminator: + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMObject' + SMS: '#/components/schemas/multiChannelChannelListSMSObject' + MMS: '#/components/schemas/multiChannelChannelListMMSObject' + propertyName: channel + multiChannelChannelListOwnerObject: + properties: + owner: + description: The Bandwidth senderId associated with the message. Identical + to 'from'. + type: string + required: + - owner + type: object + multiChannelChannelListResponseObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' + discriminator: + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' + SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' + MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' + propertyName: channel multiChannelMessageRequest: description: Multi-Channel Message Request properties: @@ -9046,7 +9141,7 @@ components: \ the order they are listed. Once a message sends successfully, the others\ \ will be ignored." items: - $ref: '#/components/schemas/multiChannelChannelListObject' + $ref: '#/components/schemas/multiChannelChannelListRequestObject' maxItems: 4 type: array tag: @@ -9213,7 +9308,7 @@ components: \ the order they are listed. Once a message sends successfully, the others\ \ will be ignored." items: - $ref: '#/components/schemas/multiChannelMessageResponseData_channelList_inner' + $ref: '#/components/schemas/multiChannelChannelListResponseObject' maxItems: 4 type: array tag: @@ -14549,53 +14644,12 @@ components: type: object required: - height - multiChannelChannelListObject_content: + multiChannelChannelListRBMObject_allOf_content: description: The content of the message. oneOf: - $ref: '#/components/schemas/rbmMessageContentText' - $ref: '#/components/schemas/rbmMessageMedia' - $ref: '#/components/schemas/rbmMessageContentRichCard' - - $ref: '#/components/schemas/smsMessageContent' - - $ref: '#/components/schemas/mmsMessageContent' - multiChannelMessageResponseData_channelList_inner: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObject' - - properties: - owner: - description: The Bandwidth senderId associated with the message. Identical - to 'from'. - type: string - required: - - owner - type: object - example: - owner: owner - channel: RBM - from: BandwidthRBM - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - content: - suggestions: - - postbackData: !!binary |- - U0dWc2JHOGdkMjl5YkdRPQ== - text: Hello world - type: REPLY - - postbackData: !!binary |- - U0dWc2JHOGdkMjl5YkdRPQ== - text: Hello world - type: REPLY - - postbackData: !!binary |- - U0dWc2JHOGdkMjl5YkdRPQ== - text: Hello world - type: REPLY - - postbackData: !!binary |- - U0dWc2JHOGdkMjl5YkdRPQ== - text: Hello world - type: REPLY - - postbackData: !!binary |- - U0dWc2JHOGdkMjl5YkdRPQ== - text: Hello world - type: REPLY - text: Hello world lookupErrorSchema_meta: example: code: 1001 diff --git a/bandwidth.yml b/bandwidth.yml index 0c61348..6ee15ae 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2490,7 +2490,7 @@ components: $ref: '#/components/schemas/multiChannelAction' maxItems: 11 multiChannelAction: - oneOf: + anyOf: - $ref: '#/components/schemas/rbmActionBase' - $ref: '#/components/schemas/rbmActionDial' - $ref: '#/components/schemas/rbmActionViewLocation' @@ -2505,7 +2505,7 @@ components: CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' OPEN_URL: '#/components/schemas/rbmActionOpenUrl' REQUEST_LOCATION: '#/components/schemas/rbmActionBase' - multiChannelChannelListObject: + multiChannelChannelListObjectBase: type: object properties: from: @@ -2514,19 +2514,85 @@ components: $ref: '#/components/schemas/applicationId' channel: $ref: '#/components/schemas/multiChannelMessageChannelEnum' - content: - description: The content of the message. - oneOf: - - $ref: '#/components/schemas/rbmMessageContentText' - - $ref: '#/components/schemas/rbmMessageMedia' - - $ref: '#/components/schemas/rbmMessageContentRichCard' - - $ref: '#/components/schemas/smsMessageContent' - - $ref: '#/components/schemas/mmsMessageContent' required: - from - applicationId - channel + multiChannelChannelListRBMObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + description: The content of the message. + oneOf: + - $ref: '#/components/schemas/rbmMessageContentText' + - $ref: '#/components/schemas/rbmMessageMedia' + - $ref: '#/components/schemas/rbmMessageContentRichCard' + required: - content + multiChannelChannelListSMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/smsMessageContent' + required: + - content + multiChannelChannelListMMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/mmsMessageContent' + required: + - content + multiChannelChannelListRBMResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListSMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListMMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListRequestObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMObject' + SMS: '#/components/schemas/multiChannelChannelListSMSObject' + MMS: '#/components/schemas/multiChannelChannelListMMSObject' + multiChannelChannelListOwnerObject: + type: object + properties: + owner: + type: string + description: >- + The Bandwidth senderId associated with the message. Identical to + 'from'. + required: + - owner + multiChannelChannelListResponseObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' + SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' + MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' multiChannelMessageRequest: description: Multi-Channel Message Request type: object @@ -2540,7 +2606,7 @@ components: order they are listed. Once a message sends successfully, the others will be ignored. items: - $ref: '#/components/schemas/multiChannelChannelListObject' + $ref: '#/components/schemas/multiChannelChannelListRequestObject' maxItems: 4 tag: $ref: '#/components/schemas/tag' @@ -2573,17 +2639,7 @@ components: order they are listed. Once a message sends successfully, the others will be ignored. items: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObject' - - type: object - properties: - owner: - type: string - description: >- - The Bandwidth senderId associated with the message. - Identical to 'from'. - required: - - owner + $ref: '#/components/schemas/multiChannelChannelListResponseObject' maxItems: 4 tag: $ref: '#/components/schemas/tag' diff --git a/docs/MultiChannelChannelListObject.md b/docs/MultiChannelChannelListMMSObject.md similarity index 78% rename from docs/MultiChannelChannelListObject.md rename to docs/MultiChannelChannelListMMSObject.md index c8fb063..8dfedd2 100644 --- a/docs/MultiChannelChannelListObject.md +++ b/docs/MultiChannelChannelListMMSObject.md @@ -1,4 +1,4 @@ -# Bandwidth.Standard.Model.MultiChannelChannelListObject +# Bandwidth.Standard.Model.MultiChannelChannelListMMSObject ## Properties @@ -7,7 +7,7 @@ Name | Type | Description | Notes **From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | **ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | **Channel** | **MultiChannelMessageChannelEnum** | | -**Content** | [**MultiChannelChannelListObjectContent**](MultiChannelChannelListObjectContent.md) | | +**Content** | [**MmsMessageContent**](MmsMessageContent.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MultiChannelMessageResponseDataChannelListInner.md b/docs/MultiChannelChannelListMMSResponseObject.md similarity index 79% rename from docs/MultiChannelMessageResponseDataChannelListInner.md rename to docs/MultiChannelChannelListMMSResponseObject.md index 21061cb..e711b01 100644 --- a/docs/MultiChannelMessageResponseDataChannelListInner.md +++ b/docs/MultiChannelChannelListMMSResponseObject.md @@ -1,4 +1,4 @@ -# Bandwidth.Standard.Model.MultiChannelMessageResponseDataChannelListInner +# Bandwidth.Standard.Model.MultiChannelChannelListMMSResponseObject ## Properties @@ -7,7 +7,7 @@ Name | Type | Description | Notes **From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | **ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | **Channel** | **MultiChannelMessageChannelEnum** | | -**Content** | [**MultiChannelChannelListObjectContent**](MultiChannelChannelListObjectContent.md) | | +**Content** | [**MmsMessageContent**](MmsMessageContent.md) | | **Owner** | **string** | The Bandwidth senderId associated with the message. Identical to 'from'. | [[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/MultiChannelChannelListObjectBase.md b/docs/MultiChannelChannelListObjectBase.md new file mode 100644 index 0000000..2970ea5 --- /dev/null +++ b/docs/MultiChannelChannelListObjectBase.md @@ -0,0 +1,12 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListObjectBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | + +[[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/MultiChannelChannelListOwnerObject.md b/docs/MultiChannelChannelListOwnerObject.md new file mode 100644 index 0000000..c1ff953 --- /dev/null +++ b/docs/MultiChannelChannelListOwnerObject.md @@ -0,0 +1,10 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListOwnerObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Owner** | **string** | The Bandwidth senderId associated with the message. Identical to 'from'. | + +[[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/MultiChannelChannelListRBMObject.md b/docs/MultiChannelChannelListRBMObject.md new file mode 100644 index 0000000..375431e --- /dev/null +++ b/docs/MultiChannelChannelListRBMObject.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListRBMObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**MultiChannelChannelListRBMObjectAllOfContent**](MultiChannelChannelListRBMObjectAllOfContent.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MultiChannelChannelListObjectContent.md b/docs/MultiChannelChannelListRBMObjectAllOfContent.md similarity index 75% rename from docs/MultiChannelChannelListObjectContent.md rename to docs/MultiChannelChannelListRBMObjectAllOfContent.md index facb69a..bd919a2 100644 --- a/docs/MultiChannelChannelListObjectContent.md +++ b/docs/MultiChannelChannelListRBMObjectAllOfContent.md @@ -1,13 +1,13 @@ -# Bandwidth.Standard.Model.MultiChannelChannelListObjectContent +# Bandwidth.Standard.Model.MultiChannelChannelListRBMObjectAllOfContent The content of the message. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Text** | **string** | The contents of the text message. Must be 2048 characters or less. | +**Text** | **string** | The text associated with the message. Must be 3270 characters or less | **Suggestions** | [**List<MultiChannelAction>**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] -**Media** | [**List<MmsMessageContentFile>**](MmsMessageContentFile.md) | | +**Media** | [**RbmMessageContentFile**](RbmMessageContentFile.md) | | **Orientation** | **StandaloneCardOrientationEnum** | | **ThumbnailImageAlignment** | **ThumbnailAlignmentEnum** | | **CardContent** | [**RbmCardContent**](RbmCardContent.md) | | diff --git a/docs/MultiChannelChannelListRBMResponseObject.md b/docs/MultiChannelChannelListRBMResponseObject.md new file mode 100644 index 0000000..9598bca --- /dev/null +++ b/docs/MultiChannelChannelListRBMResponseObject.md @@ -0,0 +1,14 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListRBMResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**MultiChannelChannelListRBMObjectAllOfContent**](MultiChannelChannelListRBMObjectAllOfContent.md) | | +**Owner** | **string** | The Bandwidth senderId associated with the message. Identical to 'from'. | + +[[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/MultiChannelChannelListRequestObject.md b/docs/MultiChannelChannelListRequestObject.md new file mode 100644 index 0000000..3a569b6 --- /dev/null +++ b/docs/MultiChannelChannelListRequestObject.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListRequestObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**MmsMessageContent**](MmsMessageContent.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MultiChannelChannelListResponseObject.md b/docs/MultiChannelChannelListResponseObject.md new file mode 100644 index 0000000..c4a2539 --- /dev/null +++ b/docs/MultiChannelChannelListResponseObject.md @@ -0,0 +1,14 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**MmsMessageContent**](MmsMessageContent.md) | | +**Owner** | **string** | The Bandwidth senderId associated with the message. Identical to 'from'. | + +[[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/MultiChannelChannelListSMSObject.md b/docs/MultiChannelChannelListSMSObject.md new file mode 100644 index 0000000..bf68c75 --- /dev/null +++ b/docs/MultiChannelChannelListSMSObject.md @@ -0,0 +1,13 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListSMSObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**SmsMessageContent**](SmsMessageContent.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MultiChannelChannelListSMSResponseObject.md b/docs/MultiChannelChannelListSMSResponseObject.md new file mode 100644 index 0000000..158ad6d --- /dev/null +++ b/docs/MultiChannelChannelListSMSResponseObject.md @@ -0,0 +1,14 @@ +# Bandwidth.Standard.Model.MultiChannelChannelListSMSResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **string** | The sender ID of the message. This could be an alphanumeric sender ID. | +**ApplicationId** | **string** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**Channel** | **MultiChannelMessageChannelEnum** | | +**Content** | [**SmsMessageContent**](SmsMessageContent.md) | | +**Owner** | **string** | The Bandwidth senderId associated with the message. Identical to 'from'. | + +[[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/MultiChannelMessageRequest.md b/docs/MultiChannelMessageRequest.md index e6de772..644a8fe 100644 --- a/docs/MultiChannelMessageRequest.md +++ b/docs/MultiChannelMessageRequest.md @@ -6,7 +6,7 @@ Multi-Channel Message Request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **To** | **string** | The phone number the message should be sent to in E164 format. | -**ChannelList** | [**List<MultiChannelChannelListObject>**](MultiChannelChannelListObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | +**ChannelList** | [**List<MultiChannelChannelListRequestObject>**](MultiChannelChannelListRequestObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | **Tag** | **string** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] **Priority** | **PriorityEnum** | | [optional] **Expiration** | **DateTime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. | [optional] diff --git a/docs/MultiChannelMessageResponseData.md b/docs/MultiChannelMessageResponseData.md index 10c76a7..ceed001 100644 --- a/docs/MultiChannelMessageResponseData.md +++ b/docs/MultiChannelMessageResponseData.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **Time** | **DateTime** | The time the message was received by the Bandwidth API. | **Direction** | **MessageDirectionEnum** | | **To** | **List<string>** | The destination phone number(s) of the message, in E164 format. | -**ChannelList** | [**List<MultiChannelMessageResponseDataChannelListInner>**](MultiChannelMessageResponseDataChannelListInner.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | +**ChannelList** | [**List<MultiChannelChannelListResponseObject>**](MultiChannelChannelListResponseObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | **Tag** | **string** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] **Priority** | **PriorityEnum** | | [optional] **Expiration** | **DateTime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. | [optional] diff --git a/src/Bandwidth.Standard/Model/MultiChannelAction.cs b/src/Bandwidth.Standard/Model/MultiChannelAction.cs index ac52180..28e43c1 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelAction.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelAction.cs @@ -42,9 +42,9 @@ public partial class MultiChannelAction : AbstractOpenAPISchema, IValidatableObj /// An instance of RbmActionBase. public MultiChannelAction(RbmActionBase actualInstance) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -54,9 +54,9 @@ public MultiChannelAction(RbmActionBase actualInstance) /// An instance of RbmActionDial. public MultiChannelAction(RbmActionDial actualInstance) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -66,9 +66,9 @@ public MultiChannelAction(RbmActionDial actualInstance) /// An instance of RbmActionViewLocation. public MultiChannelAction(RbmActionViewLocation actualInstance) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -78,9 +78,9 @@ public MultiChannelAction(RbmActionViewLocation actualInstance) /// An instance of MultiChannelActionCalendarEvent. public MultiChannelAction(MultiChannelActionCalendarEvent actualInstance) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -90,9 +90,9 @@ public MultiChannelAction(MultiChannelActionCalendarEvent actualInstance) /// An instance of RbmActionOpenUrl. public MultiChannelAction(RbmActionOpenUrl actualInstance) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -109,25 +109,25 @@ public override Object ActualInstance } set { - if (value.GetType() == typeof(MultiChannelActionCalendarEvent) || value is MultiChannelActionCalendarEvent) + if (value.GetType() == typeof(MultiChannelActionCalendarEvent)) { - this._actualInstance = value; + _actualInstance = value; } - else if (value.GetType() == typeof(RbmActionBase) || value is RbmActionBase) + else if (value.GetType() == typeof(RbmActionBase)) { - this._actualInstance = value; + _actualInstance = value; } - else if (value.GetType() == typeof(RbmActionDial) || value is RbmActionDial) + else if (value.GetType() == typeof(RbmActionDial)) { - this._actualInstance = value; + _actualInstance = value; } - else if (value.GetType() == typeof(RbmActionOpenUrl) || value is RbmActionOpenUrl) + else if (value.GetType() == typeof(RbmActionOpenUrl)) { - this._actualInstance = value; + _actualInstance = value; } - else if (value.GetType() == typeof(RbmActionViewLocation) || value is RbmActionViewLocation) + else if (value.GetType() == typeof(RbmActionViewLocation)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -143,7 +143,7 @@ public override Object ActualInstance /// An instance of RbmActionBase public RbmActionBase GetRbmActionBase() { - return (RbmActionBase)this.ActualInstance; + return (RbmActionBase)ActualInstance; } /// @@ -153,7 +153,7 @@ public RbmActionBase GetRbmActionBase() /// An instance of RbmActionDial public RbmActionDial GetRbmActionDial() { - return (RbmActionDial)this.ActualInstance; + return (RbmActionDial)ActualInstance; } /// @@ -163,7 +163,7 @@ public RbmActionDial GetRbmActionDial() /// An instance of RbmActionViewLocation public RbmActionViewLocation GetRbmActionViewLocation() { - return (RbmActionViewLocation)this.ActualInstance; + return (RbmActionViewLocation)ActualInstance; } /// @@ -173,7 +173,7 @@ public RbmActionViewLocation GetRbmActionViewLocation() /// An instance of MultiChannelActionCalendarEvent public MultiChannelActionCalendarEvent GetMultiChannelActionCalendarEvent() { - return (MultiChannelActionCalendarEvent)this.ActualInstance; + return (MultiChannelActionCalendarEvent)ActualInstance; } /// @@ -183,7 +183,7 @@ public MultiChannelActionCalendarEvent GetMultiChannelActionCalendarEvent() /// An instance of RbmActionOpenUrl public RbmActionOpenUrl GetRbmActionOpenUrl() { - return (RbmActionOpenUrl)this.ActualInstance; + return (RbmActionOpenUrl)ActualInstance; } /// @@ -194,7 +194,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class MultiChannelAction {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -205,7 +205,7 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MultiChannelAction.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MultiChannelAction.SerializerSettings); } /// @@ -221,22 +221,12 @@ public static MultiChannelAction FromJson(string jsonString) { return newMultiChannelAction; } - int match = 0; - List matchedTypes = new List(); try { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(MultiChannelActionCalendarEvent).GetProperty("AdditionalProperties") == null) - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); - } - else - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("MultiChannelActionCalendarEvent"); - match++; + newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelAction; } catch (Exception exception) { @@ -246,17 +236,9 @@ public static MultiChannelAction FromJson(string jsonString) try { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(RbmActionBase).GetProperty("AdditionalProperties") == null) - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); - } - else - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("RbmActionBase"); - match++; + newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelAction; } catch (Exception exception) { @@ -266,17 +248,9 @@ public static MultiChannelAction FromJson(string jsonString) try { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(RbmActionDial).GetProperty("AdditionalProperties") == null) - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); - } - else - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("RbmActionDial"); - match++; + newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelAction; } catch (Exception exception) { @@ -286,17 +260,9 @@ public static MultiChannelAction FromJson(string jsonString) try { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(RbmActionOpenUrl).GetProperty("AdditionalProperties") == null) - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); - } - else - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("RbmActionOpenUrl"); - match++; + newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelAction; } catch (Exception exception) { @@ -306,17 +272,9 @@ public static MultiChannelAction FromJson(string jsonString) try { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(RbmActionViewLocation).GetProperty("AdditionalProperties") == null) - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); - } - else - { - newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("RbmActionViewLocation"); - match++; + newMultiChannelAction = new MultiChannelAction(JsonConvert.DeserializeObject(jsonString, MultiChannelAction.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelAction; } catch (Exception exception) { @@ -324,20 +282,10 @@ public static MultiChannelAction FromJson(string jsonString) System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into RbmActionViewLocation: {1}", jsonString, exception.ToString())); } - if (match == 0) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - else if (match > 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return newMultiChannelAction; + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); } - /// /// To validate all properties of the instance /// diff --git a/src/Bandwidth.Standard/Model/MultiChannelChannelListObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListMMSObject.cs similarity index 83% rename from src/Bandwidth.Standard/Model/MultiChannelChannelListObject.cs rename to src/Bandwidth.Standard/Model/MultiChannelChannelListMMSObject.cs index 61c38fc..3f5d24c 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelChannelListObject.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListMMSObject.cs @@ -27,10 +27,10 @@ namespace Bandwidth.Standard.Model { /// - /// MultiChannelChannelListObject + /// MultiChannelChannelListMMSObject /// - [DataContract(Name = "multiChannelChannelListObject")] - public partial class MultiChannelChannelListObject : IValidatableObject + [DataContract(Name = "multiChannelChannelListMMSObject")] + public partial class MultiChannelChannelListMMSObject : IValidatableObject { /// @@ -39,36 +39,36 @@ public partial class MultiChannelChannelListObject : IValidatableObject [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] public MultiChannelMessageChannelEnum Channel { get; set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// [JsonConstructorAttribute] - protected MultiChannelChannelListObject() { } + protected MultiChannelChannelListMMSObject() { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The sender ID of the message. This could be an alphanumeric sender ID. (required). /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). /// channel (required). /// content (required). - public MultiChannelChannelListObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MultiChannelChannelListObjectContent content = default(MultiChannelChannelListObjectContent)) + public MultiChannelChannelListMMSObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MmsMessageContent content = default(MmsMessageContent)) { // to ensure "from" is required (not null) if (from == null) { - throw new ArgumentNullException("from is a required property for MultiChannelChannelListObject and cannot be null"); + throw new ArgumentNullException("from is a required property for MultiChannelChannelListMMSObject and cannot be null"); } this.From = from; // to ensure "applicationId" is required (not null) if (applicationId == null) { - throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListObject and cannot be null"); + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListMMSObject and cannot be null"); } this.ApplicationId = applicationId; this.Channel = channel; // to ensure "content" is required (not null) if (content == null) { - throw new ArgumentNullException("content is a required property for MultiChannelChannelListObject and cannot be null"); + throw new ArgumentNullException("content is a required property for MultiChannelChannelListMMSObject and cannot be null"); } this.Content = content; } @@ -93,7 +93,7 @@ protected MultiChannelChannelListObject() { } /// Gets or Sets Content /// [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] - public MultiChannelChannelListObjectContent Content { get; set; } + public MmsMessageContent Content { get; set; } /// /// Returns the string presentation of the object @@ -102,7 +102,7 @@ protected MultiChannelChannelListObject() { } public override string ToString() { StringBuilder sb = new StringBuilder(); - sb.Append("class MultiChannelChannelListObject {\n"); + sb.Append("class MultiChannelChannelListMMSObject {\n"); sb.Append(" From: ").Append(From).Append("\n"); sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); diff --git a/src/Bandwidth.Standard/Model/MultiChannelMessageResponseDataChannelListInner.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListMMSResponseObject.cs similarity index 81% rename from src/Bandwidth.Standard/Model/MultiChannelMessageResponseDataChannelListInner.cs rename to src/Bandwidth.Standard/Model/MultiChannelChannelListMMSResponseObject.cs index 339599d..374767b 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelMessageResponseDataChannelListInner.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListMMSResponseObject.cs @@ -27,10 +27,10 @@ namespace Bandwidth.Standard.Model { /// - /// MultiChannelMessageResponseDataChannelListInner + /// MultiChannelChannelListMMSResponseObject /// - [DataContract(Name = "multiChannelMessageResponseData_channelList_inner")] - public partial class MultiChannelMessageResponseDataChannelListInner : IValidatableObject + [DataContract(Name = "multiChannelChannelListMMSResponseObject")] + public partial class MultiChannelChannelListMMSResponseObject : IValidatableObject { /// @@ -39,43 +39,43 @@ public partial class MultiChannelMessageResponseDataChannelListInner : IValidata [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] public MultiChannelMessageChannelEnum Channel { get; set; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// [JsonConstructorAttribute] - protected MultiChannelMessageResponseDataChannelListInner() { } + protected MultiChannelChannelListMMSResponseObject() { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The sender ID of the message. This could be an alphanumeric sender ID. (required). /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). /// channel (required). /// content (required). /// The Bandwidth senderId associated with the message. Identical to 'from'. (required). - public MultiChannelMessageResponseDataChannelListInner(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MultiChannelChannelListObjectContent content = default(MultiChannelChannelListObjectContent), string owner = default(string)) + public MultiChannelChannelListMMSResponseObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MmsMessageContent content = default(MmsMessageContent), string owner = default(string)) { // to ensure "from" is required (not null) if (from == null) { - throw new ArgumentNullException("from is a required property for MultiChannelMessageResponseDataChannelListInner and cannot be null"); + throw new ArgumentNullException("from is a required property for MultiChannelChannelListMMSResponseObject and cannot be null"); } this.From = from; // to ensure "applicationId" is required (not null) if (applicationId == null) { - throw new ArgumentNullException("applicationId is a required property for MultiChannelMessageResponseDataChannelListInner and cannot be null"); + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListMMSResponseObject and cannot be null"); } this.ApplicationId = applicationId; this.Channel = channel; // to ensure "content" is required (not null) if (content == null) { - throw new ArgumentNullException("content is a required property for MultiChannelMessageResponseDataChannelListInner and cannot be null"); + throw new ArgumentNullException("content is a required property for MultiChannelChannelListMMSResponseObject and cannot be null"); } this.Content = content; // to ensure "owner" is required (not null) if (owner == null) { - throw new ArgumentNullException("owner is a required property for MultiChannelMessageResponseDataChannelListInner and cannot be null"); + throw new ArgumentNullException("owner is a required property for MultiChannelChannelListMMSResponseObject and cannot be null"); } this.Owner = owner; } @@ -100,7 +100,7 @@ protected MultiChannelMessageResponseDataChannelListInner() { } /// Gets or Sets Content /// [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] - public MultiChannelChannelListObjectContent Content { get; set; } + public MmsMessageContent Content { get; set; } /// /// The Bandwidth senderId associated with the message. Identical to 'from'. @@ -116,7 +116,7 @@ protected MultiChannelMessageResponseDataChannelListInner() { } public override string ToString() { StringBuilder sb = new StringBuilder(); - sb.Append("class MultiChannelMessageResponseDataChannelListInner {\n"); + sb.Append("class MultiChannelChannelListMMSResponseObject {\n"); sb.Append(" From: ").Append(From).Append("\n"); sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); diff --git a/src/Bandwidth.Standard/Model/MultiChannelChannelListObjectBase.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListObjectBase.cs new file mode 100644 index 0000000..41c976d --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListObjectBase.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 +{ + /// + /// MultiChannelChannelListObjectBase + /// + [DataContract(Name = "multiChannelChannelListObjectBase")] + public partial class MultiChannelChannelListObjectBase : IValidatableObject + { + + /// + /// Gets or Sets Channel + /// + [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelMessageChannelEnum Channel { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListObjectBase() { } + /// + /// Initializes a new instance of the class. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. (required). + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). + /// channel (required). + public MultiChannelChannelListObjectBase(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum)) + { + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for MultiChannelChannelListObjectBase and cannot be null"); + } + this.From = from; + // to ensure "applicationId" is required (not null) + if (applicationId == null) + { + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListObjectBase and cannot be null"); + } + this.ApplicationId = applicationId; + this.Channel = channel; + } + + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// BandwidthRBM + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// 93de2206-9669-4e07-948d-329f4b722ee2 + [DataMember(Name = "applicationId", IsRequired = true, EmitDefaultValue = true)] + public string ApplicationId { 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 MultiChannelChannelListObjectBase {\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); + sb.Append(" Channel: ").Append(Channel).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/MultiChannelChannelListOwnerObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListOwnerObject.cs new file mode 100644 index 0000000..274e863 --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListOwnerObject.cs @@ -0,0 +1,94 @@ +/* + * 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 +{ + /// + /// MultiChannelChannelListOwnerObject + /// + [DataContract(Name = "multiChannelChannelListOwnerObject")] + public partial class MultiChannelChannelListOwnerObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListOwnerObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. (required). + public MultiChannelChannelListOwnerObject(string owner = default(string)) + { + // to ensure "owner" is required (not null) + if (owner == null) + { + throw new ArgumentNullException("owner is a required property for MultiChannelChannelListOwnerObject and cannot be null"); + } + this.Owner = owner; + } + + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + [DataMember(Name = "owner", IsRequired = true, EmitDefaultValue = true)] + public string Owner { 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 MultiChannelChannelListOwnerObject {\n"); + sb.Append(" Owner: ").Append(Owner).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/MultiChannelChannelListRBMObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObject.cs new file mode 100644 index 0000000..b2c3dbd --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObject.cs @@ -0,0 +1,134 @@ +/* + * 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 +{ + /// + /// MultiChannelChannelListRBMObject + /// + [DataContract(Name = "multiChannelChannelListRBMObject")] + public partial class MultiChannelChannelListRBMObject : IValidatableObject + { + + /// + /// Gets or Sets Channel + /// + [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelMessageChannelEnum Channel { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListRBMObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. (required). + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). + /// channel (required). + /// content (required). + public MultiChannelChannelListRBMObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MultiChannelChannelListRBMObjectAllOfContent content = default(MultiChannelChannelListRBMObjectAllOfContent)) + { + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for MultiChannelChannelListRBMObject and cannot be null"); + } + this.From = from; + // to ensure "applicationId" is required (not null) + if (applicationId == null) + { + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListRBMObject and cannot be null"); + } + this.ApplicationId = applicationId; + this.Channel = channel; + // to ensure "content" is required (not null) + if (content == null) + { + throw new ArgumentNullException("content is a required property for MultiChannelChannelListRBMObject and cannot be null"); + } + this.Content = content; + } + + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// BandwidthRBM + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// 93de2206-9669-4e07-948d-329f4b722ee2 + [DataMember(Name = "applicationId", IsRequired = true, EmitDefaultValue = true)] + public string ApplicationId { get; set; } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelChannelListRBMObjectAllOfContent Content { 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 MultiChannelChannelListRBMObject {\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); + sb.Append(" Channel: ").Append(Channel).Append("\n"); + sb.Append(" Content: ").Append(Content).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/MultiChannelChannelListObjectContent.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObjectAllOfContent.cs similarity index 55% rename from src/Bandwidth.Standard/Model/MultiChannelChannelListObjectContent.cs rename to src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObjectAllOfContent.cs index 2ecab31..b5bca6e 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelChannelListObjectContent.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMObjectAllOfContent.cs @@ -30,16 +30,16 @@ namespace Bandwidth.Standard.Model /// /// The content of the message. /// - [JsonConverter(typeof(MultiChannelChannelListObjectContentJsonConverter))] - [DataContract(Name = "multiChannelChannelListObject_content")] - public partial class MultiChannelChannelListObjectContent : AbstractOpenAPISchema, IValidatableObject + [JsonConverter(typeof(MultiChannelChannelListRBMObjectAllOfContentJsonConverter))] + [DataContract(Name = "multiChannelChannelListRBMObject_allOf_content")] + public partial class MultiChannelChannelListRBMObjectAllOfContent : AbstractOpenAPISchema, IValidatableObject { /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// with the class /// /// An instance of RbmMessageContentText. - public MultiChannelChannelListObjectContent(RbmMessageContentText actualInstance) + public MultiChannelChannelListRBMObjectAllOfContent(RbmMessageContentText actualInstance) { this.IsNullable = false; this.SchemaType= "oneOf"; @@ -47,11 +47,11 @@ public MultiChannelChannelListObjectContent(RbmMessageContentText actualInstance } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// with the class /// /// An instance of RbmMessageMedia. - public MultiChannelChannelListObjectContent(RbmMessageMedia actualInstance) + public MultiChannelChannelListRBMObjectAllOfContent(RbmMessageMedia actualInstance) { this.IsNullable = false; this.SchemaType= "oneOf"; @@ -59,35 +59,11 @@ public MultiChannelChannelListObjectContent(RbmMessageMedia actualInstance) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// with the class /// /// An instance of RbmMessageContentRichCard. - public MultiChannelChannelListObjectContent(RbmMessageContentRichCard actualInstance) - { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); - } - - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of SmsMessageContent. - public MultiChannelChannelListObjectContent(SmsMessageContent actualInstance) - { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); - } - - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of MmsMessageContent. - public MultiChannelChannelListObjectContent(MmsMessageContent actualInstance) + public MultiChannelChannelListRBMObjectAllOfContent(RbmMessageContentRichCard actualInstance) { this.IsNullable = false; this.SchemaType= "oneOf"; @@ -108,11 +84,7 @@ public override Object ActualInstance } set { - if (value.GetType() == typeof(MmsMessageContent) || value is MmsMessageContent) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(RbmMessageContentRichCard) || value is RbmMessageContentRichCard) + if (value.GetType() == typeof(RbmMessageContentRichCard) || value is RbmMessageContentRichCard) { this._actualInstance = value; } @@ -124,13 +96,9 @@ public override Object ActualInstance { this._actualInstance = value; } - else if (value.GetType() == typeof(SmsMessageContent) || value is SmsMessageContent) - { - this._actualInstance = value; - } else { - throw new ArgumentException("Invalid instance found. Must be the following types: MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent"); + throw new ArgumentException("Invalid instance found. Must be the following types: RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia"); } } } @@ -165,26 +133,6 @@ public RbmMessageContentRichCard GetRbmMessageContentRichCard() return (RbmMessageContentRichCard)this.ActualInstance; } - /// - /// Get the actual instance of `SmsMessageContent`. If the actual instance is not `SmsMessageContent`, - /// the InvalidClassException will be thrown - /// - /// An instance of SmsMessageContent - public SmsMessageContent GetSmsMessageContent() - { - return (SmsMessageContent)this.ActualInstance; - } - - /// - /// Get the actual instance of `MmsMessageContent`. If the actual instance is not `MmsMessageContent`, - /// the InvalidClassException will be thrown - /// - /// An instance of MmsMessageContent - public MmsMessageContent GetMmsMessageContent() - { - return (MmsMessageContent)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// @@ -192,7 +140,7 @@ public MmsMessageContent GetMmsMessageContent() public override string ToString() { var sb = new StringBuilder(); - sb.Append("class MultiChannelChannelListObjectContent {\n"); + sb.Append("class MultiChannelChannelListRBMObjectAllOfContent {\n"); sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -204,55 +152,35 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MultiChannelChannelListObjectContent.SerializerSettings); + return JsonConvert.SerializeObject(this.ActualInstance, MultiChannelChannelListRBMObjectAllOfContent.SerializerSettings); } /// - /// Converts the JSON string into an instance of MultiChannelChannelListObjectContent + /// Converts the JSON string into an instance of MultiChannelChannelListRBMObjectAllOfContent /// /// JSON string - /// An instance of MultiChannelChannelListObjectContent - public static MultiChannelChannelListObjectContent FromJson(string jsonString) + /// An instance of MultiChannelChannelListRBMObjectAllOfContent + public static MultiChannelChannelListRBMObjectAllOfContent FromJson(string jsonString) { - MultiChannelChannelListObjectContent newMultiChannelChannelListObjectContent = null; + MultiChannelChannelListRBMObjectAllOfContent newMultiChannelChannelListRBMObjectAllOfContent = null; if (string.IsNullOrEmpty(jsonString)) { - return newMultiChannelChannelListObjectContent; + return newMultiChannelChannelListRBMObjectAllOfContent; } int match = 0; List matchedTypes = new List(); - try - { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(MmsMessageContent).GetProperty("AdditionalProperties") == null) - { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.SerializerSettings)); - } - else - { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("MmsMessageContent"); - match++; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MmsMessageContent: {1}", jsonString, exception.ToString())); - } - try { // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize if (typeof(RbmMessageContentRichCard).GetProperty("AdditionalProperties") == null) { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.SerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.SerializerSettings)); } else { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.AdditionalPropertiesSerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.AdditionalPropertiesSerializerSettings)); } matchedTypes.Add("RbmMessageContentRichCard"); match++; @@ -268,11 +196,11 @@ public static MultiChannelChannelListObjectContent FromJson(string jsonString) // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize if (typeof(RbmMessageContentText).GetProperty("AdditionalProperties") == null) { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.SerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.SerializerSettings)); } else { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.AdditionalPropertiesSerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.AdditionalPropertiesSerializerSettings)); } matchedTypes.Add("RbmMessageContentText"); match++; @@ -288,11 +216,11 @@ public static MultiChannelChannelListObjectContent FromJson(string jsonString) // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize if (typeof(RbmMessageMedia).GetProperty("AdditionalProperties") == null) { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.SerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.SerializerSettings)); } else { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.AdditionalPropertiesSerializerSettings)); + newMultiChannelChannelListRBMObjectAllOfContent = new MultiChannelChannelListRBMObjectAllOfContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRBMObjectAllOfContent.AdditionalPropertiesSerializerSettings)); } matchedTypes.Add("RbmMessageMedia"); match++; @@ -303,26 +231,6 @@ public static MultiChannelChannelListObjectContent FromJson(string jsonString) System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into RbmMessageMedia: {1}", jsonString, exception.ToString())); } - try - { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof(SmsMessageContent).GetProperty("AdditionalProperties") == null) - { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.SerializerSettings)); - } - else - { - newMultiChannelChannelListObjectContent = new MultiChannelChannelListObjectContent(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListObjectContent.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("SmsMessageContent"); - match++; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SmsMessageContent: {1}", jsonString, exception.ToString())); - } - if (match == 0) { throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); @@ -333,7 +241,7 @@ public static MultiChannelChannelListObjectContent FromJson(string jsonString) } // deserialization is considered successful at this point if no exception has been thrown. - return newMultiChannelChannelListObjectContent; + return newMultiChannelChannelListRBMObjectAllOfContent; } @@ -349,9 +257,9 @@ public static MultiChannelChannelListObjectContent FromJson(string jsonString) } /// - /// Custom JSON converter for MultiChannelChannelListObjectContent + /// Custom JSON converter for MultiChannelChannelListRBMObjectAllOfContent /// - public class MultiChannelChannelListObjectContentJsonConverter : JsonConverter + public class MultiChannelChannelListRBMObjectAllOfContentJsonConverter : JsonConverter { /// /// To write the JSON string @@ -361,7 +269,7 @@ public class MultiChannelChannelListObjectContentJsonConverter : JsonConverter /// JSON Serializer public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - writer.WriteRawValue((string)(typeof(MultiChannelChannelListObjectContent).GetMethod("ToJson").Invoke(value, null))); + writer.WriteRawValue((string)(typeof(MultiChannelChannelListRBMObjectAllOfContent).GetMethod("ToJson").Invoke(value, null))); } /// @@ -377,9 +285,9 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist switch(reader.TokenType) { case JsonToken.StartObject: - return MultiChannelChannelListObjectContent.FromJson(JObject.Load(reader).ToString(Formatting.None)); + return MultiChannelChannelListRBMObjectAllOfContent.FromJson(JObject.Load(reader).ToString(Formatting.None)); case JsonToken.StartArray: - return MultiChannelChannelListObjectContent.FromJson(JArray.Load(reader).ToString(Formatting.None)); + return MultiChannelChannelListRBMObjectAllOfContent.FromJson(JArray.Load(reader).ToString(Formatting.None)); default: return null; } diff --git a/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMResponseObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMResponseObject.cs new file mode 100644 index 0000000..86257df --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListRBMResponseObject.cs @@ -0,0 +1,149 @@ +/* + * 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 +{ + /// + /// MultiChannelChannelListRBMResponseObject + /// + [DataContract(Name = "multiChannelChannelListRBMResponseObject")] + public partial class MultiChannelChannelListRBMResponseObject : IValidatableObject + { + + /// + /// Gets or Sets Channel + /// + [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelMessageChannelEnum Channel { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListRBMResponseObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. (required). + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). + /// channel (required). + /// content (required). + /// The Bandwidth senderId associated with the message. Identical to 'from'. (required). + public MultiChannelChannelListRBMResponseObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), MultiChannelChannelListRBMObjectAllOfContent content = default(MultiChannelChannelListRBMObjectAllOfContent), string owner = default(string)) + { + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for MultiChannelChannelListRBMResponseObject and cannot be null"); + } + this.From = from; + // to ensure "applicationId" is required (not null) + if (applicationId == null) + { + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListRBMResponseObject and cannot be null"); + } + this.ApplicationId = applicationId; + this.Channel = channel; + // to ensure "content" is required (not null) + if (content == null) + { + throw new ArgumentNullException("content is a required property for MultiChannelChannelListRBMResponseObject and cannot be null"); + } + this.Content = content; + // to ensure "owner" is required (not null) + if (owner == null) + { + throw new ArgumentNullException("owner is a required property for MultiChannelChannelListRBMResponseObject and cannot be null"); + } + this.Owner = owner; + } + + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// BandwidthRBM + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// 93de2206-9669-4e07-948d-329f4b722ee2 + [DataMember(Name = "applicationId", IsRequired = true, EmitDefaultValue = true)] + public string ApplicationId { get; set; } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelChannelListRBMObjectAllOfContent Content { get; set; } + + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + [DataMember(Name = "owner", IsRequired = true, EmitDefaultValue = true)] + public string Owner { 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 MultiChannelChannelListRBMResponseObject {\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); + sb.Append(" Channel: ").Append(Channel).Append("\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Owner: ").Append(Owner).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/MultiChannelChannelListRequestObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListRequestObject.cs new file mode 100644 index 0000000..f0d4a1c --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListRequestObject.cs @@ -0,0 +1,272 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Bandwidth.Standard.Model +{ + /// + /// MultiChannelChannelListRequestObject + /// + [JsonConverter(typeof(MultiChannelChannelListRequestObjectJsonConverter))] + [DataContract(Name = "multiChannelChannelListRequestObject")] + public partial class MultiChannelChannelListRequestObject : AbstractOpenAPISchema, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListRBMObject. + public MultiChannelChannelListRequestObject(MultiChannelChannelListRBMObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListSMSObject. + public MultiChannelChannelListRequestObject(MultiChannelChannelListSMSObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListMMSObject. + public MultiChannelChannelListRequestObject(MultiChannelChannelListMMSObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(MultiChannelChannelListMMSObject)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(MultiChannelChannelListRBMObject)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(MultiChannelChannelListSMSObject)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: MultiChannelChannelListMMSObject, MultiChannelChannelListRBMObject, MultiChannelChannelListSMSObject"); + } + } + } + + /// + /// Get the actual instance of `MultiChannelChannelListRBMObject`. If the actual instance is not `MultiChannelChannelListRBMObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListRBMObject + public MultiChannelChannelListRBMObject GetMultiChannelChannelListRBMObject() + { + return (MultiChannelChannelListRBMObject)ActualInstance; + } + + /// + /// Get the actual instance of `MultiChannelChannelListSMSObject`. If the actual instance is not `MultiChannelChannelListSMSObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListSMSObject + public MultiChannelChannelListSMSObject GetMultiChannelChannelListSMSObject() + { + return (MultiChannelChannelListSMSObject)ActualInstance; + } + + /// + /// Get the actual instance of `MultiChannelChannelListMMSObject`. If the actual instance is not `MultiChannelChannelListMMSObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListMMSObject + public MultiChannelChannelListMMSObject GetMultiChannelChannelListMMSObject() + { + return (MultiChannelChannelListMMSObject)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MultiChannelChannelListRequestObject {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, MultiChannelChannelListRequestObject.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of MultiChannelChannelListRequestObject + /// + /// JSON string + /// An instance of MultiChannelChannelListRequestObject + public static MultiChannelChannelListRequestObject FromJson(string jsonString) + { + MultiChannelChannelListRequestObject newMultiChannelChannelListRequestObject = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMultiChannelChannelListRequestObject; + } + + try + { + newMultiChannelChannelListRequestObject = new MultiChannelChannelListRequestObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRequestObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListRequestObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListMMSObject: {1}", jsonString, exception.ToString())); + } + + try + { + newMultiChannelChannelListRequestObject = new MultiChannelChannelListRequestObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRequestObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListRequestObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListRBMObject: {1}", jsonString, exception.ToString())); + } + + try + { + newMultiChannelChannelListRequestObject = new MultiChannelChannelListRequestObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListRequestObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListRequestObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListSMSObject: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for MultiChannelChannelListRequestObject + /// + public class MultiChannelChannelListRequestObjectJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(MultiChannelChannelListRequestObject).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return MultiChannelChannelListRequestObject.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return MultiChannelChannelListRequestObject.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/MultiChannelChannelListResponseObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListResponseObject.cs new file mode 100644 index 0000000..b61c966 --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListResponseObject.cs @@ -0,0 +1,272 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Bandwidth.Standard.Model +{ + /// + /// MultiChannelChannelListResponseObject + /// + [JsonConverter(typeof(MultiChannelChannelListResponseObjectJsonConverter))] + [DataContract(Name = "multiChannelChannelListResponseObject")] + public partial class MultiChannelChannelListResponseObject : AbstractOpenAPISchema, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListRBMResponseObject. + public MultiChannelChannelListResponseObject(MultiChannelChannelListRBMResponseObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListSMSResponseObject. + public MultiChannelChannelListResponseObject(MultiChannelChannelListSMSResponseObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MultiChannelChannelListMMSResponseObject. + public MultiChannelChannelListResponseObject(MultiChannelChannelListMMSResponseObject actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(MultiChannelChannelListMMSResponseObject)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(MultiChannelChannelListRBMResponseObject)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(MultiChannelChannelListSMSResponseObject)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: MultiChannelChannelListMMSResponseObject, MultiChannelChannelListRBMResponseObject, MultiChannelChannelListSMSResponseObject"); + } + } + } + + /// + /// Get the actual instance of `MultiChannelChannelListRBMResponseObject`. If the actual instance is not `MultiChannelChannelListRBMResponseObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListRBMResponseObject + public MultiChannelChannelListRBMResponseObject GetMultiChannelChannelListRBMResponseObject() + { + return (MultiChannelChannelListRBMResponseObject)ActualInstance; + } + + /// + /// Get the actual instance of `MultiChannelChannelListSMSResponseObject`. If the actual instance is not `MultiChannelChannelListSMSResponseObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListSMSResponseObject + public MultiChannelChannelListSMSResponseObject GetMultiChannelChannelListSMSResponseObject() + { + return (MultiChannelChannelListSMSResponseObject)ActualInstance; + } + + /// + /// Get the actual instance of `MultiChannelChannelListMMSResponseObject`. If the actual instance is not `MultiChannelChannelListMMSResponseObject`, + /// the InvalidClassException will be thrown + /// + /// An instance of MultiChannelChannelListMMSResponseObject + public MultiChannelChannelListMMSResponseObject GetMultiChannelChannelListMMSResponseObject() + { + return (MultiChannelChannelListMMSResponseObject)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MultiChannelChannelListResponseObject {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, MultiChannelChannelListResponseObject.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of MultiChannelChannelListResponseObject + /// + /// JSON string + /// An instance of MultiChannelChannelListResponseObject + public static MultiChannelChannelListResponseObject FromJson(string jsonString) + { + MultiChannelChannelListResponseObject newMultiChannelChannelListResponseObject = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMultiChannelChannelListResponseObject; + } + + try + { + newMultiChannelChannelListResponseObject = new MultiChannelChannelListResponseObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListResponseObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListResponseObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListMMSResponseObject: {1}", jsonString, exception.ToString())); + } + + try + { + newMultiChannelChannelListResponseObject = new MultiChannelChannelListResponseObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListResponseObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListResponseObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListRBMResponseObject: {1}", jsonString, exception.ToString())); + } + + try + { + newMultiChannelChannelListResponseObject = new MultiChannelChannelListResponseObject(JsonConvert.DeserializeObject(jsonString, MultiChannelChannelListResponseObject.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMultiChannelChannelListResponseObject; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MultiChannelChannelListSMSResponseObject: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for MultiChannelChannelListResponseObject + /// + public class MultiChannelChannelListResponseObjectJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(MultiChannelChannelListResponseObject).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return MultiChannelChannelListResponseObject.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return MultiChannelChannelListResponseObject.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/src/Bandwidth.Standard/Model/MultiChannelChannelListSMSObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListSMSObject.cs new file mode 100644 index 0000000..83943af --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListSMSObject.cs @@ -0,0 +1,134 @@ +/* + * 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 +{ + /// + /// MultiChannelChannelListSMSObject + /// + [DataContract(Name = "multiChannelChannelListSMSObject")] + public partial class MultiChannelChannelListSMSObject : IValidatableObject + { + + /// + /// Gets or Sets Channel + /// + [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelMessageChannelEnum Channel { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListSMSObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. (required). + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). + /// channel (required). + /// content (required). + public MultiChannelChannelListSMSObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), SmsMessageContent content = default(SmsMessageContent)) + { + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for MultiChannelChannelListSMSObject and cannot be null"); + } + this.From = from; + // to ensure "applicationId" is required (not null) + if (applicationId == null) + { + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListSMSObject and cannot be null"); + } + this.ApplicationId = applicationId; + this.Channel = channel; + // to ensure "content" is required (not null) + if (content == null) + { + throw new ArgumentNullException("content is a required property for MultiChannelChannelListSMSObject and cannot be null"); + } + this.Content = content; + } + + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// BandwidthRBM + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// 93de2206-9669-4e07-948d-329f4b722ee2 + [DataMember(Name = "applicationId", IsRequired = true, EmitDefaultValue = true)] + public string ApplicationId { get; set; } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] + public SmsMessageContent Content { 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 MultiChannelChannelListSMSObject {\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); + sb.Append(" Channel: ").Append(Channel).Append("\n"); + sb.Append(" Content: ").Append(Content).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/MultiChannelChannelListSMSResponseObject.cs b/src/Bandwidth.Standard/Model/MultiChannelChannelListSMSResponseObject.cs new file mode 100644 index 0000000..6992afc --- /dev/null +++ b/src/Bandwidth.Standard/Model/MultiChannelChannelListSMSResponseObject.cs @@ -0,0 +1,149 @@ +/* + * 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 +{ + /// + /// MultiChannelChannelListSMSResponseObject + /// + [DataContract(Name = "multiChannelChannelListSMSResponseObject")] + public partial class MultiChannelChannelListSMSResponseObject : IValidatableObject + { + + /// + /// Gets or Sets Channel + /// + [DataMember(Name = "channel", IsRequired = true, EmitDefaultValue = true)] + public MultiChannelMessageChannelEnum Channel { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultiChannelChannelListSMSResponseObject() { } + /// + /// Initializes a new instance of the class. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. (required). + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. (required). + /// channel (required). + /// content (required). + /// The Bandwidth senderId associated with the message. Identical to 'from'. (required). + public MultiChannelChannelListSMSResponseObject(string from = default(string), string applicationId = default(string), MultiChannelMessageChannelEnum channel = default(MultiChannelMessageChannelEnum), SmsMessageContent content = default(SmsMessageContent), string owner = default(string)) + { + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for MultiChannelChannelListSMSResponseObject and cannot be null"); + } + this.From = from; + // to ensure "applicationId" is required (not null) + if (applicationId == null) + { + throw new ArgumentNullException("applicationId is a required property for MultiChannelChannelListSMSResponseObject and cannot be null"); + } + this.ApplicationId = applicationId; + this.Channel = channel; + // to ensure "content" is required (not null) + if (content == null) + { + throw new ArgumentNullException("content is a required property for MultiChannelChannelListSMSResponseObject and cannot be null"); + } + this.Content = content; + // to ensure "owner" is required (not null) + if (owner == null) + { + throw new ArgumentNullException("owner is a required property for MultiChannelChannelListSMSResponseObject and cannot be null"); + } + this.Owner = owner; + } + + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// + /// The sender ID of the message. This could be an alphanumeric sender ID. + /// BandwidthRBM + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// + /// The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. + /// 93de2206-9669-4e07-948d-329f4b722ee2 + [DataMember(Name = "applicationId", IsRequired = true, EmitDefaultValue = true)] + public string ApplicationId { get; set; } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] + public SmsMessageContent Content { get; set; } + + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + /// + /// The Bandwidth senderId associated with the message. Identical to 'from'. + [DataMember(Name = "owner", IsRequired = true, EmitDefaultValue = true)] + public string Owner { 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 MultiChannelChannelListSMSResponseObject {\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); + sb.Append(" Channel: ").Append(Channel).Append("\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Owner: ").Append(Owner).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/MultiChannelMessageRequest.cs b/src/Bandwidth.Standard/Model/MultiChannelMessageRequest.cs index 04ce2fb..ff71f46 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelMessageRequest.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelMessageRequest.cs @@ -51,7 +51,7 @@ protected MultiChannelMessageRequest() { } /// A custom string that will be included in callback events of the message. Max 1024 characters.. /// priority. /// A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future.. - public MultiChannelMessageRequest(string to = default(string), List channelList = default(List), string tag = default(string), PriorityEnum? priority = default(PriorityEnum?), DateTime expiration = default(DateTime)) + public MultiChannelMessageRequest(string to = default(string), List channelList = default(List), string tag = default(string), PriorityEnum? priority = default(PriorityEnum?), DateTime expiration = default(DateTime)) { // to ensure "to" is required (not null) if (to == null) @@ -83,7 +83,7 @@ protected MultiChannelMessageRequest() { } /// /// A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. [DataMember(Name = "channelList", IsRequired = true, EmitDefaultValue = true)] - public List ChannelList { get; set; } + public List ChannelList { get; set; } /// /// A custom string that will be included in callback events of the message. Max 1024 characters. diff --git a/src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs b/src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs index 8329400..842857f 100644 --- a/src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs +++ b/src/Bandwidth.Standard/Model/MultiChannelMessageResponseData.cs @@ -60,7 +60,7 @@ protected MultiChannelMessageResponseData() { } /// A custom string that will be included in callback events of the message. Max 1024 characters.. /// priority. /// A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future.. - public MultiChannelMessageResponseData(string id = default(string), DateTime time = default(DateTime), MessageDirectionEnum direction = default(MessageDirectionEnum), List to = default(List), List channelList = default(List), string tag = default(string), PriorityEnum? priority = default(PriorityEnum?), DateTime expiration = default(DateTime)) + public MultiChannelMessageResponseData(string id = default(string), DateTime time = default(DateTime), MessageDirectionEnum direction = default(MessageDirectionEnum), List to = default(List), List channelList = default(List), string tag = default(string), PriorityEnum? priority = default(PriorityEnum?), DateTime expiration = default(DateTime)) { // to ensure "id" is required (not null) if (id == null) @@ -116,7 +116,7 @@ protected MultiChannelMessageResponseData() { } /// /// A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. [DataMember(Name = "channelList", IsRequired = true, EmitDefaultValue = true)] - public List ChannelList { get; set; } + public List ChannelList { get; set; } /// /// A custom string that will be included in callback events of the message. Max 1024 characters. diff --git a/src/Bandwidth.Standard/Model/RbmActionBase.cs b/src/Bandwidth.Standard/Model/RbmActionBase.cs index 4f27a66..9d7ac0e 100644 --- a/src/Bandwidth.Standard/Model/RbmActionBase.cs +++ b/src/Bandwidth.Standard/Model/RbmActionBase.cs @@ -78,7 +78,7 @@ protected RbmActionBase() { } /// Base64 payload the customer receives when the reply is clicked. /// /// Base64 payload the customer receives when the reply is clicked. - /// [B@4c3fcbe7 + /// [B@1942a36e [DataMember(Name = "postbackData", IsRequired = true, EmitDefaultValue = true)] public byte[] PostbackData { get; set; } diff --git a/src/Bandwidth.Standard/Model/RbmSuggestionResponse.cs b/src/Bandwidth.Standard/Model/RbmSuggestionResponse.cs index bf52477..72170cc 100644 --- a/src/Bandwidth.Standard/Model/RbmSuggestionResponse.cs +++ b/src/Bandwidth.Standard/Model/RbmSuggestionResponse.cs @@ -55,7 +55,7 @@ public partial class RbmSuggestionResponse : IValidatableObject /// Base64 payload the customer receives when the reply is clicked. /// /// Base64 payload the customer receives when the reply is clicked. - /// [B@4c3fcbe7 + /// [B@1942a36e [DataMember(Name = "postbackData", EmitDefaultValue = false)] public byte[] PostbackData { get; set; } From 6a71f949db9520b454f78182ca9c4082b771bffb Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Nov 2025 11:55:13 -0500 Subject: [PATCH 2/5] remove old test files --- ...ltiChannelChannelListObjectContentTests.cs | 113 ------------------ .../MultiChannelChannelListObjectTests.cs | 111 ----------------- ...essageResponseDataChannelListInnerTests.cs | 113 ------------------ 3 files changed, 337 deletions(-) delete mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectContentTests.cs delete mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectTests.cs delete mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataChannelListInnerTests.cs diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectContentTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectContentTests.cs deleted file mode 100644 index 19f79db..0000000 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectContentTests.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 MultiChannelChannelListObjectContent - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MultiChannelChannelListObjectContentTests : IDisposable - { - private List suggestions; - private MultiChannelChannelListObjectContent instanceRbmMessageContentText; - private MultiChannelChannelListObjectContent instanceRbmMessageMedia; - private MultiChannelChannelListObjectContent instanceRbmMessageContentRichCard; - private MultiChannelChannelListObjectContent instanceSmsMessageContent; - private MultiChannelChannelListObjectContent instanceMmsMessageContent; - - public MultiChannelChannelListObjectContentTests() - { - suggestions = new List { - new MultiChannelAction(new RbmActionBase( - type: RbmActionTypeEnum.REPLY, - text: "Test", - postbackData: new byte[] { 1, 2, 3 } - )) - }; - - instanceRbmMessageContentText = new MultiChannelChannelListObjectContent(new RbmMessageContentText( - text: "Test message", - suggestions: suggestions - )); - instanceRbmMessageMedia = new MultiChannelChannelListObjectContent(new RbmMessageMedia( - media: new RbmMessageContentFile( - fileUrl: "https://test.url/", - thumbnailUrl: "https://test.url/" - ), - suggestions: suggestions - )); - instanceRbmMessageContentRichCard = new MultiChannelChannelListObjectContent(new RbmMessageContentRichCard( - new RbmStandaloneCard( - orientation: StandaloneCardOrientationEnum.VERTICAL, - thumbnailImageAlignment: ThumbnailAlignmentEnum.LEFT, - cardContent: new RbmCardContent( - title: "TestTitle", - description: "TestDescription", - media: new RbmCardContentMedia( - fileUrl: "https://test.url/", - thumbnailUrl: "https://test.url/", - height: RbmMediaHeightEnum.MEDIUM - ), - suggestions: suggestions - ), - suggestions: suggestions - ) - )); - instanceSmsMessageContent = new MultiChannelChannelListObjectContent(new SmsMessageContent( - text: "Test message" - )); - instanceMmsMessageContent = new MultiChannelChannelListObjectContent(new MmsMessageContent( - text: "Test message", - media: new List(){ - new MmsMessageContentFile(fileUrl: "https://test.url/") - } - )); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MultiChannelChannelListObjectContent - /// - [Fact] - public void MultiChannelChannelListObjectContentInstanceTest() - { - Assert.IsType(instanceRbmMessageContentText); - Assert.IsType(instanceRbmMessageContentText.ActualInstance); - Assert.IsType(instanceRbmMessageMedia); - Assert.IsType(instanceRbmMessageMedia.ActualInstance); - Assert.IsType(instanceRbmMessageContentRichCard); - Assert.IsType(instanceRbmMessageContentRichCard.ActualInstance); - Assert.IsType(instanceSmsMessageContent); - Assert.IsType(instanceSmsMessageContent.ActualInstance); - Assert.IsType(instanceMmsMessageContent); - Assert.IsType(instanceMmsMessageContent.ActualInstance); - } - } -} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectTests.cs deleted file mode 100644 index 6505188..0000000 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectTests.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 MultiChannelChannelListObject - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MultiChannelChannelListObjectTests : IDisposable - { - private MultiChannelChannelListObject instance; - - public MultiChannelChannelListObjectTests() - { - instance = new MultiChannelChannelListObject( - from: "TestFrom", - applicationId: "TestApplicationId", - channel: MultiChannelMessageChannelEnum.SMS, - content: new MultiChannelChannelListObjectContent(new RbmMessageMedia( - media: new RbmMessageContentFile( - fileUrl: "https://test.url/", - thumbnailUrl: "https://test.url/" - ), - suggestions: new List(){ - new MultiChannelAction(new RbmActionBase( - type: RbmActionTypeEnum.REPLY, - text: "Test", - postbackData: new byte[] { 1, 2, 3 } - )) - } - )) - ); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MultiChannelChannelListObject - /// - [Fact] - public void MultiChannelChannelListObjectInstanceTest() - { - Assert.IsType(instance); - } - - /// - /// Test the property 'From' - /// - [Fact] - public void FromTest() - { - Assert.IsType(instance.From); - Assert.Equal("TestFrom", instance.From); - } - - /// - /// Test the property 'ApplicationId' - /// - [Fact] - public void ApplicationIdTest() - { - Assert.IsType(instance.ApplicationId); - Assert.Equal("TestApplicationId", instance.ApplicationId); - } - - /// - /// Test the property 'Channel' - /// - [Fact] - public void ChannelTest() - { - Assert.IsType(instance.Channel); - Assert.Equal(MultiChannelMessageChannelEnum.SMS, instance.Channel); - } - - /// - /// Test the property 'Content' - /// - [Fact] - public void ContentTest() - { - Assert.IsType(instance.Content); - } - } -} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataChannelListInnerTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataChannelListInnerTests.cs deleted file mode 100644 index 728241b..0000000 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataChannelListInnerTests.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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.Model -{ - /// - /// Class for testing MultiChannelMessageResponseDataChannelListInner - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MultiChannelMessageResponseDataChannelListInnerTests : IDisposable - { - private MultiChannelMessageResponseDataChannelListInner instance; - - public MultiChannelMessageResponseDataChannelListInnerTests() - { - instance = new MultiChannelMessageResponseDataChannelListInner( - from: "1234567890", - applicationId: "app-1234567890", - channel: MultiChannelMessageChannelEnum.SMS, - content: new MultiChannelChannelListObjectContent( - new SmsMessageContent(text: "Test message") - ), - owner: "owner-1234567890" - ); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MultiChannelMessageResponseDataChannelListInner - /// - [Fact] - public void MultiChannelMessageResponseDataChannelListInnerInstanceTest() - { - Assert.IsType(instance); - } - - /// - /// Test the property 'From' - /// - [Fact] - public void FromTest() - { - Assert.IsType(instance.From); - Assert.Equal("1234567890", instance.From); - } - - /// - /// Test the property 'ApplicationId' - /// - [Fact] - public void ApplicationIdTest() - { - Assert.IsType(instance.ApplicationId); - Assert.Equal("app-1234567890", instance.ApplicationId); - } - - /// - /// Test the property 'Channel' - /// - [Fact] - public void ChannelTest() - { - Assert.IsType(instance.Channel); - Assert.Equal(MultiChannelMessageChannelEnum.SMS, instance.Channel); - } - - /// - /// Test the property 'Content' - /// - [Fact] - public void ContentTest() - { - Assert.IsType(instance.Content); - Assert.IsType(instance.Content.ActualInstance); - } - - /// - /// Test the property 'Owner' - /// - [Fact] - public void OwnerTest() - { - Assert.IsType(instance.Owner); - Assert.Equal("owner-1234567890", instance.Owner); - } - } -} From 99181a20e241e97673719b16d38cfe1f7dd755f8 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Nov 2025 12:06:36 -0500 Subject: [PATCH 3/5] namespaces --- .../Unit/Model/AsyncLookupRequestTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/BlockedWebhookTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/CallbackTests.cs | 2 +- .../Unit/Model/CompletedLookupStatusEnumTests.cs | 2 +- .../Unit/Model/CreateAsyncBulkLookupResponseDataTests.cs | 2 +- .../Unit/Model/CreateAsyncBulkLookupResponseTests.cs | 2 +- .../Unit/Model/CreateSyncLookupResponseDataTests.cs | 2 +- .../Unit/Model/CreateSyncLookupResponseTests.cs | 2 +- .../Unit/Model/DeactivationEventEnumTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/ErrorSourceTests.cs | 2 +- .../Unit/Model/GetAsyncBulkLookupResponseDataTests.cs | 2 +- .../Unit/Model/GetAsyncBulkLookupResponseTests.cs | 2 +- .../Unit/Model/InProgressLookupStatusEnumTests.cs | 2 +- .../Unit/Model/InboundCallbackMessageTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTests.cs | 2 +- .../Unit/Model/InboundCallbackTypeEnumTests.cs | 2 +- .../Unit/Model/LatestMessageDeliveryStatusEnumTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/LineTypeEnumTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/LinkSchemaTests.cs | 2 +- .../Unit/Model/LookupErrorResponseTests.cs | 2 +- .../Unit/Model/LookupErrorSchemaMetaTests.cs | 2 +- .../Unit/Model/LookupErrorSchemaTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/LookupResultTests.cs | 2 +- .../Unit/Model/StatusCallbackMessageTests.cs | 2 +- src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTests.cs | 2 +- .../Unit/Model/StatusCallbackTypeEnumTests.cs | 2 +- .../Unit/Model/SyncLookupRequestTests.cs | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Bandwidth.Standard.Test/Unit/Model/AsyncLookupRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/AsyncLookupRequestTests.cs index 5418ed1..4330ace 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/AsyncLookupRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/AsyncLookupRequestTests.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 AsyncLookupRequest diff --git a/src/Bandwidth.Standard.Test/Unit/Model/BlockedWebhookTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/BlockedWebhookTests.cs index 62903f6..b9efe96 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/BlockedWebhookTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/BlockedWebhookTests.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 BlockedWebhook diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CallbackTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CallbackTests.cs index 9dedcc1..d90f331 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CallbackTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CallbackTests.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 Callback diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CompletedLookupStatusEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CompletedLookupStatusEnumTests.cs index 4d458e5..8c78ed2 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CompletedLookupStatusEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CompletedLookupStatusEnumTests.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 CompletedLookupStatusEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseDataTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseDataTests.cs index 0031599..47b1e09 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseDataTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseDataTests.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 CreateAsyncBulkLookupResponseData diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseTests.cs index 209356e..7da7610 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateAsyncBulkLookupResponseTests.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 CreateAsyncBulkLookupResponse diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs index 2fab7fa..d370ec9 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.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 CreateSyncLookupResponseData diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseTests.cs index 9eab6a4..406e919 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseTests.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 CreateSyncLookupResponse diff --git a/src/Bandwidth.Standard.Test/Unit/Model/DeactivationEventEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/DeactivationEventEnumTests.cs index c9dd70d..06c4fa9 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/DeactivationEventEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/DeactivationEventEnumTests.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 DeactivationEventEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/ErrorSourceTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/ErrorSourceTests.cs index 92b04da..1cb1d36 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/ErrorSourceTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/ErrorSourceTests.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 ErrorSource diff --git a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseDataTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseDataTests.cs index fa79609..1f20302 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseDataTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseDataTests.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 GetAsyncBulkLookupResponseData diff --git a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs index 4133792..90666c7 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.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 GetAsyncBulkLookupResponse diff --git a/src/Bandwidth.Standard.Test/Unit/Model/InProgressLookupStatusEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/InProgressLookupStatusEnumTests.cs index 76208be..88e1850 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/InProgressLookupStatusEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/InProgressLookupStatusEnumTests.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 InProgressLookupStatusEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackMessageTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackMessageTests.cs index a1d9d19..2019173 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackMessageTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackMessageTests.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 InboundCallbackMessage diff --git a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTests.cs index cc2ba26..44972e8 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTests.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 InboundCallback diff --git a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTypeEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTypeEnumTests.cs index a3b300d..01a8c5b 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTypeEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/InboundCallbackTypeEnumTests.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 InboundCallbackTypeEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LatestMessageDeliveryStatusEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LatestMessageDeliveryStatusEnumTests.cs index 086038d..3caab11 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LatestMessageDeliveryStatusEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LatestMessageDeliveryStatusEnumTests.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 LatestMessageDeliveryStatusEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LineTypeEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LineTypeEnumTests.cs index 073d35d..5aaa35b 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LineTypeEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LineTypeEnumTests.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 LineTypeEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LinkSchemaTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LinkSchemaTests.cs index d2bd42e..b6990c7 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LinkSchemaTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LinkSchemaTests.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 LinkSchema diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorResponseTests.cs index de49500..ca23cfa 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorResponseTests.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 LookupErrorResponse diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaMetaTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaMetaTests.cs index a7693db..86f5e42 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaMetaTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaMetaTests.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 LookupErrorSchemaMeta diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaTests.cs index 82eb89a..973abcc 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LookupErrorSchemaTests.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 LookupErrorSchema diff --git a/src/Bandwidth.Standard.Test/Unit/Model/LookupResultTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/LookupResultTests.cs index 2eb4221..5d11a44 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/LookupResultTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/LookupResultTests.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 LookupResult diff --git a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackMessageTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackMessageTests.cs index 032b753..df82eb4 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackMessageTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackMessageTests.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 StatusCallbackMessage diff --git a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTests.cs index 9a187b1..a59f652 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTests.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 StatusCallback diff --git a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTypeEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTypeEnumTests.cs index 23e303b..12fb541 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTypeEnumTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/StatusCallbackTypeEnumTests.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 StatusCallbackTypeEnum diff --git a/src/Bandwidth.Standard.Test/Unit/Model/SyncLookupRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/SyncLookupRequestTests.cs index d2731e4..f318387 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/SyncLookupRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/SyncLookupRequestTests.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 SyncLookupRequest From 550d4fea67dc3467ccd4c35e997666c8e85875f0 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Nov 2025 12:47:02 -0500 Subject: [PATCH 4/5] mode unit tests --- .../CreateMultiChannelMessageResponseTests.cs | 42 ++++++- .../CreateSyncLookupResponseDataTests.cs | 2 +- .../Model/GetAsyncBulkLookupResponseTests.cs | 8 +- .../Unit/Model/MmsMessageContentFileTests.cs | 2 +- .../MultiChannelChannelListMMSObjectTests.cs | 99 +++++++++++++++ ...hannelChannelListMMSResponseObjectTests.cs | 110 +++++++++++++++++ .../MultiChannelChannelListObjectBaseTests.cs | 89 ++++++++++++++ ...MultiChannelChannelListOwnerObjectTests.cs | 67 ++++++++++ ...elChannelListRBMObjectAllOfContentTests.cs | 97 +++++++++++++++ .../MultiChannelChannelListRBMObjectTests.cs | 104 ++++++++++++++++ ...hannelChannelListRBMResponseObjectTests.cs | 115 ++++++++++++++++++ ...ltiChannelChannelListRequestObjectTests.cs | 92 ++++++++++++++ ...tiChannelChannelListResponseObjectTests.cs | 95 +++++++++++++++ .../MultiChannelChannelListSMSObjectTests.cs | 101 +++++++++++++++ ...hannelChannelListSMSResponseObjectTests.cs | 112 +++++++++++++++++ .../Unit/Model/MultiChannelErrorTests.cs | 18 ++- .../Model/MultiChannelMessageContentTests.cs | 4 +- .../Model/MultiChannelMessageRequestTests.cs | 4 +- .../MultiChannelMessageResponseDataTests.cs | 6 +- .../Unit/Model/RbmLocationResponseTests.cs | 2 +- .../Unit/Model/RbmSuggestionResponseTests.cs | 2 +- 21 files changed, 1150 insertions(+), 21 deletions(-) create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSResponseObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectBaseTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListOwnerObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectAllOfContentTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMResponseObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRequestObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListResponseObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSObjectTests.cs create mode 100644 src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSResponseObjectTests.cs diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateMultiChannelMessageResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateMultiChannelMessageResponseTests.cs index 4286106..b208a57 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateMultiChannelMessageResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateMultiChannelMessageResponseTests.cs @@ -32,10 +32,41 @@ namespace Bandwidth.Standard.Test.Unit.Model public class CreateMultiChannelMessageResponseTests : IDisposable { private CreateMultiChannelMessageResponse instance; + private List links; + private MultiChannelMessageResponseData data; + private List errors; + public CreateMultiChannelMessageResponseTests() { - instance = new CreateMultiChannelMessageResponse(); + links = new List { new Link() }; + data = new MultiChannelMessageResponseData( + id: "msg-1234567890", + time: DateTime.Now, + direction: MessageDirectionEnum.In, + to: new List { "+15551234567" }, + channelList: new List{}, + tag: "test-tag", + priority: PriorityEnum.Default, + expiration: DateTime.UtcNow.AddHours(1) + ); + errors = new List { + new ErrorObject( + type: "TestType", + description: "TestDescription", + source: new ErrorSource( + varParameter: "TestParameter", + field: "TestField", + header: "TestHeader", + reference: "TestReference" + ) + ) + }; + instance = new CreateMultiChannelMessageResponse( + links: links, + data: data, + errors: errors + ); } public void Dispose() @@ -58,7 +89,8 @@ public void CreateMultiChannelMessageResponseInstanceTest() [Fact] public void LinksTest() { - // TODO unit test for the property 'Links' + Assert.IsType>(instance.Links); + Assert.Equal(links, instance.Links); } /// @@ -67,7 +99,8 @@ public void LinksTest() [Fact] public void DataTest() { - // TODO unit test for the property 'Data' + Assert.IsType(instance.Data); + Assert.Equal(data, instance.Data); } /// @@ -76,7 +109,8 @@ public void DataTest() [Fact] public void ErrorsTest() { - // TODO unit test for the property 'Errors' + Assert.IsType>(instance.Errors); + Assert.Equal(errors, instance.Errors); } } } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs index d370ec9..9fc1059 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateSyncLookupResponseDataTests.cs @@ -87,7 +87,7 @@ public void RequestIdTest() [Fact] public void StatusTest() { - Assert.IsType(instance.Status); + Assert.IsType(instance.Status); Assert.Equal(CompletedLookupStatusEnum.COMPLETE, instance.Status); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs index 90666c7..f994cb7 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/GetAsyncBulkLookupResponseTests.cs @@ -63,7 +63,11 @@ public GetAsyncBulkLookupResponseTests() errors = new List { new LookupErrorSchema(code: "1234", description: "Bad Request") }; - instance = new GetAsyncBulkLookupResponse(); + instance = new GetAsyncBulkLookupResponse( + links: links, + data: data, + errors: errors + ); } public void Dispose() @@ -96,7 +100,7 @@ public void LinksTest() [Fact] public void DataTest() { - Assert.IsType(instance.Data); + Assert.IsType(instance.Data); Assert.Equal(data, instance.Data); } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MmsMessageContentFileTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MmsMessageContentFileTests.cs index 5d9c89f..8ecd00c 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MmsMessageContentFileTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MmsMessageContentFileTests.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 MmsMessageContentFile diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSObjectTests.cs new file mode 100644 index 0000000..2ec48f7 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSObjectTests.cs @@ -0,0 +1,99 @@ +/* + * 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 MultiChannelChannelListMMSObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListMMSObjectTests : IDisposable + { + private MultiChannelChannelListMMSObject instance; + + public MultiChannelChannelListMMSObjectTests() + { + instance = new MultiChannelChannelListMMSObject( + from: "TestFrom", + applicationId: "TestApplicationId", + channel: MultiChannelMessageChannelEnum.MMS, + content: new MmsMessageContent() + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListMMSObject + /// + [Fact] + public void MultiChannelChannelListMMSObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("TestFrom", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("TestApplicationId", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.MMS, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSResponseObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSResponseObjectTests.cs new file mode 100644 index 0000000..af68f33 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListMMSResponseObjectTests.cs @@ -0,0 +1,110 @@ +/* + * 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 MultiChannelChannelListMMSResponseObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListMMSResponseObjectTests : IDisposable + { + private MultiChannelChannelListMMSResponseObject instance; + + public MultiChannelChannelListMMSResponseObjectTests() + { + instance = new MultiChannelChannelListMMSResponseObject( + from: "TestFrom", + applicationId: "TestApplicationId", + channel: MultiChannelMessageChannelEnum.MMS, + content: new MmsMessageContent(), + owner: "TestOwner" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListMMSResponseObject + /// + [Fact] + public void MultiChannelChannelListMMSResponseObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("TestFrom", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("TestApplicationId", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.MMS, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + + /// + /// Test the property 'Owner' + /// + [Fact] + public void OwnerTest() + { + Assert.IsType(instance.Owner); + Assert.Equal("TestOwner", instance.Owner); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectBaseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectBaseTests.cs new file mode 100644 index 0000000..2b7edbc --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListObjectBaseTests.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 MultiChannelChannelListObjectBase + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListObjectBaseTests : IDisposable + { + private MultiChannelChannelListObjectBase instance; + + public MultiChannelChannelListObjectBaseTests() + { + instance = new MultiChannelChannelListObjectBase( + from: "TestFrom", + applicationId: "TestApplicationId", + channel: MultiChannelMessageChannelEnum.SMS + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListObjectBase + /// + [Fact] + public void MultiChannelChannelListObjectBaseInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("TestFrom", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("TestApplicationId", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.SMS, instance.Channel); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListOwnerObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListOwnerObjectTests.cs new file mode 100644 index 0000000..d9b69f2 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListOwnerObjectTests.cs @@ -0,0 +1,67 @@ +/* + * 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 MultiChannelChannelListOwnerObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListOwnerObjectTests : IDisposable + { + private MultiChannelChannelListOwnerObject instance; + + public MultiChannelChannelListOwnerObjectTests() + { + instance = new MultiChannelChannelListOwnerObject( + owner: "TestOwner" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListOwnerObject + /// + [Fact] + public void MultiChannelChannelListOwnerObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'Owner' + /// + [Fact] + public void OwnerTest() + { + Assert.IsType(instance.Owner); + Assert.Equal("TestOwner", instance.Owner); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectAllOfContentTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectAllOfContentTests.cs new file mode 100644 index 0000000..f7de1ee --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectAllOfContentTests.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 MultiChannelChannelListRBMObjectAllOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListRBMObjectAllOfContentTests : IDisposable + { + private MultiChannelChannelListRBMObjectAllOfContent instanceText; + private MultiChannelChannelListRBMObjectAllOfContent instanceMedia; + private MultiChannelChannelListRBMObjectAllOfContent instanceRich; + private RbmCardContent cardContent; + private List suggestions; + + public MultiChannelChannelListRBMObjectAllOfContentTests() + { + suggestions = new List(); + + cardContent = new RbmCardContent( + title: "TestTitle", + description: "TestDescription", + media: new RbmCardContentMedia( + fileUrl: "https://test.url/", + thumbnailUrl: "https://test.url/", + height: RbmMediaHeightEnum.MEDIUM + ), + suggestions: suggestions + ); + + instanceText = new MultiChannelChannelListRBMObjectAllOfContent(new RbmMessageContentText( + text: "Test message", + suggestions: suggestions + )); + + instanceMedia = new MultiChannelChannelListRBMObjectAllOfContent(new RbmMessageMedia( + media: new RbmMessageContentFile( + fileUrl: "https://test.url/", + thumbnailUrl: "https://test.url/" + ), + suggestions: suggestions + )); + + instanceRich = new MultiChannelChannelListRBMObjectAllOfContent(new RbmMessageContentRichCard( + new RbmStandaloneCard( + orientation: StandaloneCardOrientationEnum.VERTICAL, + thumbnailImageAlignment: ThumbnailAlignmentEnum.LEFT, + cardContent: cardContent, + suggestions: suggestions + ) + )); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListRBMObjectAllOfContent + /// + [Fact] + public void MultiChannelChannelListRBMObjectAllOfContentInstanceTest() + { + Assert.IsType(instanceText); + Assert.IsType(instanceText.ActualInstance); + Assert.IsType(instanceMedia); + Assert.IsType(instanceMedia.ActualInstance); + Assert.IsType(instanceRich); + Assert.IsType(instanceRich.ActualInstance); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectTests.cs new file mode 100644 index 0000000..31ba8c4 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMObjectTests.cs @@ -0,0 +1,104 @@ +/* + * 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 MultiChannelChannelListRBMObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListRBMObjectTests : IDisposable + { + private MultiChannelChannelListRBMObject instance; + + public MultiChannelChannelListRBMObjectTests() + { + instance = new MultiChannelChannelListRBMObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.RBM, + content: new MultiChannelChannelListRBMObjectAllOfContent( + new RbmMessageContentText( + text: "Test RBM message", + suggestions: new List() + ) + ) + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListRBMObject + /// + [Fact] + public void MultiChannelChannelListRBMObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("1234567890", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("app-1234", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.RBM, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMResponseObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMResponseObjectTests.cs new file mode 100644 index 0000000..b33aa52 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRBMResponseObjectTests.cs @@ -0,0 +1,115 @@ +/* + * 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 MultiChannelChannelListRBMResponseObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListRBMResponseObjectTests : IDisposable + { + private MultiChannelChannelListRBMResponseObject instance; + + public MultiChannelChannelListRBMResponseObjectTests() + { + instance = new MultiChannelChannelListRBMResponseObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.RBM, + content: new MultiChannelChannelListRBMObjectAllOfContent( + new RbmMessageContentText( + text: "Test message", + suggestions: new List() + ) + ), + owner: "TestOwner" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListRBMResponseObject + /// + [Fact] + public void MultiChannelChannelListRBMResponseObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("1234567890", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("app-1234", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.RBM, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + + /// + /// Test the property 'Owner' + /// + [Fact] + public void OwnerTest() + { + Assert.IsType(instance.Owner); + Assert.Equal("TestOwner", instance.Owner); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRequestObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRequestObjectTests.cs new file mode 100644 index 0000000..daadb3f --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListRequestObjectTests.cs @@ -0,0 +1,92 @@ +/* + * 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 MultiChannelChannelListRequestObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListRequestObjectTests : IDisposable + { + private MultiChannelChannelListRequestObject instanceSms; + private MultiChannelChannelListRequestObject instanceMms; + private MultiChannelChannelListRequestObject instanceRbm; + + public MultiChannelChannelListRequestObjectTests() + { + instanceSms = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListSMSObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.SMS, + content: new SmsMessageContent( + text: "Test SMS message" + ) + ) + ); + instanceMms = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListMMSObject( + from: "TestFrom", + applicationId: "TestApplicationId", + channel: MultiChannelMessageChannelEnum.MMS, + content: new MmsMessageContent() + ) + ); + instanceRbm = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListRBMObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.RBM, + content: new MultiChannelChannelListRBMObjectAllOfContent( + new RbmMessageContentText( + text: "Test RBM message", + suggestions: new List() + ) + ) + ) + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListRequestObject + /// + [Fact] + public void MultiChannelChannelListRequestObjectInstanceTest() + { + Assert.IsType(instanceSms); + Assert.IsType(instanceSms.ActualInstance); + Assert.IsType(instanceMms); + Assert.IsType(instanceMms.ActualInstance); + Assert.IsType(instanceRbm); + Assert.IsType(instanceRbm.ActualInstance); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListResponseObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListResponseObjectTests.cs new file mode 100644 index 0000000..b364bde --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListResponseObjectTests.cs @@ -0,0 +1,95 @@ +/* + * 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 MultiChannelChannelListResponseObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListResponseObjectTests : IDisposable + { + private MultiChannelChannelListResponseObject instanceSms; + private MultiChannelChannelListResponseObject instanceMms; + private MultiChannelChannelListResponseObject instanceRbm; + + public MultiChannelChannelListResponseObjectTests() + { + instanceSms = new MultiChannelChannelListResponseObject( + new MultiChannelChannelListSMSResponseObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.SMS, + content: new SmsMessageContent( + text: "Test SMS message" + ), + owner: "owner-5678" + ) + ); + instanceMms = new MultiChannelChannelListResponseObject( + new MultiChannelChannelListMMSResponseObject( + from: "TestFrom", + applicationId: "TestApplicationId", + channel: MultiChannelMessageChannelEnum.MMS, + content: new MmsMessageContent(), + owner: "TestOwner" + ) + ); + instanceRbm = new MultiChannelChannelListResponseObject( + new MultiChannelChannelListRBMResponseObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.RBM, + content: new MultiChannelChannelListRBMObjectAllOfContent( + new RbmMessageContentText( + text: "Test message", + suggestions: new List() + ) + ), + owner: "TestOwner" + ) + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListResponseObject + /// + [Fact] + public void MultiChannelChannelListResponseObjectInstanceTest() + { + Assert.IsType(instanceSms); + Assert.IsType(instanceSms.ActualInstance); + Assert.IsType(instanceMms); + Assert.IsType(instanceMms.ActualInstance); + Assert.IsType(instanceRbm); + Assert.IsType(instanceRbm.ActualInstance); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSObjectTests.cs new file mode 100644 index 0000000..dfdb137 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSObjectTests.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 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 MultiChannelChannelListSMSObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListSMSObjectTests : IDisposable + { + private MultiChannelChannelListSMSObject instance; + + public MultiChannelChannelListSMSObjectTests() + { + instance = new MultiChannelChannelListSMSObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.SMS, + content: new SmsMessageContent( + text: "Test SMS message" + ) + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListSMSObject + /// + [Fact] + public void MultiChannelChannelListSMSObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("1234567890", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("app-1234", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.SMS, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSResponseObjectTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSResponseObjectTests.cs new file mode 100644 index 0000000..d45e3a2 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelChannelListSMSResponseObjectTests.cs @@ -0,0 +1,112 @@ +/* + * 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 MultiChannelChannelListSMSResponseObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultiChannelChannelListSMSResponseObjectTests : IDisposable + { + private MultiChannelChannelListSMSResponseObject instance; + + public MultiChannelChannelListSMSResponseObjectTests() + { + instance = new MultiChannelChannelListSMSResponseObject( + from: "1234567890", + applicationId: "app-1234", + channel: MultiChannelMessageChannelEnum.SMS, + content: new SmsMessageContent( + text: "Test SMS message" + ), + owner: "owner-5678" + ); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultiChannelChannelListSMSResponseObject + /// + [Fact] + public void MultiChannelChannelListSMSResponseObjectInstanceTest() + { + Assert.IsType(instance); + } + + /// + /// Test the property 'From' + /// + [Fact] + public void FromTest() + { + Assert.IsType(instance.From); + Assert.Equal("1234567890", instance.From); + } + + /// + /// Test the property 'ApplicationId' + /// + [Fact] + public void ApplicationIdTest() + { + Assert.IsType(instance.ApplicationId); + Assert.Equal("app-1234", instance.ApplicationId); + } + + /// + /// Test the property 'Channel' + /// + [Fact] + public void ChannelTest() + { + Assert.IsType(instance.Channel); + Assert.Equal(MultiChannelMessageChannelEnum.SMS, instance.Channel); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + Assert.IsType(instance.Content); + } + + /// + /// Test the property 'Owner' + /// + [Fact] + public void OwnerTest() + { + Assert.IsType(instance.Owner); + Assert.Equal("owner-5678", instance.Owner); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelErrorTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelErrorTests.cs index e3771d0..0a0b455 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelErrorTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelErrorTests.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 MultiChannelError @@ -36,10 +36,20 @@ public class MultiChannelErrorTests : IDisposable public MultiChannelErrorTests() { instance = new MultiChannelError( - links: new List(), + links: new List { new Link() }, data: new Dictionary(), - errors: new List() - ); + errors: new List { + new ErrorObject( + type: "TestType", + description: "TestDescription", + source: new ErrorSource( + varParameter: "TestParameter", + field: "TestField", + header: "TestHeader", + reference: "TestReference" + ) + ) + }); } public void Dispose() diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageContentTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageContentTests.cs index e47031a..38b3a0d 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageContentTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageContentTests.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 MultiChannelMessageContent @@ -73,7 +73,7 @@ public void TextTest() [Fact] public void MediaTest() { - Assert.IsType(instance.Media); + Assert.IsType(instance.Media); Assert.Equal("https://example.com/file.jpg", instance.Media.FileUrl); } } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageRequestTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageRequestTests.cs index a36751b..7bcae58 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageRequestTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageRequestTests.cs @@ -37,7 +37,7 @@ public MultiChannelMessageRequestTests() { instance = new MultiChannelMessageRequest( to: "TestTo", - channelList: new List(), + channelList: new List(), tag: "TestTag", priority: PriorityEnum.Default, expiration: new DateTime(2020, 1, 1) @@ -74,7 +74,7 @@ public void ToTest() [Fact] public void ChannelListTest() { - Assert.IsType>(instance.ChannelList); + Assert.IsType>(instance.ChannelList); } /// diff --git a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataTests.cs index b8afb93..a27dfac 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/MultiChannelMessageResponseDataTests.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 MultiChannelMessageResponseData @@ -40,7 +40,7 @@ public MultiChannelMessageResponseDataTests() time: DateTime.Now, direction: MessageDirectionEnum.In, to: new List { "+15551234567" }, - channelList: new List{}, + channelList: new List{}, tag: "test-tag", priority: PriorityEnum.Default, expiration: DateTime.UtcNow.AddHours(1) @@ -107,7 +107,7 @@ public void ToTest() [Fact] public void ChannelListTest() { - Assert.IsType>(instance.ChannelList); + Assert.IsType>(instance.ChannelList); } /// diff --git a/src/Bandwidth.Standard.Test/Unit/Model/RbmLocationResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/RbmLocationResponseTests.cs index 8e8defa..6bfb919 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/RbmLocationResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/RbmLocationResponseTests.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 RbmLocationResponse diff --git a/src/Bandwidth.Standard.Test/Unit/Model/RbmSuggestionResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/RbmSuggestionResponseTests.cs index 017de23..9d639f5 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/RbmSuggestionResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/RbmSuggestionResponseTests.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 RbmSuggestionResponse From 13bd0174770e3a8ab0c595b942bc7dd3cdef545d Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 18 Nov 2025 15:55:09 -0500 Subject: [PATCH 5/5] smoke tests --- .../Smoke/MultiChannelIntegrationTests.cs | 148 +++++++++++++++++- 1 file changed, 140 insertions(+), 8 deletions(-) diff --git a/src/Bandwidth.Standard.Test/Smoke/MultiChannelIntegrationTests.cs b/src/Bandwidth.Standard.Test/Smoke/MultiChannelIntegrationTests.cs index c470658..78f66c4 100644 --- a/src/Bandwidth.Standard.Test/Smoke/MultiChannelIntegrationTests.cs +++ b/src/Bandwidth.Standard.Test/Smoke/MultiChannelIntegrationTests.cs @@ -21,10 +21,14 @@ public class MultiChannelSmokeTests : IDisposable private MultiChannelApi instance; private string accountId; private Configuration configuration; + private string bwNumber; + private string messagingApplicationId; public MultiChannelSmokeTests() { accountId = Environment.GetEnvironmentVariable("BW_ACCOUNT_ID"); + bwNumber = Environment.GetEnvironmentVariable("BW_NUMBER"); + messagingApplicationId = Environment.GetEnvironmentVariable("BW_MESSAGING_APPLICATION_ID"); // Authorized API Client configuration = new Configuration(); @@ -48,16 +52,18 @@ public void InstanceTest() } /// - /// Test CreateMultiChannelMessage + /// Test CreateMultiChannelSMSMessage /// [Fact] - public void CreateMultiChannelMessageTest() + public void CreateMultiChannelSMSMessageTest() { - MultiChannelChannelListObject channelListObject = new MultiChannelChannelListObject( - from: Environment.GetEnvironmentVariable("BW_NUMBER"), - applicationId: Environment.GetEnvironmentVariable("BW_MESSAGING_APPLICATION_ID"), - channel: MultiChannelMessageChannelEnum.RBM, - content: new MultiChannelChannelListObjectContent(new RbmMessageContentText(text: "Hello World!")) + MultiChannelChannelListRequestObject channelListObject = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListSMSObject( + from: bwNumber, + applicationId: messagingApplicationId, + channel: MultiChannelMessageChannelEnum.SMS, + content: new SmsMessageContent(text: "Hello World!") + ) ); MultiChannelMessageRequest multiChannelMessageRequest = new MultiChannelMessageRequest( @@ -65,12 +71,138 @@ public void CreateMultiChannelMessageTest() tag: "tag", priority: PriorityEnum.High, expiration: DateTime.UtcNow.AddMinutes(1), - channelList: new List { channelListObject } + channelList: new List { channelListObject } ); var response = instance.CreateMultiChannelMessageWithHttpInfo(accountId, multiChannelMessageRequest); Assert.IsType>(response); Assert.Equal(HttpStatusCode.Accepted, response.StatusCode); + Assert.NotNull(response.Data); + Assert.IsType(response.Data); + Assert.IsType>(response.Data.Links); + Assert.IsType(response.Data.Data); + Assert.IsType(response.Data.Data.Id); + Assert.IsType(response.Data.Data.Time); + Assert.IsType(response.Data.Data.Direction); + Assert.Equal(response.Data.Data.Direction, MessageDirectionEnum.Out); + Assert.IsType>(response.Data.Data.To); + Assert.IsType(response.Data.Data.Tag); + Assert.IsType(response.Data.Data.Priority); + Assert.Equal(response.Data.Data.Priority, PriorityEnum.High); + Assert.IsType(response.Data.Data.Expiration); + Assert.IsType>(response.Data.Data.ChannelList); + + // Add more assertions when C# generator supports discriminator mapping + // Assert.IsType(response.Data.Data.ChannelList[0].ActualInstance); + } + + /// + /// Test CreateMultiChannelMMSMessage + /// + [Fact] + public void CreateMultiChannelMMSMessageTest() + { + MultiChannelChannelListRequestObject channelListObject = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListMMSObject( + from: bwNumber, + applicationId: messagingApplicationId, + channel: MultiChannelMessageChannelEnum.MMS, + content: new MmsMessageContent( + text: "Hello World!", + media: new List { + new MmsMessageContentFile( + fileUrl: "https://www.example.com/image.jpg" + ) + } + ) + ) + ); + + MultiChannelMessageRequest multiChannelMessageRequest = new MultiChannelMessageRequest( + to: Environment.GetEnvironmentVariable("USER_NUMBER"), + tag: "tag", + priority: PriorityEnum.High, + expiration: DateTime.UtcNow.AddMinutes(1), + channelList: new List { channelListObject } + ); + + var response = instance.CreateMultiChannelMessageWithHttpInfo(accountId, multiChannelMessageRequest); + Assert.IsType>(response); + Assert.Equal(HttpStatusCode.Accepted, response.StatusCode); + Assert.NotNull(response.Data); + Assert.IsType(response.Data); + Assert.IsType>(response.Data.Links); + Assert.IsType(response.Data.Data); + Assert.IsType(response.Data.Data.Id); + Assert.IsType(response.Data.Data.Time); + Assert.IsType(response.Data.Data.Direction); + Assert.Equal(response.Data.Data.Direction, MessageDirectionEnum.Out); + Assert.IsType>(response.Data.Data.To); + Assert.IsType(response.Data.Data.Tag); + Assert.IsType(response.Data.Data.Priority); + Assert.Equal(response.Data.Data.Priority, PriorityEnum.High); + Assert.IsType(response.Data.Data.Expiration); + Assert.IsType>(response.Data.Data.ChannelList); + + // Add more assertions when C# generator supports discriminator mapping + // Assert.IsType(response.Data.Data.ChannelList[0].ActualInstance); + } + + /// + /// Test CreateMultiChannelRBMMessage + /// + [Fact] + public void CreateMultiChannelRBMMessageTest() + { + MultiChannelChannelListRequestObject channelListObject = new MultiChannelChannelListRequestObject( + new MultiChannelChannelListRBMObject( + from: bwNumber, + applicationId: messagingApplicationId, + channel: MultiChannelMessageChannelEnum.RBM, + content: new MultiChannelChannelListRBMObjectAllOfContent( + new RbmMessageContentText( + text: "Hello World!", + suggestions: new List { + new MultiChannelAction(new RbmActionDial( + type: RbmActionTypeEnum.DIALPHONE, + text: "Call Us", + postbackData: new byte[]{1, 2, 3}, + phoneNumber: bwNumber + )) + } + ) + ) + ) + ); + + MultiChannelMessageRequest multiChannelMessageRequest = new MultiChannelMessageRequest( + to: Environment.GetEnvironmentVariable("USER_NUMBER"), + tag: "tag", + priority: PriorityEnum.High, + expiration: DateTime.UtcNow.AddMinutes(1), + channelList: new List { channelListObject } + ); + + var response = instance.CreateMultiChannelMessageWithHttpInfo(accountId, multiChannelMessageRequest); + Assert.IsType>(response); + Assert.Equal(HttpStatusCode.Accepted, response.StatusCode); + Assert.NotNull(response.Data); + Assert.IsType(response.Data); + Assert.IsType>(response.Data.Links); + Assert.IsType(response.Data.Data); + Assert.IsType(response.Data.Data.Id); + Assert.IsType(response.Data.Data.Time); + Assert.IsType(response.Data.Data.Direction); + Assert.Equal(response.Data.Data.Direction, MessageDirectionEnum.Out); + Assert.IsType>(response.Data.Data.To); + Assert.IsType(response.Data.Data.Tag); + Assert.IsType(response.Data.Data.Priority); + Assert.Equal(response.Data.Data.Priority, PriorityEnum.High); + Assert.IsType(response.Data.Data.Expiration); + Assert.IsType>(response.Data.Data.ChannelList); + + // Add more assertions when C# generator supports discriminator mapping + // Assert.IsType(response.Data.Data.ChannelList[0].ActualInstance); } } }