diff --git a/CHANGELOG.md b/CHANGELOG.md index 56cd44d4..8cb9cd62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm None + + +### Changed + +- Remove null values when serializing models to JSON + ## [5.1.1] - 2025-02-18 diff --git a/README.md b/README.md index d79bc591..c78b3406 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- SDK version: 5.1.1 +- SDK version: 5.1.2 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit [https://www.freeclimb.com/support/](https://www.freeclimb.com/support/) diff --git a/api/openapi.yaml b/api/openapi.yaml index 10555c78..0a66afa6 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -4929,6 +4929,7 @@ components: description: ID of the Conference to which to add the Participant (Call leg). Conference must exist or an error will result. type: string + x-is-required: true leaveConferenceUrl: description: 'URL to be invoked when the Participant leaves the Conference. ' format: uri @@ -4983,6 +4984,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true alias: description: 'Descriptive name for the Conference. ' type: boolean @@ -5042,6 +5044,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true notificationUrl: description: URL to be invoked when the call enters the queue. The request to the URL contains the standard request parameters.This is a notification @@ -5055,6 +5058,7 @@ components: \ not exist, it will be created. The ID must start with QU followed\ \ by 40 hex characters." type: string + x-is-required: true waitUrl: description: "A request is made to this URL when the Call leaves the Queue,\ \ which can occur if enqueue of the Call fails or when the call is dequeued\ @@ -5064,6 +5068,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true required: - actionUrl - queueId @@ -5091,6 +5096,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true digitTimeoutMs: description: " Maximum time in milliseconds that FreeClimb will wait for\ \ the Caller to press any digit after the last digit entered, before\ @@ -5164,12 +5170,14 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true grammarType: $ref: '#/components/schemas/GrammarType' grammarFile: description: "The grammar file to use for speech recognition. If grammarType\ \ is set to URL, this attribute is specified as a download URL." type: string + x-is-required: true grammarRule: description: The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` @@ -5268,6 +5276,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true callConnectUrl: description: URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial. @@ -5275,15 +5284,18 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true callingNumber: description: "he caller ID to show to the called party when FreeClimb\ \ calls. This can be one of the following: The To or From number provided\ \ in the first Webhook to your webserver. Any phone number you have\ \ purchased from FreeClimb." type: string + x-is-required: true destination: description: 'E.164 representation of the phone number to Call. ' type: string + x-is-required: true ifMachine: $ref: '#/components/schemas/IfMachine' ifMachineUrl: @@ -5340,6 +5352,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true actionUrl: description: "A request is made to this URL when the Call is resumed,\ \ which can occur if the Call is resumed via the Unpark command, the\ @@ -5350,6 +5363,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true notificationUrl: description: URL to be invoked when the Call is parked. The request to the URL contains the standard request parameters. @@ -5378,6 +5392,7 @@ components: description: Length in milliseconds. FreeClimb will wait silently before continuing on. type: integer + x-is-required: true required: - length type: object @@ -5395,6 +5410,7 @@ components: can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands. ' type: string + x-is-required: true loop: description: Number of times the audio file is played. Specifying '0' causes the Play action to loop until the Call is hung up. @@ -5424,6 +5440,7 @@ components: \ repeated requests for unchanged audio. If no Cache-Control header\ \ is provided, the file will be cached for seven days by default." type: string + x-is-required: true required: - file type: object @@ -5444,6 +5461,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true silenceTimeoutMs: description: Interval of silence that should elapse before ending the recording. @@ -5492,6 +5510,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true required: - actionUrl type: object @@ -5536,6 +5555,7 @@ components: \ of the string is limited to 4 KB (or 4,096 bytes). An empty string\ \ will cause the command to be skipped." type: string + x-is-required: true language: description: Language and (by implication) the locale to use. This implies the accent and pronunciations to be usde for the TTS. The complete list @@ -5569,6 +5589,7 @@ components: \ specification for delay or pause between the output of individual\ \ digits." type: string + x-is-required: true pauseMs: description: Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint. @@ -5628,13 +5649,16 @@ components: \ will be sent. Must be within FreeClimb's service area and E.164 formatting\ \ (e.g., +18003608245)." type: string + x-is-required: true from: description: E.164 representation of the phone number to use as the sender. This must be an incoming phone number you have purchased from FreeClimb. type: string + x-is-required: true text: description: Text contained in the message (maximum 160 characters). type: string + x-is-required: true notificationUrl: description: "When the message changes status, this URL will be invoked\ \ using HTTP POST with the messageStatus parameters. This is a notification\ @@ -5751,26 +5775,31 @@ components: voiceEnabled. nullable: true type: boolean + x-is-required: true sms: description: Indicates whether a number can be used SMS messaging. Replaces smsEnabled. nullable: true type: boolean + x-is-required: true tollFree: description: "Indicates that a number is toll-free and will make toll-free\ \ calls, and when enabled, toll-free messages." nullable: true type: boolean + x-is-required: true tenDLC: description: "Indicates that a number, if sms is true, will be used for\ \ 10DLC messaging" nullable: true type: boolean + x-is-required: true shortCode: description: Indicates that a number is a short code and can be used for short code messaging nullable: true type: boolean + x-is-required: true required: - shortCode - sms @@ -5788,6 +5817,7 @@ components: description: alphanumeric identifier for the TollFree campaign associated with this number type: string + x-is-required: true required: - campaignId type: object @@ -6323,6 +6353,7 @@ components: description: Phone number to purchase in E.164 format (as returned in the list of Available Phone Numbers). type: string + x-is-required: true alias: description: Description for this new incoming phone number (max 64 characters). type: string @@ -6454,9 +6485,11 @@ components: \ To or From number provided in FreeClimb's initial request to your app\ \ or (b) Any incoming phone number you have purchased from FreeClimb." type: string + x-is-required: true to: description: Phone number to place the Call to. type: string + x-is-required: true applicationId: description: "Required if no `parentCallId` or `callConnectUrl` has been\ \ provided. ID of the application FreeClimb should use to handle this\ @@ -6885,14 +6918,17 @@ components: description: Phone number to use as the sender. This must be an incoming phone number that you have purchased from FreeClimb. type: string + x-is-required: true to: description: Phone number to receive the message. Must be within FreeClimb's service area. type: string + x-is-required: true text: description: "Text contained in the message (maximum 160 characters).\ \ **Note:** For text, only ASCII characters are supported." type: string + x-is-required: true notificationUrl: description: "When the Message changes status, this URL is invoked using\ \ HTTP POST with the messageStatus parameters. **Note:** This is a\ @@ -6936,6 +6972,7 @@ components: description: Question to ask the Knowledge Base maxLength: 2000 type: string + x-is-required: true required: - query type: object @@ -6948,6 +6985,7 @@ components: response: description: The generative response from the KnowledgeBase type: string + x-is-required: true status: $ref: '#/components/schemas/CompletionResultStatus' required: @@ -7104,6 +7142,7 @@ components: description: ID of the account that created this participant. nullable: true type: string + x-is-required: true campaignId: description: TFNCampaignId example: cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a @@ -7111,18 +7150,24 @@ components: type: string useCase: type: string + x-is-required: true registrationStatus: $ref: '#/components/schemas/SMSTollFreeCampaignRegistrationStatus' dateCreated: type: string + x-is-required: true dateUpdated: type: string + x-is-required: true dateCreatedISO: type: string + x-is-required: true dateUpdatedISO: type: string + x-is-required: true revision: type: integer + x-is-required: true required: - accountId - campaignId @@ -7172,6 +7217,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true required: - statusCallbackUrl type: object @@ -7482,6 +7528,7 @@ components: description: The filter query for retrieving logs. See **Performance Query Language** below. type: string + x-is-required: true required: - pql type: object @@ -7615,9 +7662,11 @@ components: This identifier is required by the NetNumber OSR SMS enabling process of 10DLC. type: string + x-is-required: true cspId: description: Alphanumeric identifier of the CSP associated with this campaign. type: string + x-is-required: true resellerId: description: Alphanumeric identifier of the reseller that you want to associate with this campaign. @@ -7644,11 +7693,13 @@ components: description: Alphanumeric identifier of the brand associated with this campaign. maxLength: 8 type: string + x-is-required: true usecase: description: Campaign usecase. Must be of defined valid types. Use `/registry/enum/usecase` operation to retrieve usecases available for given brand. maxLength: 20 type: string + x-is-required: true subUsecases: description: Campaign sub-usecases. Must be of defined valid sub-usecase types. Use `/registry/enum/usecase` operation to retrieve list of valid @@ -7661,10 +7712,12 @@ components: type: array uniqueItems: true x-is-set: true + x-is-required: true description: description: Summary description of this campaign. maxLength: 4096 type: string + x-is-required: true embeddedLink: default: false description: Does message generated by the campaign include URL link in @@ -7774,6 +7827,7 @@ components: description: Campaign created from mock brand. Mocked campaign cannot be shared with an upstream CNP. type: boolean + x-is-required: true nextRenewalOrExpirationDate: description: When the campaign would be due for its next renew/bill date. example: 2000-01-01 @@ -7944,6 +7998,7 @@ components: This identifier is required by the NetNumber OSR SMS enabling process of 10DLC. type: string + x-is-required: true status: $ref: '#/components/schemas/SMSTenDLCPartnerCampaignStatus' createDate: @@ -7955,15 +8010,18 @@ components: description: Alphanumeric identifier of the brand associated with this campaign. maxLength: 8 type: string + x-is-required: true usecase: description: Campaign usecase. Must be of defined valid types. Use `/registry/enum/usecase` operation to retrieve usecases available for given brand. maxLength: 20 type: string + x-is-required: true description: description: Summary description of this campaign. maxLength: 4096 type: string + x-is-required: true embeddedLink: default: false description: Does message generated by the campaign include URL link in @@ -8106,10 +8164,12 @@ components: example: "+12024567890" maxLength: 20 type: string + x-is-required: true email: description: Valid email address of brand support contact. maxLength: 100 type: string + x-is-required: true website: description: Brand website URL. example: http://www.abcmobile.com @@ -8272,6 +8332,7 @@ components: example: ABC Mobile maxLength: 255 type: string + x-is-required: true companyName: description: (Required for Non-profit/private/public) Legal company name. example: ABC Inc. @@ -8293,6 +8354,7 @@ components: example: "+12024567890" maxLength: 20 type: string + x-is-required: true street: description: Street number and name. example: 123 6th Ave @@ -8318,10 +8380,12 @@ components: example: US maxLength: 2 type: string + x-is-required: true email: description: Valid email address of brand support contact. maxLength: 100 type: string + x-is-required: true stockSymbol: description: (Required for public company) stock symbol. example: ABC @@ -8344,6 +8408,7 @@ components: description: Vertical or industry segment of the brand. maxLength: 50 type: string + x-is-required: true altBusinessId: description: "Alternate business identifier such as DUNS, LEI, or GIIN" maxLength: 50 @@ -8371,6 +8436,7 @@ components: mock: description: Test brand. type: boolean + x-is-required: true identityStatus: $ref: '#/components/schemas/SMSTenDLCBrandIdentityStatus' createDate: @@ -8439,20 +8505,26 @@ components: description: ID of the account that created this toll-free campaign nullable: true type: string + x-is-required: true campaignId: description: Alphanumeric identifier used by the platform to identify this toll-free campaign type: string + x-is-required: true useCase: type: string + x-is-required: true registrationStatus: $ref: '#/components/schemas/SMSTollFreeCampaignRegistrationStatus' dateCreated: type: string + x-is-required: true dateUpdated: type: string + x-is-required: true revision: type: integer + x-is-required: true required: - accountId - campaignId @@ -8492,6 +8564,7 @@ components: type: string x-is-uri: true x-is-url: true + x-is-required: true playBeep: default: false type: boolean @@ -8542,14 +8615,17 @@ components: description: E.164 formatted phone number to which calls using this token will be made. type: string + x-is-required: true from: description: E.164 formatted phone number owned by the reqeusting account from which calls using this token will be made. type: string + x-is-required: true uses: description: number of times this token may be used for a WebRTC call minimum: 1 type: integer + x-is-required: true required: - from - to diff --git a/freeclimb.sln b/freeclimb.sln index 99ffd2d7..1ccbdfb4 100644 --- a/freeclimb.sln +++ b/freeclimb.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "freeclimb", "src\freeclimb\freeclimb.csproj", "{75EF5E96-F036-4274-BB32-E22B855616F5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "freeclimb", "src\freeclimb\freeclimb.csproj", "{A5B2E894-310E-480B-8F57-2B14776732A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "freeclimb.Test", "src\freeclimb.Test\freeclimb.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75EF5E96-F036-4274-BB32-E22B855616F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75EF5E96-F036-4274-BB32-E22B855616F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75EF5E96-F036-4274-BB32-E22B855616F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75EF5E96-F036-4274-BB32-E22B855616F5}.Release|Any CPU.Build.0 = Release|Any CPU + {A5B2E894-310E-480B-8F57-2B14776732A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5B2E894-310E-480B-8F57-2B14776732A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5B2E894-310E-480B-8F57-2B14776732A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5B2E894-310E-480B-8F57-2B14776732A0}.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/package.json b/package.json index a8336b05..6306e261 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,7 @@ { "dependencies": { - "@stoplight/prism-cli": "5.6.0", - "fast-xml-parser": "^4.5.0", + "@stoplight/prism-cli": "5.14.2", + "fast-xml-parser": "^5.2.5", "jsonpath-plus": "^10.3.0" - }, - "resolutions": { - "@stoplight/json": "3.20.0" } } diff --git a/src/freeclimb.Test/Model/AccountRequestTests.cs b/src/freeclimb.Test/Model/AccountRequestTests.cs index 9ec15df5..375893f0 100644 --- a/src/freeclimb.Test/Model/AccountRequestTests.cs +++ b/src/freeclimb.Test/Model/AccountRequestTests.cs @@ -77,5 +77,28 @@ public void LabelTest() instance.Label = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Label); } + + /// + /// Test serialize a AccountRequest to JSON string - all values are present + /// + [Fact] + public void AccountRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("alias", json); + + Assert.Contains("label", json); + } + + /// + /// Test serialize a AccountRequest to JSON string - null values are stripped + /// + [Fact] + public void AccountRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AccountResultTests.cs b/src/freeclimb.Test/Model/AccountResultTests.cs index 14970604..9b316453 100644 --- a/src/freeclimb.Test/Model/AccountResultTests.cs +++ b/src/freeclimb.Test/Model/AccountResultTests.cs @@ -183,5 +183,60 @@ public void SubresourceUrisTest() instance.SubresourceUris = testObject; Assert.Equal(testObject, instance.SubresourceUris); } + + /// + /// Test serialize a AccountResult to JSON string - all values are present + /// + [Fact] + public void AccountResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("accountId", json); + + Assert.Contains("apiKey", json); + + Assert.Contains("alias", json); + + Assert.Contains("label", json); + + Assert.Contains("type", json); + + Assert.Contains("status", json); + + Assert.Contains("subresourceUris", json); + } + + /// + /// Test serialize a AccountResult to JSON string - null values are stripped + /// + [Fact] + public void AccountResultSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.ApiKey = null; + + instance.Alias = null; + + instance.Label = null; + + instance.Type = null; + + instance.Status = null; + + instance.SubresourceUris = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AddToConferenceNotificationWebhookTests.cs b/src/freeclimb.Test/Model/AddToConferenceNotificationWebhookTests.cs index 06e8f78c..58546452 100644 --- a/src/freeclimb.Test/Model/AddToConferenceNotificationWebhookTests.cs +++ b/src/freeclimb.Test/Model/AddToConferenceNotificationWebhookTests.cs @@ -228,5 +228,58 @@ public void TestDeserializeJsonToAddToConferenceNotificationWebhook() Assert.IsType(deserialized); Assert.Equal("addToConferenceNotification", deserialized.RequestType); } + + /// + /// Test serialize a AddToConferenceNotificationWebhook to JSON string - all values are present + /// + [Fact] + public void AddToConferenceNotificationWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("status", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingDurationSec", json); + } + + /// + /// Test serialize a AddToConferenceNotificationWebhook to JSON string - null values are stripped + /// + [Fact] + public void AddToConferenceNotificationWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + instance.Status = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AddToConferenceTests.cs b/src/freeclimb.Test/Model/AddToConferenceTests.cs index e84d9137..6f723afa 100644 --- a/src/freeclimb.Test/Model/AddToConferenceTests.cs +++ b/src/freeclimb.Test/Model/AddToConferenceTests.cs @@ -165,5 +165,44 @@ public void DtmfPassThroughTest() instance.DtmfPassThrough = false; Assert.False(instance.DtmfPassThrough); } + + /// + /// Test serialize a AddToConference to JSON string - all values are present + /// + [Fact] + public void AddToConferenceSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("allowCallControl", json); + + Assert.Contains("callControlSequence", json); + + Assert.Contains("callControlUrl", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("leaveConferenceUrl", json); + + Assert.Contains("listen", json); + + Assert.Contains("notificationUrl", json); + + Assert.Contains("startConfOnEnter", json); + + Assert.Contains("talk", json); + + Assert.Contains("dtmfPassThrough", json); + } + + /// + /// Test serialize a AddToConference to JSON string - null values are stripped + /// + [Fact] + public void AddToConferenceSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AddToQueueNotificationWebhookTests.cs b/src/freeclimb.Test/Model/AddToQueueNotificationWebhookTests.cs index 4286d708..ab614845 100644 --- a/src/freeclimb.Test/Model/AddToQueueNotificationWebhookTests.cs +++ b/src/freeclimb.Test/Model/AddToQueueNotificationWebhookTests.cs @@ -179,5 +179,48 @@ public void TestDeserializeJsonToAddToQueueNotificationWebhook() Assert.IsType(deserialized); Assert.Equal("addToQueueNotification", deserialized.RequestType); } + + /// + /// Test serialize a AddToQueueNotificationWebhook to JSON string - all values are present + /// + [Fact] + public void AddToQueueNotificationWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + } + + /// + /// Test serialize a AddToQueueNotificationWebhook to JSON string - null values are stripped + /// + [Fact] + public void AddToQueueNotificationWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ApplicationListTests.cs b/src/freeclimb.Test/Model/ApplicationListTests.cs index d70f3f93..5cb7ed91 100644 --- a/src/freeclimb.Test/Model/ApplicationListTests.cs +++ b/src/freeclimb.Test/Model/ApplicationListTests.cs @@ -145,5 +145,56 @@ public void ApplicationsTest() instance.Applications = testList; Assert.Equal(instance.Applications, testList); } + + /// + /// Test serialize a ApplicationList to JSON string - all values are present + /// + [Fact] + public void ApplicationListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("applications", json); + } + + /// + /// Test serialize a ApplicationList to JSON string - null values are stripped + /// + [Fact] + public void ApplicationListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Applications = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ApplicationRequestTests.cs b/src/freeclimb.Test/Model/ApplicationRequestTests.cs index 1aed0524..132681dc 100644 --- a/src/freeclimb.Test/Model/ApplicationRequestTests.cs +++ b/src/freeclimb.Test/Model/ApplicationRequestTests.cs @@ -132,5 +132,50 @@ public void SmsFallbackUrlTest() instance.SmsFallbackUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.SmsFallbackUrl); } + + /// + /// Test serialize a ApplicationRequest to JSON string - all values are present + /// + [Fact] + public void ApplicationRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("alias", json); + + Assert.Contains("voiceUrl", json); + + Assert.Contains("voiceFallbackUrl", json); + + Assert.Contains("callConnectUrl", json); + + Assert.Contains("statusCallbackUrl", json); + + Assert.Contains("smsUrl", json); + + Assert.Contains("smsFallbackUrl", json); + } + + /// + /// Test serialize a ApplicationRequest to JSON string - null values are stripped + /// + [Fact] + public void ApplicationRequestSerializeToJSONStripNullTest() + { + instance.VoiceUrl = null; + + instance.VoiceFallbackUrl = null; + + instance.CallConnectUrl = null; + + instance.StatusCallbackUrl = null; + + instance.SmsUrl = null; + + instance.SmsFallbackUrl = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ApplicationResultTests.cs b/src/freeclimb.Test/Model/ApplicationResultTests.cs index 93106f94..0601bce9 100644 --- a/src/freeclimb.Test/Model/ApplicationResultTests.cs +++ b/src/freeclimb.Test/Model/ApplicationResultTests.cs @@ -198,5 +198,68 @@ public void SmsFallbackUrlTest() instance.SmsFallbackUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.SmsFallbackUrl); } + + /// + /// Test serialize a ApplicationResult to JSON string - all values are present + /// + [Fact] + public void ApplicationResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("accountId", json); + + Assert.Contains("applicationId", json); + + Assert.Contains("alias", json); + + Assert.Contains("voiceUrl", json); + + Assert.Contains("voiceFallbackUrl", json); + + Assert.Contains("callConnectUrl", json); + + Assert.Contains("statusCallbackUrl", json); + + Assert.Contains("smsUrl", json); + + Assert.Contains("smsFallbackUrl", json); + } + + /// + /// Test serialize a ApplicationResult to JSON string - null values are stripped + /// + [Fact] + public void ApplicationResultSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.ApplicationId = null; + + instance.Alias = null; + + instance.VoiceUrl = null; + + instance.VoiceFallbackUrl = null; + + instance.CallConnectUrl = null; + + instance.StatusCallbackUrl = null; + + instance.SmsUrl = null; + + instance.SmsFallbackUrl = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AvailableNumberListTests.cs b/src/freeclimb.Test/Model/AvailableNumberListTests.cs index 13d8c43b..3c06a5df 100644 --- a/src/freeclimb.Test/Model/AvailableNumberListTests.cs +++ b/src/freeclimb.Test/Model/AvailableNumberListTests.cs @@ -145,5 +145,56 @@ public void AvailablePhoneNumbersTest() instance.AvailablePhoneNumbers = testList; Assert.Equal(instance.AvailablePhoneNumbers, testList); } + + /// + /// Test serialize a AvailableNumberList to JSON string - all values are present + /// + [Fact] + public void AvailableNumberListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("availablePhoneNumbers", json); + } + + /// + /// Test serialize a AvailableNumberList to JSON string - null values are stripped + /// + [Fact] + public void AvailableNumberListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.AvailablePhoneNumbers = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/AvailableNumberTests.cs b/src/freeclimb.Test/Model/AvailableNumberTests.cs index 59b55884..0b199c0f 100644 --- a/src/freeclimb.Test/Model/AvailableNumberTests.cs +++ b/src/freeclimb.Test/Model/AvailableNumberTests.cs @@ -133,5 +133,50 @@ public void CountryTest() instance.Country = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Country); } + + /// + /// Test serialize a AvailableNumber to JSON string - all values are present + /// + [Fact] + public void AvailableNumberSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("capabilities", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("phoneNumber", json); + + Assert.Contains("voiceEnabled", json); + + Assert.Contains("smsEnabled", json); + + Assert.Contains("region", json); + + Assert.Contains("country", json); + } + + /// + /// Test serialize a AvailableNumber to JSON string - null values are stripped + /// + [Fact] + public void AvailableNumberSerializeToJSONStripNullTest() + { + instance.CampaignId = null; + + instance.PhoneNumber = null; + + instance.VoiceEnabled = null; + + instance.SmsEnabled = null; + + instance.Region = null; + + instance.Country = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/BuyIncomingNumberRequestTests.cs b/src/freeclimb.Test/Model/BuyIncomingNumberRequestTests.cs index 83249fb1..c92cc404 100644 --- a/src/freeclimb.Test/Model/BuyIncomingNumberRequestTests.cs +++ b/src/freeclimb.Test/Model/BuyIncomingNumberRequestTests.cs @@ -88,5 +88,30 @@ public void ApplicationIdTest() instance.ApplicationId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.ApplicationId); } + + /// + /// Test serialize a BuyIncomingNumberRequest to JSON string - all values are present + /// + [Fact] + public void BuyIncomingNumberRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("phoneNumber", json); + + Assert.Contains("alias", json); + + Assert.Contains("applicationId", json); + } + + /// + /// Test serialize a BuyIncomingNumberRequest to JSON string - null values are stripped + /// + [Fact] + public void BuyIncomingNumberRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CallControlWebhookTests.cs b/src/freeclimb.Test/Model/CallControlWebhookTests.cs index 281d6de4..febc9d85 100644 --- a/src/freeclimb.Test/Model/CallControlWebhookTests.cs +++ b/src/freeclimb.Test/Model/CallControlWebhookTests.cs @@ -115,5 +115,34 @@ public void TestDeserializeJsonToCallControlWebhook() Assert.IsType(deserialized); Assert.Equal("callControl", deserialized.RequestType); } + + /// + /// Test serialize a CallControlWebhook to JSON string - all values are present + /// + [Fact] + public void CallControlWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("digits", json); + } + + /// + /// Test serialize a CallControlWebhook to JSON string - null values are stripped + /// + [Fact] + public void CallControlWebhookSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CallListTests.cs b/src/freeclimb.Test/Model/CallListTests.cs index c8efc24f..40269e66 100644 --- a/src/freeclimb.Test/Model/CallListTests.cs +++ b/src/freeclimb.Test/Model/CallListTests.cs @@ -144,5 +144,56 @@ public void CallsTest() instance.Calls = testList; Assert.Equal(instance.Calls, testList); } + + /// + /// Test serialize a CallList to JSON string - all values are present + /// + [Fact] + public void CallListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("calls", json); + } + + /// + /// Test serialize a CallList to JSON string - null values are stripped + /// + [Fact] + public void CallListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Calls = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CallResultTests.cs b/src/freeclimb.Test/Model/CallResultTests.cs index e9b71efe..48dab616 100644 --- a/src/freeclimb.Test/Model/CallResultTests.cs +++ b/src/freeclimb.Test/Model/CallResultTests.cs @@ -296,5 +296,96 @@ public void ApplicationIdTest() instance.ApplicationId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.ApplicationId); } + + /// + /// Test serialize a CallResult to JSON string - all values are present + /// + [Fact] + public void CallResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("callId", json); + + Assert.Contains("parentCallId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("phoneNumberId", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("startTime", json); + + Assert.Contains("connectTime", json); + + Assert.Contains("endTime", json); + + Assert.Contains("duration", json); + + Assert.Contains("connectDuration", json); + + Assert.Contains("direction", json); + + Assert.Contains("answeredBy", json); + + Assert.Contains("subresourceUris", json); + + Assert.Contains("applicationId", json); + } + + /// + /// Test serialize a CallResult to JSON string - null values are stripped + /// + [Fact] + public void CallResultSerializeToJSONStripNullTest() + { + instance.CallId = null; + + instance.ParentCallId = null; + + instance.AccountId = null; + + instance.From = null; + + instance.To = null; + + instance.PhoneNumberId = null; + + instance.CallStatus = null; + + instance.StartTime = null; + + instance.ConnectTime = null; + + instance.EndTime = null; + + instance.Duration = null; + + instance.ConnectDuration = null; + + instance.Direction = null; + + instance.AnsweredBy = null; + + instance.SubresourceUris = null; + + instance.ApplicationId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CallStatusWebhookTests.cs b/src/freeclimb.Test/Model/CallStatusWebhookTests.cs index 54c57727..8ab303fa 100644 --- a/src/freeclimb.Test/Model/CallStatusWebhookTests.cs +++ b/src/freeclimb.Test/Model/CallStatusWebhookTests.cs @@ -232,5 +232,52 @@ public void TestDeserializeJsonToCallStatusWebhook() Assert.IsType(deserialized); Assert.Equal("callStatus", deserialized.RequestType); } + + /// + /// Test serialize a CallStatusWebhook to JSON string - all values are present + /// + [Fact] + public void CallStatusWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("callEndedReason", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + } + + /// + /// Test serialize a CallStatusWebhook to JSON string - null values are stripped + /// + [Fact] + public void CallStatusWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.CallEndedReason = null; + + instance.Direction = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CapabilitiesTests.cs b/src/freeclimb.Test/Model/CapabilitiesTests.cs index 516ae73b..24bd5b53 100644 --- a/src/freeclimb.Test/Model/CapabilitiesTests.cs +++ b/src/freeclimb.Test/Model/CapabilitiesTests.cs @@ -110,5 +110,34 @@ public void ShortCodeTest() instance.ShortCode = false; Assert.False(instance.ShortCode); } + + /// + /// Test serialize a Capabilities to JSON string - all values are present + /// + [Fact] + public void CapabilitiesSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("voice", json); + + Assert.Contains("sms", json); + + Assert.Contains("tollFree", json); + + Assert.Contains("tenDLC", json); + + Assert.Contains("shortCode", json); + } + + /// + /// Test serialize a Capabilities to JSON string - null values are stripped + /// + [Fact] + public void CapabilitiesSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CompletionRequestTests.cs b/src/freeclimb.Test/Model/CompletionRequestTests.cs index 32b0fe32..14eb76b2 100644 --- a/src/freeclimb.Test/Model/CompletionRequestTests.cs +++ b/src/freeclimb.Test/Model/CompletionRequestTests.cs @@ -66,5 +66,26 @@ public void QueryTest() instance.Query = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Query); } + + /// + /// Test serialize a CompletionRequest to JSON string - all values are present + /// + [Fact] + public void CompletionRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("query", json); + } + + /// + /// Test serialize a CompletionRequest to JSON string - null values are stripped + /// + [Fact] + public void CompletionRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CompletionResultTests.cs b/src/freeclimb.Test/Model/CompletionResultTests.cs index 25b0d353..0725897e 100644 --- a/src/freeclimb.Test/Model/CompletionResultTests.cs +++ b/src/freeclimb.Test/Model/CompletionResultTests.cs @@ -80,5 +80,28 @@ public void StatusTest() instance.Status = CompletionResultStatus.NO_CONTEXT; Assert.Equal(CompletionResultStatus.NO_CONTEXT, instance.Status); } + + /// + /// Test serialize a CompletionResult to JSON string - all values are present + /// + [Fact] + public void CompletionResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("response", json); + + Assert.Contains("status", json); + } + + /// + /// Test serialize a CompletionResult to JSON string - null values are stripped + /// + [Fact] + public void CompletionResultSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceListTests.cs b/src/freeclimb.Test/Model/ConferenceListTests.cs index 91befa87..e7bb86f2 100644 --- a/src/freeclimb.Test/Model/ConferenceListTests.cs +++ b/src/freeclimb.Test/Model/ConferenceListTests.cs @@ -145,5 +145,56 @@ public void ConferencesTest() instance.Conferences = testList; Assert.Equal(instance.Conferences, testList); } + + /// + /// Test serialize a ConferenceList to JSON string - all values are present + /// + [Fact] + public void ConferenceListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("conferences", json); + } + + /// + /// Test serialize a ConferenceList to JSON string - null values are stripped + /// + [Fact] + public void ConferenceListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Conferences = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceParticipantListTests.cs b/src/freeclimb.Test/Model/ConferenceParticipantListTests.cs index 1a9f85d7..9c27fce0 100644 --- a/src/freeclimb.Test/Model/ConferenceParticipantListTests.cs +++ b/src/freeclimb.Test/Model/ConferenceParticipantListTests.cs @@ -145,5 +145,56 @@ public void ParticipantsTest() instance.Participants = testList; Assert.Equal(instance.Participants, testList); } + + /// + /// Test serialize a ConferenceParticipantList to JSON string - all values are present + /// + [Fact] + public void ConferenceParticipantListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("participants", json); + } + + /// + /// Test serialize a ConferenceParticipantList to JSON string - null values are stripped + /// + [Fact] + public void ConferenceParticipantListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Participants = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceParticipantResultTests.cs b/src/freeclimb.Test/Model/ConferenceParticipantResultTests.cs index 7fe4c9dd..70a5f11f 100644 --- a/src/freeclimb.Test/Model/ConferenceParticipantResultTests.cs +++ b/src/freeclimb.Test/Model/ConferenceParticipantResultTests.cs @@ -176,5 +176,60 @@ public void StartConfOnEnterTest() instance.StartConfOnEnter = false; Assert.False(instance.StartConfOnEnter); } + + /// + /// Test serialize a ConferenceParticipantResult to JSON string - all values are present + /// + [Fact] + public void ConferenceParticipantResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("accountId", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("callId", json); + + Assert.Contains("talk", json); + + Assert.Contains("listen", json); + + Assert.Contains("dtmfPassThrough", json); + + Assert.Contains("startConfOnEnter", json); + } + + /// + /// Test serialize a ConferenceParticipantResult to JSON string - null values are stripped + /// + [Fact] + public void ConferenceParticipantResultSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.ConferenceId = null; + + instance.CallId = null; + + instance.Talk = null; + + instance.Listen = null; + + instance.DtmfPassThrough = null; + + instance.StartConfOnEnter = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceRecordingStatusWebhookTests.cs b/src/freeclimb.Test/Model/ConferenceRecordingStatusWebhookTests.cs index 047ed07b..6017b1e0 100644 --- a/src/freeclimb.Test/Model/ConferenceRecordingStatusWebhookTests.cs +++ b/src/freeclimb.Test/Model/ConferenceRecordingStatusWebhookTests.cs @@ -228,5 +228,58 @@ public void TestDeserializeJsonToConferenceRecordingStatusWebhook() Assert.IsType(deserialized); Assert.Equal("conferenceRecordingStatus", deserialized.RequestType); } + + /// + /// Test serialize a ConferenceRecordingStatusWebhook to JSON string - all values are present + /// + [Fact] + public void ConferenceRecordingStatusWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("status", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingDurationSec", json); + } + + /// + /// Test serialize a ConferenceRecordingStatusWebhook to JSON string - null values are stripped + /// + [Fact] + public void ConferenceRecordingStatusWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + instance.Status = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceResultTests.cs b/src/freeclimb.Test/Model/ConferenceResultTests.cs index b8f85163..7992b966 100644 --- a/src/freeclimb.Test/Model/ConferenceResultTests.cs +++ b/src/freeclimb.Test/Model/ConferenceResultTests.cs @@ -222,5 +222,72 @@ public void SubresourceUrisTest() instance.SubresourceUris = testObject; Assert.Equal(testObject, instance.SubresourceUris); } + + /// + /// Test serialize a ConferenceResult to JSON string - all values are present + /// + [Fact] + public void ConferenceResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("alias", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("record", json); + + Assert.Contains("status", json); + + Assert.Contains("waitUrl", json); + + Assert.Contains("actionUrl", json); + + Assert.Contains("statusCallbackUrl", json); + + Assert.Contains("subresourceUris", json); + } + + /// + /// Test serialize a ConferenceResult to JSON string - null values are stripped + /// + [Fact] + public void ConferenceResultSerializeToJSONStripNullTest() + { + instance.ConferenceId = null; + + instance.AccountId = null; + + instance.Alias = null; + + instance.PlayBeep = null; + + instance.Record = null; + + instance.Status = null; + + instance.WaitUrl = null; + + instance.ActionUrl = null; + + instance.StatusCallbackUrl = null; + + instance.SubresourceUris = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ConferenceStatusWebhookTests.cs b/src/freeclimb.Test/Model/ConferenceStatusWebhookTests.cs index c1e21e06..decd8017 100644 --- a/src/freeclimb.Test/Model/ConferenceStatusWebhookTests.cs +++ b/src/freeclimb.Test/Model/ConferenceStatusWebhookTests.cs @@ -227,5 +227,64 @@ public void TestDeserializeJsonToConferenceStatusWebhook() Assert.IsType(deserialized); Assert.Equal("conferenceStatus", deserialized.RequestType); } + + /// + /// Test serialize a ConferenceStatusWebhook to JSON string - all values are present + /// + [Fact] + public void ConferenceStatusWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("status", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingDurationSec", json); + } + + /// + /// Test serialize a ConferenceStatusWebhook to JSON string - null values are stripped + /// + [Fact] + public void ConferenceStatusWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + instance.Status = null; + + instance.RecordingUrl = null; + + instance.RecordingId = null; + + instance.RecordingDurationSec = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CreateConferenceRequestTests.cs b/src/freeclimb.Test/Model/CreateConferenceRequestTests.cs index 1aead69c..7982ed7c 100644 --- a/src/freeclimb.Test/Model/CreateConferenceRequestTests.cs +++ b/src/freeclimb.Test/Model/CreateConferenceRequestTests.cs @@ -116,5 +116,36 @@ public void StatusCallbackUrlTest() instance.StatusCallbackUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.StatusCallbackUrl); } + + /// + /// Test serialize a CreateConferenceRequest to JSON string - all values are present + /// + [Fact] + public void CreateConferenceRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("alias", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("record", json); + + Assert.Contains("waitUrl", json); + + Assert.Contains("statusCallbackUrl", json); + } + + /// + /// Test serialize a CreateConferenceRequest to JSON string - null values are stripped + /// + [Fact] + public void CreateConferenceRequestSerializeToJSONStripNullTest() + { + instance.PlayBeep = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CreateConferenceTests.cs b/src/freeclimb.Test/Model/CreateConferenceTests.cs index c2d2803f..c1db3f89 100644 --- a/src/freeclimb.Test/Model/CreateConferenceTests.cs +++ b/src/freeclimb.Test/Model/CreateConferenceTests.cs @@ -127,5 +127,38 @@ public void WaitUrlTest() instance.WaitUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.WaitUrl); } + + /// + /// Test serialize a CreateConference to JSON string - all values are present + /// + [Fact] + public void CreateConferenceSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("alias", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("record", json); + + Assert.Contains("statusCallbackUrl", json); + + Assert.Contains("waitUrl", json); + } + + /// + /// Test serialize a CreateConference to JSON string - null values are stripped + /// + [Fact] + public void CreateConferenceSerializeToJSONStripNullTest() + { + instance.PlayBeep = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CreateConferenceWebhookTests.cs b/src/freeclimb.Test/Model/CreateConferenceWebhookTests.cs index aa93c96b..ff76c97c 100644 --- a/src/freeclimb.Test/Model/CreateConferenceWebhookTests.cs +++ b/src/freeclimb.Test/Model/CreateConferenceWebhookTests.cs @@ -227,5 +227,64 @@ public void TestDeserializeJsonToCreateConferenceWebhook() Assert.IsType(deserialized); Assert.Equal("createConference", deserialized.RequestType); } + + /// + /// Test serialize a CreateConferenceWebhook to JSON string - all values are present + /// + [Fact] + public void CreateConferenceWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("status", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingDurationSec", json); + } + + /// + /// Test serialize a CreateConferenceWebhook to JSON string - null values are stripped + /// + [Fact] + public void CreateConferenceWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + instance.Status = null; + + instance.RecordingUrl = null; + + instance.RecordingId = null; + + instance.RecordingDurationSec = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/CreateWebRTCTokenTests.cs b/src/freeclimb.Test/Model/CreateWebRTCTokenTests.cs index 9b46fbf1..e801d0b6 100644 --- a/src/freeclimb.Test/Model/CreateWebRTCTokenTests.cs +++ b/src/freeclimb.Test/Model/CreateWebRTCTokenTests.cs @@ -88,5 +88,30 @@ public void UsesTest() instance.Uses = 1; Assert.Equal(1, (int)instance.Uses); } + + /// + /// Test serialize a CreateWebRTCToken to JSON string - all values are present + /// + [Fact] + public void CreateWebRTCTokenSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("to", json); + + Assert.Contains("from", json); + + Assert.Contains("uses", json); + } + + /// + /// Test serialize a CreateWebRTCToken to JSON string - null values are stripped + /// + [Fact] + public void CreateWebRTCTokenSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/DequeueTests.cs b/src/freeclimb.Test/Model/DequeueTests.cs index d37d1be8..be66c3e4 100644 --- a/src/freeclimb.Test/Model/DequeueTests.cs +++ b/src/freeclimb.Test/Model/DequeueTests.cs @@ -54,5 +54,24 @@ public void DequeueInstanceTest() { Assert.IsType(instance); } + + /// + /// Test serialize a Dequeue to JSON string - all values are present + /// + [Fact] + public void DequeueSerializeToJSONTest() + { + string json = instance.ToJson(); + } + + /// + /// Test serialize a Dequeue to JSON string - null values are stripped + /// + [Fact] + public void DequeueSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/DequeueWebhookTests.cs b/src/freeclimb.Test/Model/DequeueWebhookTests.cs index aacc7a79..d7388893 100644 --- a/src/freeclimb.Test/Model/DequeueWebhookTests.cs +++ b/src/freeclimb.Test/Model/DequeueWebhookTests.cs @@ -199,5 +199,54 @@ public void TestDeserializeJsonToDequeueWebhook() Assert.IsType(deserialized); Assert.Equal("dequeue", deserialized.RequestType); } + + /// + /// Test serialize a DequeueWebhook to JSON string - all values are present + /// + [Fact] + public void DequeueWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("queueResult", json); + + Assert.Contains("queueTime", json); + } + + /// + /// Test serialize a DequeueWebhook to JSON string - null values are stripped + /// + [Fact] + public void DequeueWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + instance.QueueTime = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/EnqueueTests.cs b/src/freeclimb.Test/Model/EnqueueTests.cs index 6a73c28a..76d12988 100644 --- a/src/freeclimb.Test/Model/EnqueueTests.cs +++ b/src/freeclimb.Test/Model/EnqueueTests.cs @@ -99,5 +99,32 @@ public void WaitUrlTest() instance.WaitUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.WaitUrl); } + + /// + /// Test serialize a Enqueue to JSON string - all values are present + /// + [Fact] + public void EnqueueSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("notificationUrl", json); + + Assert.Contains("queueId", json); + + Assert.Contains("waitUrl", json); + } + + /// + /// Test serialize a Enqueue to JSON string - null values are stripped + /// + [Fact] + public void EnqueueSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/FilterLogsRequestTests.cs b/src/freeclimb.Test/Model/FilterLogsRequestTests.cs index b5abcee9..9ddd4344 100644 --- a/src/freeclimb.Test/Model/FilterLogsRequestTests.cs +++ b/src/freeclimb.Test/Model/FilterLogsRequestTests.cs @@ -64,5 +64,26 @@ public void PqlTest() instance.Pql = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Pql); } + + /// + /// Test serialize a FilterLogsRequest to JSON string - all values are present + /// + [Fact] + public void FilterLogsRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("pql", json); + } + + /// + /// Test serialize a FilterLogsRequest to JSON string - null values are stripped + /// + [Fact] + public void FilterLogsRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/GetDigitsTests.cs b/src/freeclimb.Test/Model/GetDigitsTests.cs index 9214760b..0ac93e93 100644 --- a/src/freeclimb.Test/Model/GetDigitsTests.cs +++ b/src/freeclimb.Test/Model/GetDigitsTests.cs @@ -155,5 +155,42 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a GetDigits to JSON string - all values are present + /// + [Fact] + public void GetDigitsSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("digitTimeoutMs", json); + + Assert.Contains("finishOnKey", json); + + Assert.Contains("flushBuffer", json); + + Assert.Contains("initialTimeoutMs", json); + + Assert.Contains("maxDigits", json); + + Assert.Contains("minDigits", json); + + Assert.Contains("prompts", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a GetDigits to JSON string - null values are stripped + /// + [Fact] + public void GetDigitsSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/GetDigitsWebhookTests.cs b/src/freeclimb.Test/Model/GetDigitsWebhookTests.cs index be7989cf..160f9e0e 100644 --- a/src/freeclimb.Test/Model/GetDigitsWebhookTests.cs +++ b/src/freeclimb.Test/Model/GetDigitsWebhookTests.cs @@ -216,5 +216,54 @@ public void TestDeserializeJsonToGetDigitsWebhook() Assert.IsType(deserialized); Assert.Equal("getDigits", deserialized.RequestType); } + + /// + /// Test serialize a GetDigitsWebhook to JSON string - all values are present + /// + [Fact] + public void GetDigitsWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("digits", json); + + Assert.Contains("reason", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a GetDigitsWebhook to JSON string - null values are stripped + /// + [Fact] + public void GetDigitsWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/GetSpeechTests.cs b/src/freeclimb.Test/Model/GetSpeechTests.cs index d164b709..f0452afd 100644 --- a/src/freeclimb.Test/Model/GetSpeechTests.cs +++ b/src/freeclimb.Test/Model/GetSpeechTests.cs @@ -201,5 +201,52 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a GetSpeech to JSON string - all values are present + /// + [Fact] + public void GetSpeechSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("grammarType", json); + + Assert.Contains("grammarFile", json); + + Assert.Contains("grammarRule", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("prompts", json); + + Assert.Contains("noInputTimeoutMs", json); + + Assert.Contains("recognitionTimeoutMs", json); + + Assert.Contains("confidenceThreshold", json); + + Assert.Contains("sensitivityLevel", json); + + Assert.Contains("speechCompleteTimeoutMs", json); + + Assert.Contains("speechIncompleteTimeoutMs", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a GetSpeech to JSON string - null values are stripped + /// + [Fact] + public void GetSpeechSerializeToJSONStripNullTest() + { + instance.GrammarType = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/GetSpeechWebhookTests.cs b/src/freeclimb.Test/Model/GetSpeechWebhookTests.cs index 50d03388..fe694f1d 100644 --- a/src/freeclimb.Test/Model/GetSpeechWebhookTests.cs +++ b/src/freeclimb.Test/Model/GetSpeechWebhookTests.cs @@ -275,5 +275,64 @@ public void TestDeserializeJsonToGetSpeechWebhook() Assert.IsType(deserialized); Assert.Equal("getSpeech", deserialized.RequestType); } + + /// + /// Test serialize a GetSpeechWebhook to JSON string - all values are present + /// + [Fact] + public void GetSpeechWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("reason", json); + + Assert.Contains("recognitionResult", json); + + Assert.Contains("confidence", json); + + Assert.Contains("parentCallId", json); + + Assert.Contains("completionReason", json); + + Assert.Contains("completionCause", json); + + Assert.Contains("mrcpCode", json); + + Assert.Contains("mrcpDiagnostic", json); + } + + /// + /// Test serialize a GetSpeechWebhook to JSON string - null values are stripped + /// + [Fact] + public void GetSpeechWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/HangupTests.cs b/src/freeclimb.Test/Model/HangupTests.cs index 81101669..200673ce 100644 --- a/src/freeclimb.Test/Model/HangupTests.cs +++ b/src/freeclimb.Test/Model/HangupTests.cs @@ -64,5 +64,26 @@ public void ReasonTest() instance.Reason = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Reason); } + + /// + /// Test serialize a Hangup to JSON string - all values are present + /// + [Fact] + public void HangupSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("reason", json); + } + + /// + /// Test serialize a Hangup to JSON string - null values are stripped + /// + [Fact] + public void HangupSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/InboundCallWebhookTests.cs b/src/freeclimb.Test/Model/InboundCallWebhookTests.cs index caf27721..766d58fc 100644 --- a/src/freeclimb.Test/Model/InboundCallWebhookTests.cs +++ b/src/freeclimb.Test/Model/InboundCallWebhookTests.cs @@ -188,5 +188,54 @@ public void TestDeserializeJsonToInboundCallWebhook() Assert.IsType(deserialized); Assert.Equal("inboundCall", deserialized.RequestType); } + + /// + /// Test serialize a InboundCallWebhook to JSON string - all values are present + /// + [Fact] + public void InboundCallWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a InboundCallWebhook to JSON string - null values are stripped + /// + [Fact] + public void InboundCallWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + instance.ParentCallId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/IncomingNumberListTests.cs b/src/freeclimb.Test/Model/IncomingNumberListTests.cs index 04c51215..fbd47f45 100644 --- a/src/freeclimb.Test/Model/IncomingNumberListTests.cs +++ b/src/freeclimb.Test/Model/IncomingNumberListTests.cs @@ -145,5 +145,56 @@ public void IncomingPhoneNumbersTest() instance.IncomingPhoneNumbers = testList; Assert.Equal(instance.IncomingPhoneNumbers, testList); } + + /// + /// Test serialize a IncomingNumberList to JSON string - all values are present + /// + [Fact] + public void IncomingNumberListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("incomingPhoneNumbers", json); + } + + /// + /// Test serialize a IncomingNumberList to JSON string - null values are stripped + /// + [Fact] + public void IncomingNumberListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.IncomingPhoneNumbers = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/IncomingNumberRequestTests.cs b/src/freeclimb.Test/Model/IncomingNumberRequestTests.cs index 0f8e8063..40d7d050 100644 --- a/src/freeclimb.Test/Model/IncomingNumberRequestTests.cs +++ b/src/freeclimb.Test/Model/IncomingNumberRequestTests.cs @@ -88,5 +88,32 @@ public void CampaignIdTest() instance.CampaignId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.CampaignId); } + + /// + /// Test serialize a IncomingNumberRequest to JSON string - all values are present + /// + [Fact] + public void IncomingNumberRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("applicationId", json); + + Assert.Contains("alias", json); + + Assert.Contains("campaignId", json); + } + + /// + /// Test serialize a IncomingNumberRequest to JSON string - null values are stripped + /// + [Fact] + public void IncomingNumberRequestSerializeToJSONStripNullTest() + { + instance.CampaignId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/IncomingNumberResultTests.cs b/src/freeclimb.Test/Model/IncomingNumberResultTests.cs index 3309562f..dd167cfd 100644 --- a/src/freeclimb.Test/Model/IncomingNumberResultTests.cs +++ b/src/freeclimb.Test/Model/IncomingNumberResultTests.cs @@ -244,5 +244,80 @@ public void TfnTest() instance.Tfn = testObject; Assert.Equal(testObject, instance.Tfn); } + + /// + /// Test serialize a IncomingNumberResult to JSON string - all values are present + /// + [Fact] + public void IncomingNumberResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("capabilities", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("phoneNumberId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("applicationId", json); + + Assert.Contains("phoneNumber", json); + + Assert.Contains("alias", json); + + Assert.Contains("region", json); + + Assert.Contains("country", json); + + Assert.Contains("voiceEnabled", json); + + Assert.Contains("smsEnabled", json); + + Assert.Contains("offnet", json); + + Assert.Contains("tfn", json); + } + + /// + /// Test serialize a IncomingNumberResult to JSON string - null values are stripped + /// + [Fact] + public void IncomingNumberResultSerializeToJSONStripNullTest() + { + instance.CampaignId = null; + + instance.PhoneNumberId = null; + + instance.AccountId = null; + + instance.ApplicationId = null; + + instance.PhoneNumber = null; + + instance.Alias = null; + + instance.Region = null; + + instance.Country = null; + + instance.VoiceEnabled = null; + + instance.SmsEnabled = null; + + instance.Offnet = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/LeaveConferenceWebhookTests.cs b/src/freeclimb.Test/Model/LeaveConferenceWebhookTests.cs index 8ce4de23..e7ac76a0 100644 --- a/src/freeclimb.Test/Model/LeaveConferenceWebhookTests.cs +++ b/src/freeclimb.Test/Model/LeaveConferenceWebhookTests.cs @@ -177,5 +177,50 @@ public void TestDeserializeJsonToLeaveConferenceWebhook() Assert.IsType(deserialized); Assert.Equal("leaveConference", deserialized.RequestType); } + + /// + /// Test serialize a LeaveConferenceWebhook to JSON string - all values are present + /// + [Fact] + public void LeaveConferenceWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + } + + /// + /// Test serialize a LeaveConferenceWebhook to JSON string - null values are stripped + /// + [Fact] + public void LeaveConferenceWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/LogListTests.cs b/src/freeclimb.Test/Model/LogListTests.cs index 99ab8dbf..b017d889 100644 --- a/src/freeclimb.Test/Model/LogListTests.cs +++ b/src/freeclimb.Test/Model/LogListTests.cs @@ -144,5 +144,56 @@ public void LogsTest() instance.Logs = testList; Assert.Equal(instance.Logs, testList); } + + /// + /// Test serialize a LogList to JSON string - all values are present + /// + [Fact] + public void LogListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("logs", json); + } + + /// + /// Test serialize a LogList to JSON string - null values are stripped + /// + [Fact] + public void LogListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Logs = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/LogResultTests.cs b/src/freeclimb.Test/Model/LogResultTests.cs index 1c83f834..a9af0f4f 100644 --- a/src/freeclimb.Test/Model/LogResultTests.cs +++ b/src/freeclimb.Test/Model/LogResultTests.cs @@ -137,5 +137,52 @@ public void MetadataTest() instance.Metadata = testObject; Assert.Equal(testObject, instance.Metadata); } + + /// + /// Test serialize a LogResult to JSON string - all values are present + /// + [Fact] + public void LogResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("timestamp", json); + + Assert.Contains("level", json); + + Assert.Contains("requestId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("message", json); + + Assert.Contains("metadata", json); + } + + /// + /// Test serialize a LogResult to JSON string - null values are stripped + /// + [Fact] + public void LogResultSerializeToJSONStripNullTest() + { + instance.Timestamp = null; + + instance.Level = null; + + instance.RequestId = null; + + instance.AccountId = null; + + instance.CallId = null; + + instance.Message = null; + + instance.Metadata = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MachineDetectedWebhookTests.cs b/src/freeclimb.Test/Model/MachineDetectedWebhookTests.cs index be6eda18..c699b17e 100644 --- a/src/freeclimb.Test/Model/MachineDetectedWebhookTests.cs +++ b/src/freeclimb.Test/Model/MachineDetectedWebhookTests.cs @@ -201,5 +201,54 @@ public void TestDeserializeJsonToMachineDetectedWebhook() Assert.IsType(deserialized); Assert.Equal("machineDetected", deserialized.RequestType); } + + /// + /// Test serialize a MachineDetectedWebhook to JSON string - all values are present + /// + [Fact] + public void MachineDetectedWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("callId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("parentCallId", json); + + Assert.Contains("machineType", json); + } + + /// + /// Test serialize a MachineDetectedWebhook to JSON string - null values are stripped + /// + [Fact] + public void MachineDetectedWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MakeCallRequestTests.cs b/src/freeclimb.Test/Model/MakeCallRequestTests.cs index 52e6c42a..2f6a162b 100644 --- a/src/freeclimb.Test/Model/MakeCallRequestTests.cs +++ b/src/freeclimb.Test/Model/MakeCallRequestTests.cs @@ -165,5 +165,44 @@ public void CallConnectUrlTest() instance.CallConnectUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.CallConnectUrl); } + + /// + /// Test serialize a MakeCallRequest to JSON string - all values are present + /// + [Fact] + public void MakeCallRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("applicationId", json); + + Assert.Contains("sendDigits", json); + + Assert.Contains("ifMachine", json); + + Assert.Contains("ifMachineUrl", json); + + Assert.Contains("timeout", json); + + Assert.Contains("parentCallId", json); + + Assert.Contains("privacyMode", json); + + Assert.Contains("callConnectUrl", json); + } + + /// + /// Test serialize a MakeCallRequest to JSON string - null values are stripped + /// + [Fact] + public void MakeCallRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MessageDeliveryWebhookTests.cs b/src/freeclimb.Test/Model/MessageDeliveryWebhookTests.cs index d159f7df..e9796876 100644 --- a/src/freeclimb.Test/Model/MessageDeliveryWebhookTests.cs +++ b/src/freeclimb.Test/Model/MessageDeliveryWebhookTests.cs @@ -170,5 +170,44 @@ public void TestDeserializeJsonToMessageDeliveryWebhook() Assert.IsType(deserialized); Assert.Equal("messageDelivery", deserialized.RequestType); } + + /// + /// Test serialize a MessageDeliveryWebhook to JSON string - all values are present + /// + [Fact] + public void MessageDeliveryWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("text", json); + + Assert.Contains("direction", json); + + Assert.Contains("applicationId", json); + + Assert.Contains("status", json); + + Assert.Contains("phoneNumberId", json); + + Assert.Contains("uri", json); + } + + /// + /// Test serialize a MessageDeliveryWebhook to JSON string - null values are stripped + /// + [Fact] + public void MessageDeliveryWebhookSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MessageRequestTests.cs b/src/freeclimb.Test/Model/MessageRequestTests.cs index 64af5db4..929380ec 100644 --- a/src/freeclimb.Test/Model/MessageRequestTests.cs +++ b/src/freeclimb.Test/Model/MessageRequestTests.cs @@ -155,5 +155,44 @@ public void MediaUrlsTest() instance.MediaUrls = testList; Assert.Equal(instance.MediaUrls, testList); } + + /// + /// Test serialize a MessageRequest to JSON string - all values are present + /// + [Fact] + public void MessageRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("text", json); + + Assert.Contains("notificationUrl", json); + + Assert.Contains("mediaUrls", json); + } + + /// + /// Test serialize a MessageRequest to JSON string - null values are stripped + /// + [Fact] + public void MessageRequestSerializeToJSONStripNullTest() + { + instance.MediaUrls = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MessageResultTests.cs b/src/freeclimb.Test/Model/MessageResultTests.cs index 94129901..cfbfb17a 100644 --- a/src/freeclimb.Test/Model/MessageResultTests.cs +++ b/src/freeclimb.Test/Model/MessageResultTests.cs @@ -286,5 +286,90 @@ public void ApplicationIdTest() instance.ApplicationId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.ApplicationId); } + + /// + /// Test serialize a MessageResult to JSON string - all values are present + /// + [Fact] + public void MessageResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("accountId", json); + + Assert.Contains("messageId", json); + + Assert.Contains("status", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("text", json); + + Assert.Contains("direction", json); + + Assert.Contains("notificationUrl", json); + + Assert.Contains("brandId", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("segmentCount", json); + + Assert.Contains("mediaUrls", json); + + Assert.Contains("tfn", json); + + Assert.Contains("phoneNumberId", json); + + Assert.Contains("applicationId", json); + } + + /// + /// Test serialize a MessageResult to JSON string - null values are stripped + /// + [Fact] + public void MessageResultSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.MessageId = null; + + instance.Status = null; + + instance.From = null; + + instance.To = null; + + instance.Text = null; + + instance.Direction = null; + + instance.NotificationUrl = null; + + instance.BrandId = null; + + instance.CampaignId = null; + + instance.SegmentCount = null; + + instance.MediaUrls = null; + + instance.PhoneNumberId = null; + + instance.ApplicationId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MessageStatusWebhookTests.cs b/src/freeclimb.Test/Model/MessageStatusWebhookTests.cs index e8ff88c6..aa9dc3fd 100644 --- a/src/freeclimb.Test/Model/MessageStatusWebhookTests.cs +++ b/src/freeclimb.Test/Model/MessageStatusWebhookTests.cs @@ -201,5 +201,48 @@ public void TestDeserializeJsonToMessageStatusWebhook() Assert.IsType(deserialized); Assert.Equal("messageStatus", deserialized.RequestType); } + + /// + /// Test serialize a MessageStatusWebhook to JSON string - all values are present + /// + [Fact] + public void MessageStatusWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("messageId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("text", json); + + Assert.Contains("direction", json); + + Assert.Contains("applicationId", json); + + Assert.Contains("status", json); + + Assert.Contains("phoneNumberId", json); + } + + /// + /// Test serialize a MessageStatusWebhook to JSON string - null values are stripped + /// + [Fact] + public void MessageStatusWebhookSerializeToJSONStripNullTest() + { + instance.Status = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MessagesListTests.cs b/src/freeclimb.Test/Model/MessagesListTests.cs index 2938713f..5aaf39ce 100644 --- a/src/freeclimb.Test/Model/MessagesListTests.cs +++ b/src/freeclimb.Test/Model/MessagesListTests.cs @@ -144,5 +144,56 @@ public void MessagesTest() instance.Messages = testList; Assert.Equal(instance.Messages, testList); } + + /// + /// Test serialize a MessagesList to JSON string - all values are present + /// + [Fact] + public void MessagesListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("messages", json); + } + + /// + /// Test serialize a MessagesList to JSON string - null values are stripped + /// + [Fact] + public void MessagesListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Messages = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/MutableResourceModelTests.cs b/src/freeclimb.Test/Model/MutableResourceModelTests.cs index 5392f75b..2f3687f5 100644 --- a/src/freeclimb.Test/Model/MutableResourceModelTests.cs +++ b/src/freeclimb.Test/Model/MutableResourceModelTests.cs @@ -99,5 +99,32 @@ public void RevisionTest() instance.Revision = 1; Assert.Equal(1, (int)instance.Revision); } + + /// + /// Test serialize a MutableResourceModel to JSON string - all values are present + /// + [Fact] + public void MutableResourceModelSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + } + + /// + /// Test serialize a MutableResourceModel to JSON string - null values are stripped + /// + [Fact] + public void MutableResourceModelSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/OutDialApiConnectWebhookTests.cs b/src/freeclimb.Test/Model/OutDialApiConnectWebhookTests.cs index cf65b69b..d95b605b 100644 --- a/src/freeclimb.Test/Model/OutDialApiConnectWebhookTests.cs +++ b/src/freeclimb.Test/Model/OutDialApiConnectWebhookTests.cs @@ -188,5 +188,52 @@ public void TestDeserializeJsonToOutDialApiConnectWebhook() Assert.IsType(deserialized); Assert.Equal("outDialApiConnect", deserialized.RequestType); } + + /// + /// Test serialize a OutDialApiConnectWebhook to JSON string - all values are present + /// + [Fact] + public void OutDialApiConnectWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a OutDialApiConnectWebhook to JSON string - null values are stripped + /// + [Fact] + public void OutDialApiConnectWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/OutDialConnectWebhookTests.cs b/src/freeclimb.Test/Model/OutDialConnectWebhookTests.cs index a5c49a15..c53e29b7 100644 --- a/src/freeclimb.Test/Model/OutDialConnectWebhookTests.cs +++ b/src/freeclimb.Test/Model/OutDialConnectWebhookTests.cs @@ -188,5 +188,52 @@ public void TestDeserializeJsonToOutDialConnectWebhook() Assert.IsType(deserialized); Assert.Equal("outDialConnect", deserialized.RequestType); } + + /// + /// Test serialize a OutDialConnectWebhook to JSON string - all values are present + /// + [Fact] + public void OutDialConnectWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a OutDialConnectWebhook to JSON string - null values are stripped + /// + [Fact] + public void OutDialConnectWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/OutDialStartWebhookTests.cs b/src/freeclimb.Test/Model/OutDialStartWebhookTests.cs index 84a5fb0f..5c605706 100644 --- a/src/freeclimb.Test/Model/OutDialStartWebhookTests.cs +++ b/src/freeclimb.Test/Model/OutDialStartWebhookTests.cs @@ -199,5 +199,56 @@ public void TestDeserializeJsonToOutDialStartWebhook() Assert.IsType(deserialized); Assert.Equal("outDialStart", deserialized.RequestType); } + + /// + /// Test serialize a OutDialStartWebhook to JSON string - all values are present + /// + [Fact] + public void OutDialStartWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("dialCallId", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a OutDialStartWebhook to JSON string - null values are stripped + /// + [Fact] + public void OutDialStartWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + instance.ParentCallId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/OutDialTests.cs b/src/freeclimb.Test/Model/OutDialTests.cs index 3d59d791..b3bdf801 100644 --- a/src/freeclimb.Test/Model/OutDialTests.cs +++ b/src/freeclimb.Test/Model/OutDialTests.cs @@ -167,5 +167,44 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a OutDial to JSON string - all values are present + /// + [Fact] + public void OutDialSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("callConnectUrl", json); + + Assert.Contains("callingNumber", json); + + Assert.Contains("destination", json); + + Assert.Contains("ifMachine", json); + + Assert.Contains("ifMachineUrl", json); + + Assert.Contains("sendDigits", json); + + Assert.Contains("statusCallbackUrl", json); + + Assert.Contains("timeout", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a OutDial to JSON string - null values are stripped + /// + [Fact] + public void OutDialSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/PaginationModelTests.cs b/src/freeclimb.Test/Model/PaginationModelTests.cs index 64ffdb94..33c55d1f 100644 --- a/src/freeclimb.Test/Model/PaginationModelTests.cs +++ b/src/freeclimb.Test/Model/PaginationModelTests.cs @@ -132,5 +132,52 @@ public void NextPageUriTest() instance.NextPageUri = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.NextPageUri); } + + /// + /// Test serialize a PaginationModel to JSON string - all values are present + /// + [Fact] + public void PaginationModelSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + } + + /// + /// Test serialize a PaginationModel to JSON string - null values are stripped + /// + [Fact] + public void PaginationModelSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/ParkTests.cs b/src/freeclimb.Test/Model/ParkTests.cs index baa150fc..60fb4866 100644 --- a/src/freeclimb.Test/Model/ParkTests.cs +++ b/src/freeclimb.Test/Model/ParkTests.cs @@ -88,5 +88,30 @@ public void NotificationUrlTest() instance.NotificationUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.NotificationUrl); } + + /// + /// Test serialize a Park to JSON string - all values are present + /// + [Fact] + public void ParkSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("waitUrl", json); + + Assert.Contains("actionUrl", json); + + Assert.Contains("notificationUrl", json); + } + + /// + /// Test serialize a Park to JSON string - null values are stripped + /// + [Fact] + public void ParkSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/PauseTests.cs b/src/freeclimb.Test/Model/PauseTests.cs index ccb7bb58..02c2e788 100644 --- a/src/freeclimb.Test/Model/PauseTests.cs +++ b/src/freeclimb.Test/Model/PauseTests.cs @@ -64,5 +64,26 @@ public void LengthTest() instance.Length = 1; Assert.Equal(1, (int)instance.Length); } + + /// + /// Test serialize a Pause to JSON string - all values are present + /// + [Fact] + public void PauseSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("length", json); + } + + /// + /// Test serialize a Pause to JSON string - null values are stripped + /// + [Fact] + public void PauseSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/PlayEarlyMediaTests.cs b/src/freeclimb.Test/Model/PlayEarlyMediaTests.cs index cc99e31b..e8585fdd 100644 --- a/src/freeclimb.Test/Model/PlayEarlyMediaTests.cs +++ b/src/freeclimb.Test/Model/PlayEarlyMediaTests.cs @@ -64,5 +64,26 @@ public void FileTest() instance.File = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.File); } + + /// + /// Test serialize a PlayEarlyMedia to JSON string - all values are present + /// + [Fact] + public void PlayEarlyMediaSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("file", json); + } + + /// + /// Test serialize a PlayEarlyMedia to JSON string - null values are stripped + /// + [Fact] + public void PlayEarlyMediaSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/PlayTests.cs b/src/freeclimb.Test/Model/PlayTests.cs index 9d34df32..5c5a321c 100644 --- a/src/freeclimb.Test/Model/PlayTests.cs +++ b/src/freeclimb.Test/Model/PlayTests.cs @@ -88,5 +88,30 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a Play to JSON string - all values are present + /// + [Fact] + public void PlaySerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("file", json); + + Assert.Contains("loop", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a Play to JSON string - null values are stripped + /// + [Fact] + public void PlaySerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueListTests.cs b/src/freeclimb.Test/Model/QueueListTests.cs index 57eb524a..db64eaf9 100644 --- a/src/freeclimb.Test/Model/QueueListTests.cs +++ b/src/freeclimb.Test/Model/QueueListTests.cs @@ -144,5 +144,56 @@ public void QueuesTest() instance.Queues = testList; Assert.Equal(instance.Queues, testList); } + + /// + /// Test serialize a QueueList to JSON string - all values are present + /// + [Fact] + public void QueueListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("queues", json); + } + + /// + /// Test serialize a QueueList to JSON string - null values are stripped + /// + [Fact] + public void QueueListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Queues = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueMemberListTests.cs b/src/freeclimb.Test/Model/QueueMemberListTests.cs index fa664068..1ebb4ee4 100644 --- a/src/freeclimb.Test/Model/QueueMemberListTests.cs +++ b/src/freeclimb.Test/Model/QueueMemberListTests.cs @@ -144,5 +144,56 @@ public void QueueMembersTest() instance.QueueMembers = testList; Assert.Equal(instance.QueueMembers, testList); } + + /// + /// Test serialize a QueueMemberList to JSON string - all values are present + /// + [Fact] + public void QueueMemberListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("queueMembers", json); + } + + /// + /// Test serialize a QueueMemberList to JSON string - null values are stripped + /// + [Fact] + public void QueueMemberListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.QueueMembers = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueMemberTests.cs b/src/freeclimb.Test/Model/QueueMemberTests.cs index f6791be5..1eb0eda7 100644 --- a/src/freeclimb.Test/Model/QueueMemberTests.cs +++ b/src/freeclimb.Test/Model/QueueMemberTests.cs @@ -110,5 +110,44 @@ public void DateEnqueuedTest() instance.DateEnqueued = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.DateEnqueued); } + + /// + /// Test serialize a QueueMember to JSON string - all values are present + /// + [Fact] + public void QueueMemberSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("callId", json); + + Assert.Contains("waitTime", json); + + Assert.Contains("position", json); + + Assert.Contains("dateEnqueued", json); + } + + /// + /// Test serialize a QueueMember to JSON string - null values are stripped + /// + [Fact] + public void QueueMemberSerializeToJSONStripNullTest() + { + instance.Uri = null; + + instance.CallId = null; + + instance.WaitTime = null; + + instance.Position = null; + + instance.DateEnqueued = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueRequestTests.cs b/src/freeclimb.Test/Model/QueueRequestTests.cs index d5784ad2..6e9a8070 100644 --- a/src/freeclimb.Test/Model/QueueRequestTests.cs +++ b/src/freeclimb.Test/Model/QueueRequestTests.cs @@ -77,5 +77,28 @@ public void MaxSizeTest() instance.MaxSize = 1; Assert.Equal(1, (int)instance.MaxSize); } + + /// + /// Test serialize a QueueRequest to JSON string - all values are present + /// + [Fact] + public void QueueRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("alias", json); + + Assert.Contains("maxSize", json); + } + + /// + /// Test serialize a QueueRequest to JSON string - null values are stripped + /// + [Fact] + public void QueueRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueResultTests.cs b/src/freeclimb.Test/Model/QueueResultTests.cs index ee27bbff..1032ce84 100644 --- a/src/freeclimb.Test/Model/QueueResultTests.cs +++ b/src/freeclimb.Test/Model/QueueResultTests.cs @@ -177,5 +177,60 @@ public void SubresourceUrisTest() instance.SubresourceUris = testObject; Assert.Equal(testObject, instance.SubresourceUris); } + + /// + /// Test serialize a QueueResult to JSON string - all values are present + /// + [Fact] + public void QueueResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("accountId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("alias", json); + + Assert.Contains("maxSize", json); + + Assert.Contains("currentSize", json); + + Assert.Contains("averageQueueRemovalTime", json); + + Assert.Contains("subresourceUris", json); + } + + /// + /// Test serialize a QueueResult to JSON string - null values are stripped + /// + [Fact] + public void QueueResultSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.QueueId = null; + + instance.Alias = null; + + instance.MaxSize = null; + + instance.CurrentSize = null; + + instance.AverageQueueRemovalTime = null; + + instance.SubresourceUris = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/QueueWaitWebhookTests.cs b/src/freeclimb.Test/Model/QueueWaitWebhookTests.cs index 05b9d4ed..b85f77c7 100644 --- a/src/freeclimb.Test/Model/QueueWaitWebhookTests.cs +++ b/src/freeclimb.Test/Model/QueueWaitWebhookTests.cs @@ -210,5 +210,56 @@ public void TestDeserializeJsonToQueueWaitWebhook() Assert.IsType(deserialized); Assert.Equal("queueWait", deserialized.RequestType); } + + /// + /// Test serialize a QueueWaitWebhook to JSON string - all values are present + /// + [Fact] + public void QueueWaitWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("queuePosition", json); + + Assert.Contains("queueTime", json); + + Assert.Contains("currentQueueSize", json); + } + + /// + /// Test serialize a QueueWaitWebhook to JSON string - null values are stripped + /// + [Fact] + public void QueueWaitWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RecordUtteranceTests.cs b/src/freeclimb.Test/Model/RecordUtteranceTests.cs index 6ce0f629..58712570 100644 --- a/src/freeclimb.Test/Model/RecordUtteranceTests.cs +++ b/src/freeclimb.Test/Model/RecordUtteranceTests.cs @@ -132,5 +132,38 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a RecordUtterance to JSON string - all values are present + /// + [Fact] + public void RecordUtteranceSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("silenceTimeoutMs", json); + + Assert.Contains("finishOnKey", json); + + Assert.Contains("maxLengthSec", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("autoStart", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a RecordUtterance to JSON string - null values are stripped + /// + [Fact] + public void RecordUtteranceSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RecordWebhookTests.cs b/src/freeclimb.Test/Model/RecordWebhookTests.cs index 3fd73f3b..f71f4d0d 100644 --- a/src/freeclimb.Test/Model/RecordWebhookTests.cs +++ b/src/freeclimb.Test/Model/RecordWebhookTests.cs @@ -272,5 +272,66 @@ public void TestDeserializeJsonToRecordWebhook() Assert.IsType(deserialized); Assert.Equal("record", deserialized.RequestType); } + + /// + /// Test serialize a RecordWebhook to JSON string - all values are present + /// + [Fact] + public void RecordWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingSize", json); + + Assert.Contains("recordingFormat", json); + + Assert.Contains("recordingDurationSec", json); + + Assert.Contains("termReason", json); + + Assert.Contains("parentCallId", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a RecordWebhook to JSON string - null values are stripped + /// + [Fact] + public void RecordWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RecordingListTests.cs b/src/freeclimb.Test/Model/RecordingListTests.cs index fa78a148..111e0e04 100644 --- a/src/freeclimb.Test/Model/RecordingListTests.cs +++ b/src/freeclimb.Test/Model/RecordingListTests.cs @@ -145,5 +145,56 @@ public void RecordingsTest() instance.Recordings = testList; Assert.Equal(instance.Recordings, testList); } + + /// + /// Test serialize a RecordingList to JSON string - all values are present + /// + [Fact] + public void RecordingListSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("recordings", json); + } + + /// + /// Test serialize a RecordingList to JSON string - null values are stripped + /// + [Fact] + public void RecordingListSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Recordings = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RecordingResultTests.cs b/src/freeclimb.Test/Model/RecordingResultTests.cs index b937c537..326a294b 100644 --- a/src/freeclimb.Test/Model/RecordingResultTests.cs +++ b/src/freeclimb.Test/Model/RecordingResultTests.cs @@ -154,5 +154,52 @@ public void ConferenceIdTest() instance.ConferenceId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.ConferenceId); } + + /// + /// Test serialize a RecordingResult to JSON string - all values are present + /// + [Fact] + public void RecordingResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("uri", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("durationSec", json); + + Assert.Contains("conferenceId", json); + } + + /// + /// Test serialize a RecordingResult to JSON string - null values are stripped + /// + [Fact] + public void RecordingResultSerializeToJSONStripNullTest() + { + instance.RecordingId = null; + + instance.AccountId = null; + + instance.CallId = null; + + instance.DurationSec = null; + + instance.ConferenceId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RedirectTests.cs b/src/freeclimb.Test/Model/RedirectTests.cs index d3500084..f139163c 100644 --- a/src/freeclimb.Test/Model/RedirectTests.cs +++ b/src/freeclimb.Test/Model/RedirectTests.cs @@ -64,5 +64,26 @@ public void ActionUrlTest() instance.ActionUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.ActionUrl); } + + /// + /// Test serialize a Redirect to JSON string - all values are present + /// + [Fact] + public void RedirectSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + } + + /// + /// Test serialize a Redirect to JSON string - null values are stripped + /// + [Fact] + public void RedirectSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RedirectWebhookTests.cs b/src/freeclimb.Test/Model/RedirectWebhookTests.cs index b39cd621..1ee9fb23 100644 --- a/src/freeclimb.Test/Model/RedirectWebhookTests.cs +++ b/src/freeclimb.Test/Model/RedirectWebhookTests.cs @@ -188,5 +188,52 @@ public void TestDeserializeJsonToRedirectWebhook() Assert.IsType(deserialized); Assert.Equal("redirect", deserialized.RequestType); } + + /// + /// Test serialize a RedirectWebhook to JSON string - all values are present + /// + [Fact] + public void RedirectWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("parentCallId", json); + } + + /// + /// Test serialize a RedirectWebhook to JSON string - null values are stripped + /// + [Fact] + public void RedirectWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RejectTests.cs b/src/freeclimb.Test/Model/RejectTests.cs index f7c62963..2cdd3d8b 100644 --- a/src/freeclimb.Test/Model/RejectTests.cs +++ b/src/freeclimb.Test/Model/RejectTests.cs @@ -64,5 +64,26 @@ public void ReasonTest() instance.Reason = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.Reason); } + + /// + /// Test serialize a Reject to JSON string - all values are present + /// + [Fact] + public void RejectSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("reason", json); + } + + /// + /// Test serialize a Reject to JSON string - null values are stripped + /// + [Fact] + public void RejectSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RemoveFromConferenceTests.cs b/src/freeclimb.Test/Model/RemoveFromConferenceTests.cs index 204f2732..24d0e790 100644 --- a/src/freeclimb.Test/Model/RemoveFromConferenceTests.cs +++ b/src/freeclimb.Test/Model/RemoveFromConferenceTests.cs @@ -54,5 +54,24 @@ public void RemoveFromConferenceInstanceTest() { Assert.IsType(instance); } + + /// + /// Test serialize a RemoveFromConference to JSON string - all values are present + /// + [Fact] + public void RemoveFromConferenceSerializeToJSONTest() + { + string json = instance.ToJson(); + } + + /// + /// Test serialize a RemoveFromConference to JSON string - null values are stripped + /// + [Fact] + public void RemoveFromConferenceSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/RemoveFromQueueNotificationWebhookTests.cs b/src/freeclimb.Test/Model/RemoveFromQueueNotificationWebhookTests.cs index f5e26642..45bb2d50 100644 --- a/src/freeclimb.Test/Model/RemoveFromQueueNotificationWebhookTests.cs +++ b/src/freeclimb.Test/Model/RemoveFromQueueNotificationWebhookTests.cs @@ -206,5 +206,54 @@ public void TestDeserializeJsonToRemoveFromQueueNotificationWebhook() Assert.IsType(deserialized); Assert.Equal("removeFromQueueNotification", deserialized.RequestType); } + + /// + /// Test serialize a RemoveFromQueueNotificationWebhook to JSON string - all values are present + /// + [Fact] + public void RemoveFromQueueNotificationWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("callStatus", json); + + Assert.Contains("direction", json); + + Assert.Contains("conferenceId", json); + + Assert.Contains("queueId", json); + + Assert.Contains("queueResult", json); + + Assert.Contains("queueTime", json); + } + + /// + /// Test serialize a RemoveFromQueueNotificationWebhook to JSON string - null values are stripped + /// + [Fact] + public void RemoveFromQueueNotificationWebhookSerializeToJSONStripNullTest() + { + instance.CallStatus = null; + + instance.Direction = null; + + instance.ConferenceId = null; + + instance.QueueId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCBrandTests.cs b/src/freeclimb.Test/Model/SMSTenDLCBrandTests.cs index 449dac15..bd14189f 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCBrandTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCBrandTests.cs @@ -452,5 +452,82 @@ public void CreateDateTest() instance.CreateDate = DateTime.Parse("2022-07-05T15:17:05+00:00"); Assert.Equal(DateTime.Parse("2022-07-05T15:17:05+00:00"), instance.CreateDate); } + + /// + /// Test serialize a SMSTenDLCBrand to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCBrandSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("entityType", json); + + Assert.Contains("firstName", json); + + Assert.Contains("lastName", json); + + Assert.Contains("displayName", json); + + Assert.Contains("companyName", json); + + Assert.Contains("ein", json); + + Assert.Contains("einIssuingCountry", json); + + Assert.Contains("phone", json); + + Assert.Contains("street", json); + + Assert.Contains("city", json); + + Assert.Contains("state", json); + + Assert.Contains("postalCode", json); + + Assert.Contains("country", json); + + Assert.Contains("email", json); + + Assert.Contains("stockSymbol", json); + + Assert.Contains("stockExchange", json); + + Assert.Contains("ipAddress", json); + + Assert.Contains("website", json); + + Assert.Contains("brandRelationship", json); + + Assert.Contains("vertical", json); + + Assert.Contains("altBusinessId", json); + + Assert.Contains("altBusinessIdType", json); + + Assert.Contains("referenceId", json); + + Assert.Contains("optionalAttributes", json); + + Assert.Contains("mock", json); + + Assert.Contains("identityStatus", json); + + Assert.Contains("createDate", json); + } + + /// + /// Test serialize a SMSTenDLCBrand to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCBrandSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCBrandsListResultTests.cs b/src/freeclimb.Test/Model/SMSTenDLCBrandsListResultTests.cs index 09c52aab..058c1f34 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCBrandsListResultTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCBrandsListResultTests.cs @@ -144,5 +144,56 @@ public void BrandsTest() instance.Brands = testList; Assert.Equal(instance.Brands, testList); } + + /// + /// Test serialize a SMSTenDLCBrandsListResult to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCBrandsListResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("brands", json); + } + + /// + /// Test serialize a SMSTenDLCBrandsListResult to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCBrandsListResultSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Brands = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCCampaignTests.cs b/src/freeclimb.Test/Model/SMSTenDLCCampaignTests.cs index 9c97f546..f6690a1f 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCCampaignTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCCampaignTests.cs @@ -460,5 +460,118 @@ public void NextRenewalOrExpirationDateTest() instance.NextRenewalOrExpirationDate ); } + + /// + /// Test serialize a SMSTenDLCCampaign to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCCampaignSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("cspId", json); + + Assert.Contains("resellerId", json); + + Assert.Contains("status", json); + + Assert.Contains("createDate", json); + + Assert.Contains("autoRenewal", json); + + Assert.Contains("billedDate", json); + + Assert.Contains("brandId", json); + + Assert.Contains("usecase", json); + + Assert.Contains("subUsecases", json); + + Assert.Contains("description", json); + + Assert.Contains("embeddedLink", json); + + Assert.Contains("embeddedPhone", json); + + Assert.Contains("affiliateMarketing", json); + + Assert.Contains("numberPool", json); + + Assert.Contains("ageGated", json); + + Assert.Contains("directLending", json); + + Assert.Contains("subscriberOptin", json); + + Assert.Contains("subscriberOptout", json); + + Assert.Contains("subscriberHelp", json); + + Assert.Contains("sample1", json); + + Assert.Contains("sample2", json); + + Assert.Contains("sample3", json); + + Assert.Contains("sample4", json); + + Assert.Contains("sample5", json); + + Assert.Contains("messageFlow", json); + + Assert.Contains("helpMessage", json); + + Assert.Contains("optinKeywords", json); + + Assert.Contains("optoutKeywords", json); + + Assert.Contains("helpKeywords", json); + + Assert.Contains("optinMessage", json); + + Assert.Contains("optoutMessage", json); + + Assert.Contains("referenceId", json); + + Assert.Contains("mock", json); + + Assert.Contains("nextRenewalOrExpirationDate", json); + } + + /// + /// Test serialize a SMSTenDLCCampaign to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCCampaignSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.ResellerId = null; + + instance.BilledDate = null; + + instance.Sample2 = null; + + instance.Sample3 = null; + + instance.Sample4 = null; + + instance.Sample5 = null; + + instance.MessageFlow = null; + + instance.HelpMessage = null; + + instance.ReferenceId = null; + + instance.NextRenewalOrExpirationDate = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCCampaignsListResultTests.cs b/src/freeclimb.Test/Model/SMSTenDLCCampaignsListResultTests.cs index 166be046..986332ef 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCCampaignsListResultTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCCampaignsListResultTests.cs @@ -145,5 +145,56 @@ public void CampaignsTest() instance.Campaigns = testList; Assert.Equal(instance.Campaigns, testList); } + + /// + /// Test serialize a SMSTenDLCCampaignsListResult to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCCampaignsListResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("campaigns", json); + } + + /// + /// Test serialize a SMSTenDLCCampaignsListResult to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCCampaignsListResultSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Campaigns = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignBrandTests.cs b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignBrandTests.cs index 0b99a47e..8c992bbc 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignBrandTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignBrandTests.cs @@ -169,5 +169,46 @@ public void EvpVettingScoreTest() instance.EvpVettingScore = 1; Assert.Equal(1, (int)instance.EvpVettingScore); } + + /// + /// Test serialize a SMSTenDLCPartnerCampaignBrand to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCPartnerCampaignBrandSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("firstName", json); + + Assert.Contains("lastName", json); + + Assert.Contains("displayName", json); + + Assert.Contains("companyName", json); + + Assert.Contains("phone", json); + + Assert.Contains("email", json); + + Assert.Contains("website", json); + + Assert.Contains("optionalAttributes", json); + + Assert.Contains("evpVettingScore", json); + } + + /// + /// Test serialize a SMSTenDLCPartnerCampaignBrand to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCPartnerCampaignBrandSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignTests.cs b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignTests.cs index 13cb01c5..c3385adb 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignTests.cs @@ -380,5 +380,96 @@ public void BrandTest() instance.Brand = testObject; Assert.Equal(testObject, instance.Brand); } + + /// + /// Test serialize a SMSTenDLCPartnerCampaign to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCPartnerCampaignSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("status", json); + + Assert.Contains("createDate", json); + + Assert.Contains("brandId", json); + + Assert.Contains("usecase", json); + + Assert.Contains("description", json); + + Assert.Contains("embeddedLink", json); + + Assert.Contains("embeddedPhone", json); + + Assert.Contains("affiliateMarketing", json); + + Assert.Contains("numberPool", json); + + Assert.Contains("ageGated", json); + + Assert.Contains("directLending", json); + + Assert.Contains("subscriberOptin", json); + + Assert.Contains("subscriberOptout", json); + + Assert.Contains("subscriberHelp", json); + + Assert.Contains("sample1", json); + + Assert.Contains("sample2", json); + + Assert.Contains("sample3", json); + + Assert.Contains("sample4", json); + + Assert.Contains("sample5", json); + + Assert.Contains("messageFlow", json); + + Assert.Contains("helpMessage", json); + + Assert.Contains("optinKeywords", json); + + Assert.Contains("optoutKeywords", json); + + Assert.Contains("helpKeywords", json); + + Assert.Contains("optinMessage", json); + + Assert.Contains("optoutMessage", json); + + Assert.Contains("brand", json); + } + + /// + /// Test serialize a SMSTenDLCPartnerCampaign to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCPartnerCampaignSerializeToJSONStripNullTest() + { + instance.AccountId = null; + + instance.Sample2 = null; + + instance.Sample3 = null; + + instance.Sample4 = null; + + instance.Sample5 = null; + + instance.MessageFlow = null; + + instance.HelpMessage = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignsListResultTests.cs b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignsListResultTests.cs index 3af5ef10..c5f4b907 100644 --- a/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignsListResultTests.cs +++ b/src/freeclimb.Test/Model/SMSTenDLCPartnerCampaignsListResultTests.cs @@ -145,5 +145,56 @@ public void PartnerCampaignsTest() instance.PartnerCampaigns = testList; Assert.Equal(instance.PartnerCampaigns, testList); } + + /// + /// Test serialize a SMSTenDLCPartnerCampaignsListResult to JSON string - all values are present + /// + [Fact] + public void SMSTenDLCPartnerCampaignsListResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("partnerCampaigns", json); + } + + /// + /// Test serialize a SMSTenDLCPartnerCampaignsListResult to JSON string - null values are stripped + /// + [Fact] + public void SMSTenDLCPartnerCampaignsListResultSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.PartnerCampaigns = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTollFreeCampaignTests.cs b/src/freeclimb.Test/Model/SMSTollFreeCampaignTests.cs index afb9bc40..b1e7e50e 100644 --- a/src/freeclimb.Test/Model/SMSTollFreeCampaignTests.cs +++ b/src/freeclimb.Test/Model/SMSTollFreeCampaignTests.cs @@ -156,5 +156,38 @@ public void RevisionTest() instance.Revision = 1; Assert.Equal(1, (int)instance.Revision); } + + /// + /// Test serialize a SMSTollFreeCampaign to JSON string - all values are present + /// + [Fact] + public void SMSTollFreeCampaignSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("useCase", json); + + Assert.Contains("registrationStatus", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("revision", json); + } + + /// + /// Test serialize a SMSTollFreeCampaign to JSON string - null values are stripped + /// + [Fact] + public void SMSTollFreeCampaignSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SMSTollFreeCampaignsListResultTests.cs b/src/freeclimb.Test/Model/SMSTollFreeCampaignsListResultTests.cs index a36ab203..79013580 100644 --- a/src/freeclimb.Test/Model/SMSTollFreeCampaignsListResultTests.cs +++ b/src/freeclimb.Test/Model/SMSTollFreeCampaignsListResultTests.cs @@ -145,5 +145,56 @@ public void BrandsTest() instance.Brands = testList; Assert.Equal(instance.Brands, testList); } + + /// + /// Test serialize a SMSTollFreeCampaignsListResult to JSON string - all values are present + /// + [Fact] + public void SMSTollFreeCampaignsListResultSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("total", json); + + Assert.Contains("start", json); + + Assert.Contains("end", json); + + Assert.Contains("page", json); + + Assert.Contains("numPages", json); + + Assert.Contains("pageSize", json); + + Assert.Contains("nextPageUri", json); + + Assert.Contains("brands", json); + } + + /// + /// Test serialize a SMSTollFreeCampaignsListResult to JSON string - null values are stripped + /// + [Fact] + public void SMSTollFreeCampaignsListResultSerializeToJSONStripNullTest() + { + instance.Total = null; + + instance.Start = null; + + instance.End = null; + + instance.Page = null; + + instance.NumPages = null; + + instance.PageSize = null; + + instance.NextPageUri = null; + + instance.Brands = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SayTests.cs b/src/freeclimb.Test/Model/SayTests.cs index 4c5bfecf..ecc42ad6 100644 --- a/src/freeclimb.Test/Model/SayTests.cs +++ b/src/freeclimb.Test/Model/SayTests.cs @@ -99,5 +99,32 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a Say to JSON string - all values are present + /// + [Fact] + public void SaySerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("text", json); + + Assert.Contains("language", json); + + Assert.Contains("loop", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a Say to JSON string - null values are stripped + /// + [Fact] + public void SaySerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SendDigitsTests.cs b/src/freeclimb.Test/Model/SendDigitsTests.cs index ee8da357..81d27a1f 100644 --- a/src/freeclimb.Test/Model/SendDigitsTests.cs +++ b/src/freeclimb.Test/Model/SendDigitsTests.cs @@ -88,5 +88,30 @@ public void PrivacyModeTest() instance.PrivacyMode = false; Assert.False(instance.PrivacyMode); } + + /// + /// Test serialize a SendDigits to JSON string - all values are present + /// + [Fact] + public void SendDigitsSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("digits", json); + + Assert.Contains("pauseMs", json); + + Assert.Contains("privacyMode", json); + } + + /// + /// Test serialize a SendDigits to JSON string - null values are stripped + /// + [Fact] + public void SendDigitsSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SetDTMFPassThroughTests.cs b/src/freeclimb.Test/Model/SetDTMFPassThroughTests.cs index a5f42ea9..a64c7842 100644 --- a/src/freeclimb.Test/Model/SetDTMFPassThroughTests.cs +++ b/src/freeclimb.Test/Model/SetDTMFPassThroughTests.cs @@ -66,5 +66,26 @@ public void DtmfPassThroughTest() instance.DtmfPassThrough = false; Assert.False(instance.DtmfPassThrough); } + + /// + /// Test serialize a SetDTMFPassThrough to JSON string - all values are present + /// + [Fact] + public void SetDTMFPassThroughSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("dtmfPassThrough", json); + } + + /// + /// Test serialize a SetDTMFPassThrough to JSON string - null values are stripped + /// + [Fact] + public void SetDTMFPassThroughSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SetListenTests.cs b/src/freeclimb.Test/Model/SetListenTests.cs index 07cb5526..4900dc60 100644 --- a/src/freeclimb.Test/Model/SetListenTests.cs +++ b/src/freeclimb.Test/Model/SetListenTests.cs @@ -64,5 +64,26 @@ public void ListenTest() instance.Listen = false; Assert.False(instance.Listen); } + + /// + /// Test serialize a SetListen to JSON string - all values are present + /// + [Fact] + public void SetListenSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("listen", json); + } + + /// + /// Test serialize a SetListen to JSON string - null values are stripped + /// + [Fact] + public void SetListenSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SetTalkTests.cs b/src/freeclimb.Test/Model/SetTalkTests.cs index 01b73dee..e70b8478 100644 --- a/src/freeclimb.Test/Model/SetTalkTests.cs +++ b/src/freeclimb.Test/Model/SetTalkTests.cs @@ -64,5 +64,26 @@ public void TalkTest() instance.Talk = false; Assert.False(instance.Talk); } + + /// + /// Test serialize a SetTalk to JSON string - all values are present + /// + [Fact] + public void SetTalkSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("talk", json); + } + + /// + /// Test serialize a SetTalk to JSON string - null values are stripped + /// + [Fact] + public void SetTalkSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/SmsTests.cs b/src/freeclimb.Test/Model/SmsTests.cs index 60ce299e..24448b3d 100644 --- a/src/freeclimb.Test/Model/SmsTests.cs +++ b/src/freeclimb.Test/Model/SmsTests.cs @@ -99,5 +99,32 @@ public void NotificationUrlTest() instance.NotificationUrl = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.NotificationUrl); } + + /// + /// Test serialize a Sms to JSON string - all values are present + /// + [Fact] + public void SmsSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("to", json); + + Assert.Contains("from", json); + + Assert.Contains("text", json); + + Assert.Contains("notificationUrl", json); + } + + /// + /// Test serialize a Sms to JSON string - null values are stripped + /// + [Fact] + public void SmsSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/StartRecordCallTests.cs b/src/freeclimb.Test/Model/StartRecordCallTests.cs index 2b5161c7..bea3b1a5 100644 --- a/src/freeclimb.Test/Model/StartRecordCallTests.cs +++ b/src/freeclimb.Test/Model/StartRecordCallTests.cs @@ -54,5 +54,24 @@ public void StartRecordCallInstanceTest() { Assert.IsType(instance); } + + /// + /// Test serialize a StartRecordCall to JSON string - all values are present + /// + [Fact] + public void StartRecordCallSerializeToJSONTest() + { + string json = instance.ToJson(); + } + + /// + /// Test serialize a StartRecordCall to JSON string - null values are stripped + /// + [Fact] + public void StartRecordCallSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TFNCampaignTests.cs b/src/freeclimb.Test/Model/TFNCampaignTests.cs index 3cfa3030..5679a81e 100644 --- a/src/freeclimb.Test/Model/TFNCampaignTests.cs +++ b/src/freeclimb.Test/Model/TFNCampaignTests.cs @@ -178,5 +178,42 @@ public void RevisionTest() instance.Revision = 1; Assert.Equal(1, (int)instance.Revision); } + + /// + /// Test serialize a TFNCampaign to JSON string - all values are present + /// + [Fact] + public void TFNCampaignSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("accountId", json); + + Assert.Contains("campaignId", json); + + Assert.Contains("useCase", json); + + Assert.Contains("registrationStatus", json); + + Assert.Contains("dateCreated", json); + + Assert.Contains("dateUpdated", json); + + Assert.Contains("dateCreatedISO", json); + + Assert.Contains("dateUpdatedISO", json); + + Assert.Contains("revision", json); + } + + /// + /// Test serialize a TFNCampaign to JSON string - null values are stripped + /// + [Fact] + public void TFNCampaignSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TFNTests.cs b/src/freeclimb.Test/Model/TFNTests.cs index 2704204d..92a08eec 100644 --- a/src/freeclimb.Test/Model/TFNTests.cs +++ b/src/freeclimb.Test/Model/TFNTests.cs @@ -64,5 +64,26 @@ public void CampaignIdTest() instance.CampaignId = "TEST_STRING"; Assert.Equal("TEST_STRING", instance.CampaignId); } + + /// + /// Test serialize a TFN to JSON string - all values are present + /// + [Fact] + public void TFNSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("campaignId", json); + } + + /// + /// Test serialize a TFN to JSON string - null values are stripped + /// + [Fact] + public void TFNSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TerminateConferenceTests.cs b/src/freeclimb.Test/Model/TerminateConferenceTests.cs index 00bd7bb7..f53cfbdd 100644 --- a/src/freeclimb.Test/Model/TerminateConferenceTests.cs +++ b/src/freeclimb.Test/Model/TerminateConferenceTests.cs @@ -54,5 +54,24 @@ public void TerminateConferenceInstanceTest() { Assert.IsType(instance); } + + /// + /// Test serialize a TerminateConference to JSON string - all values are present + /// + [Fact] + public void TerminateConferenceSerializeToJSONTest() + { + string json = instance.ToJson(); + } + + /// + /// Test serialize a TerminateConference to JSON string - null values are stripped + /// + [Fact] + public void TerminateConferenceSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TranscribeUtteranceRecordTests.cs b/src/freeclimb.Test/Model/TranscribeUtteranceRecordTests.cs index aae1b2e6..62298932 100644 --- a/src/freeclimb.Test/Model/TranscribeUtteranceRecordTests.cs +++ b/src/freeclimb.Test/Model/TranscribeUtteranceRecordTests.cs @@ -88,5 +88,30 @@ public void RcrdTerminationSilenceTimeMsTest() instance.RcrdTerminationSilenceTimeMs = 1; Assert.Equal(1, (int)instance.RcrdTerminationSilenceTimeMs); } + + /// + /// Test serialize a TranscribeUtteranceRecord to JSON string - all values are present + /// + [Fact] + public void TranscribeUtteranceRecordSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("saveRecording", json); + + Assert.Contains("maxLengthSec", json); + + Assert.Contains("rcrdTerminationSilenceTimeMs", json); + } + + /// + /// Test serialize a TranscribeUtteranceRecord to JSON string - null values are stripped + /// + [Fact] + public void TranscribeUtteranceRecordSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TranscribeUtteranceTests.cs b/src/freeclimb.Test/Model/TranscribeUtteranceTests.cs index 30e295a5..984b744e 100644 --- a/src/freeclimb.Test/Model/TranscribeUtteranceTests.cs +++ b/src/freeclimb.Test/Model/TranscribeUtteranceTests.cs @@ -125,5 +125,36 @@ public void PromptsTest() instance.Prompts = testList; Assert.Equal(instance.Prompts, testList); } + + /// + /// Test serialize a TranscribeUtterance to JSON string - all values are present + /// + [Fact] + public void TranscribeUtteranceSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("actionUrl", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("record", json); + + Assert.Contains("privacyForLogging", json); + + Assert.Contains("privacyForRecording", json); + + Assert.Contains("prompts", json); + } + + /// + /// Test serialize a TranscribeUtterance to JSON string - null values are stripped + /// + [Fact] + public void TranscribeUtteranceSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/TranscribeWebhookTests.cs b/src/freeclimb.Test/Model/TranscribeWebhookTests.cs index 1bf5ad24..e76fd14a 100644 --- a/src/freeclimb.Test/Model/TranscribeWebhookTests.cs +++ b/src/freeclimb.Test/Model/TranscribeWebhookTests.cs @@ -336,5 +336,80 @@ public void TestDeserializeJsonToTranscribeWebhook() Assert.IsType(deserialized); Assert.Equal("transcribe", deserialized.RequestType); } + + /// + /// Test serialize a TranscribeWebhook to JSON string - all values are present + /// + [Fact] + public void TranscribeWebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + + Assert.Contains("accountId", json); + + Assert.Contains("callId", json); + + Assert.Contains("from", json); + + Assert.Contains("to", json); + + Assert.Contains("recordingId", json); + + Assert.Contains("recordingUrl", json); + + Assert.Contains("recordingSize", json); + + Assert.Contains("recordingFormat", json); + + Assert.Contains("recordingDurationMs", json); + + Assert.Contains("termReason", json); + + Assert.Contains("recordTermReason", json); + + Assert.Contains("digit", json); + + Assert.Contains("privacyForLogging", json); + + Assert.Contains("privacyForRecording", json); + + Assert.Contains("bargeInReason", json); + + Assert.Contains("bargedInPromptNo", json); + + Assert.Contains("bargedInPromptMs", json); + + Assert.Contains("bargedInPromptLoopNo", json); + + Assert.Contains("bargeInTimeMs", json); + + Assert.Contains("transcript", json); + + Assert.Contains("transcribeReason", json); + + Assert.Contains("transcriptionDurationMs", json); + } + + /// + /// Test serialize a TranscribeWebhook to JSON string - null values are stripped + /// + [Fact] + public void TranscribeWebhookSerializeToJSONStripNullTest() + { + instance.RecordingId = null; + + instance.RecordingUrl = null; + + instance.RecordingFormat = null; + + instance.Digit = null; + + instance.Transcript = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/UnparkTests.cs b/src/freeclimb.Test/Model/UnparkTests.cs index 31539fb4..8e20c65a 100644 --- a/src/freeclimb.Test/Model/UnparkTests.cs +++ b/src/freeclimb.Test/Model/UnparkTests.cs @@ -54,5 +54,24 @@ public void UnparkInstanceTest() { Assert.IsType(instance); } + + /// + /// Test serialize a Unpark to JSON string - all values are present + /// + [Fact] + public void UnparkSerializeToJSONTest() + { + string json = instance.ToJson(); + } + + /// + /// Test serialize a Unpark to JSON string - null values are stripped + /// + [Fact] + public void UnparkSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/UpdateCallRequestTests.cs b/src/freeclimb.Test/Model/UpdateCallRequestTests.cs index d85ef5f3..5adbf0b4 100644 --- a/src/freeclimb.Test/Model/UpdateCallRequestTests.cs +++ b/src/freeclimb.Test/Model/UpdateCallRequestTests.cs @@ -69,5 +69,26 @@ public void StatusTest() instance.Status = UpdateCallRequestStatus.COMPLETED; Assert.Equal(UpdateCallRequestStatus.COMPLETED, instance.Status); } + + /// + /// Test serialize a UpdateCallRequest to JSON string - all values are present + /// + [Fact] + public void UpdateCallRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("status", json); + } + + /// + /// Test serialize a UpdateCallRequest to JSON string - null values are stripped + /// + [Fact] + public void UpdateCallRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/UpdateConferenceParticipantRequestTests.cs b/src/freeclimb.Test/Model/UpdateConferenceParticipantRequestTests.cs index 4ea7b10f..226f9a83 100644 --- a/src/freeclimb.Test/Model/UpdateConferenceParticipantRequestTests.cs +++ b/src/freeclimb.Test/Model/UpdateConferenceParticipantRequestTests.cs @@ -88,5 +88,30 @@ public void DtmfPassThroughTest() instance.DtmfPassThrough = false; Assert.False(instance.DtmfPassThrough); } + + /// + /// Test serialize a UpdateConferenceParticipantRequest to JSON string - all values are present + /// + [Fact] + public void UpdateConferenceParticipantRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("talk", json); + + Assert.Contains("listen", json); + + Assert.Contains("dtmfPassThrough", json); + } + + /// + /// Test serialize a UpdateConferenceParticipantRequest to JSON string - null values are stripped + /// + [Fact] + public void UpdateConferenceParticipantRequestSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/UpdateConferenceRequestTests.cs b/src/freeclimb.Test/Model/UpdateConferenceRequestTests.cs index 5468b25f..dc4b59ea 100644 --- a/src/freeclimb.Test/Model/UpdateConferenceRequestTests.cs +++ b/src/freeclimb.Test/Model/UpdateConferenceRequestTests.cs @@ -97,5 +97,32 @@ public void StatusTest() instance.Status = UpdateConferenceRequestStatus.TERMINATED; Assert.Equal(UpdateConferenceRequestStatus.TERMINATED, instance.Status); } + + /// + /// Test serialize a UpdateConferenceRequest to JSON string - all values are present + /// + [Fact] + public void UpdateConferenceRequestSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("alias", json); + + Assert.Contains("playBeep", json); + + Assert.Contains("status", json); + } + + /// + /// Test serialize a UpdateConferenceRequest to JSON string - null values are stripped + /// + [Fact] + public void UpdateConferenceRequestSerializeToJSONStripNullTest() + { + instance.PlayBeep = null; + + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Model/WebhookTests.cs b/src/freeclimb.Test/Model/WebhookTests.cs index 69e8eefd..7757fdc7 100644 --- a/src/freeclimb.Test/Model/WebhookTests.cs +++ b/src/freeclimb.Test/Model/WebhookTests.cs @@ -319,5 +319,26 @@ public void TranscribeWebhookDeserializeFromWebhookTest() /// [Fact] public void RequestTypeTest() { } + + /// + /// Test serialize a Webhook to JSON string - all values are present + /// + [Fact] + public void WebhookSerializeToJSONTest() + { + string json = instance.ToJson(); + + Assert.Contains("requestType", json); + } + + /// + /// Test serialize a Webhook to JSON string - null values are stripped + /// + [Fact] + public void WebhookSerializeToJSONStripNullTest() + { + string json = instance.ToJson(); + Assert.DoesNotContain("null", json); + } } } diff --git a/src/freeclimb.Test/Utils/RequestVerifierTests.cs b/src/freeclimb.Test/Utils/RequestVerifierTests.cs index 6cdfa8ca..b1372c34 100644 --- a/src/freeclimb.Test/Utils/RequestVerifierTests.cs +++ b/src/freeclimb.Test/Utils/RequestVerifierTests.cs @@ -6,28 +6,11 @@ namespace freeclimb.Test.Utils { public class RequestVerifierTests : IDisposable { - private RequestVerifier instance; - - public RequestVerifierTests() - { - RequestVerifier instance = new RequestVerifier(); - } - public void Dispose() { // Cleanup when everything is done. } - /// - /// Test an instance of SignatureInformation - /// - [Fact] - public void RequestVerifierInstanceTests() - { - // TODO uncomment below to test "IsType" AccountRequest - //Assert.IsType(instance); - } - [Fact] public void checkRequestBodyTest() { diff --git a/src/freeclimb.Test/Utils/SignatureInformationTests.cs b/src/freeclimb.Test/Utils/SignatureInformationTests.cs index a8706e7b..d4053ac4 100644 --- a/src/freeclimb.Test/Utils/SignatureInformationTests.cs +++ b/src/freeclimb.Test/Utils/SignatureInformationTests.cs @@ -48,7 +48,7 @@ public void isRequestTimeValidTest() instance = new SignatureInformation(requestHeader); int tolerance = 5 * 60; Boolean isRequestTimeValid = instance.isRequestTimeValid(tolerance); - Assert.Equal(isRequestTimeValid, true); + Assert.True(isRequestTimeValid); } [Fact] @@ -62,7 +62,7 @@ public void isRequestTimeValidTest2() instance = new SignatureInformation(requestHeader); int tolerance = 500 * 60; Boolean isRequestTimeValid = instance.isRequestTimeValid(tolerance); - Assert.Equal(isRequestTimeValid, false); + Assert.False(isRequestTimeValid); } /// @@ -75,7 +75,7 @@ public void isSignatureSafeTest() "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}"; string signingSecret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793"; Boolean isSignatureSafe = instance.isSignatureSafe(requestBody, signingSecret); - Assert.Equal(isSignatureSafe, true); + Assert.True(isSignatureSafe); } [Fact] @@ -85,7 +85,7 @@ public void isSignatureSafeTest2() "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}"; string signingSecret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794"; Boolean isSignatureSafe = instance.isSignatureSafe(requestBody, signingSecret); - Assert.Equal(isSignatureSafe, false); + Assert.False(isSignatureSafe); } } } diff --git a/src/freeclimb/Client/Configuration.cs b/src/freeclimb/Client/Configuration.cs index 3a6f8389..55caa3b2 100644 --- a/src/freeclimb/Client/Configuration.cs +++ b/src/freeclimb/Client/Configuration.cs @@ -34,7 +34,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "5.1.1"; + public const string Version = "5.1.2"; /// /// Identifier for ISO 8601 DateTime Format @@ -130,7 +130,7 @@ private IReadOnlyDictionary< public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/5.1.1/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/5.1.2/csharp"); BasePath = "https://www.freeclimb.com/apiserver"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -582,7 +582,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 5.1.1\n"; + report += " SDK Package Version: 5.1.2\n"; return report; } diff --git a/src/freeclimb/Model/AccountRequest.cs b/src/freeclimb/Model/AccountRequest.cs index 0bb85451..72c04988 100644 --- a/src/freeclimb/Model/AccountRequest.cs +++ b/src/freeclimb/Model/AccountRequest.cs @@ -81,7 +81,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -92,11 +93,24 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("alias", Alias); - props.Add("label", Label); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "label", Label); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AccountResult.cs b/src/freeclimb/Model/AccountResult.cs index 79ee27cb..40ad5784 100644 --- a/src/freeclimb/Model/AccountResult.cs +++ b/src/freeclimb/Model/AccountResult.cs @@ -190,7 +190,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -201,20 +202,33 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("accountId", AccountId); - props.Add("apiKey", ApiKey); - props.Add("alias", Alias); - props.Add("label", Label); - props.Add("type", Type); - props.Add("status", Status); - props.Add("subresourceUris", SubresourceUris); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "apiKey", ApiKey); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "label", Label); + AddToDictionary(props, "type", Type); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "subresourceUris", SubresourceUris); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AddToConference.cs b/src/freeclimb/Model/AddToConference.cs index 1261cd3a..e18c80dd 100644 --- a/src/freeclimb/Model/AddToConference.cs +++ b/src/freeclimb/Model/AddToConference.cs @@ -197,13 +197,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -213,21 +211,34 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("allowCallControl", AllowCallControl); - props.Add("callControlSequence", CallControlSequence); - props.Add("callControlUrl", CallControlUrl); - props.Add("conferenceId", ConferenceId); - props.Add("leaveConferenceUrl", LeaveConferenceUrl); - props.Add("listen", Listen); - props.Add("notificationUrl", NotificationUrl); - props.Add("startConfOnEnter", StartConfOnEnter); - props.Add("talk", Talk); - props.Add("dtmfPassThrough", DtmfPassThrough); + AddToDictionary(props, "allowCallControl", AllowCallControl); + AddToDictionary(props, "callControlSequence", CallControlSequence); + AddToDictionary(props, "callControlUrl", CallControlUrl); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "leaveConferenceUrl", LeaveConferenceUrl); + AddToDictionary(props, "listen", Listen); + AddToDictionary(props, "notificationUrl", NotificationUrl); + AddToDictionary(props, "startConfOnEnter", StartConfOnEnter); + AddToDictionary(props, "talk", Talk); + AddToDictionary(props, "dtmfPassThrough", DtmfPassThrough); IDictionary command = new Dictionary(); command.Add("AddToConference", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AddToConferenceNotificationWebhook.cs b/src/freeclimb/Model/AddToConferenceNotificationWebhook.cs index 55ac88f4..9929937c 100644 --- a/src/freeclimb/Model/AddToConferenceNotificationWebhook.cs +++ b/src/freeclimb/Model/AddToConferenceNotificationWebhook.cs @@ -237,7 +237,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -248,22 +249,35 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("status", Status); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingId", RecordingId); - props.Add("recordingDurationSec", RecordingDurationSec); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingDurationSec", RecordingDurationSec); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AddToQueueNotificationWebhook.cs b/src/freeclimb/Model/AddToQueueNotificationWebhook.cs index cc0b6eff..b8fe3109 100644 --- a/src/freeclimb/Model/AddToQueueNotificationWebhook.cs +++ b/src/freeclimb/Model/AddToQueueNotificationWebhook.cs @@ -190,7 +190,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -201,18 +202,31 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ApplicationList.cs b/src/freeclimb/Model/ApplicationList.cs index d1e30cc8..3face532 100644 --- a/src/freeclimb/Model/ApplicationList.cs +++ b/src/freeclimb/Model/ApplicationList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Applications) + if (Applications != null) { - nested.Add(item); + foreach (var item in Applications) + { + nested.Add(item.ToKvp()); + } } - props.Add("applications", nested); + AddToDictionary(props, "applications", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ApplicationRequest.cs b/src/freeclimb/Model/ApplicationRequest.cs index 724b691e..41a3af61 100644 --- a/src/freeclimb/Model/ApplicationRequest.cs +++ b/src/freeclimb/Model/ApplicationRequest.cs @@ -144,7 +144,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -155,16 +156,29 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("alias", Alias); - props.Add("voiceUrl", VoiceUrl); - props.Add("voiceFallbackUrl", VoiceFallbackUrl); - props.Add("callConnectUrl", CallConnectUrl); - props.Add("statusCallbackUrl", StatusCallbackUrl); - props.Add("smsUrl", SmsUrl); - props.Add("smsFallbackUrl", SmsFallbackUrl); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "voiceUrl", VoiceUrl); + AddToDictionary(props, "voiceFallbackUrl", VoiceFallbackUrl); + AddToDictionary(props, "callConnectUrl", CallConnectUrl); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "smsUrl", SmsUrl); + AddToDictionary(props, "smsFallbackUrl", SmsFallbackUrl); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ApplicationResult.cs b/src/freeclimb/Model/ApplicationResult.cs index b87718aa..2331da32 100644 --- a/src/freeclimb/Model/ApplicationResult.cs +++ b/src/freeclimb/Model/ApplicationResult.cs @@ -216,7 +216,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -227,22 +228,35 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("accountId", AccountId); - props.Add("applicationId", ApplicationId); - props.Add("alias", Alias); - props.Add("voiceUrl", VoiceUrl); - props.Add("voiceFallbackUrl", VoiceFallbackUrl); - props.Add("callConnectUrl", CallConnectUrl); - props.Add("statusCallbackUrl", StatusCallbackUrl); - props.Add("smsUrl", SmsUrl); - props.Add("smsFallbackUrl", SmsFallbackUrl); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "voiceUrl", VoiceUrl); + AddToDictionary(props, "voiceFallbackUrl", VoiceFallbackUrl); + AddToDictionary(props, "callConnectUrl", CallConnectUrl); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "smsUrl", SmsUrl); + AddToDictionary(props, "smsFallbackUrl", SmsFallbackUrl); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AvailableNumber.cs b/src/freeclimb/Model/AvailableNumber.cs index b61f3b2c..032ff128 100644 --- a/src/freeclimb/Model/AvailableNumber.cs +++ b/src/freeclimb/Model/AvailableNumber.cs @@ -145,7 +145,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -156,16 +157,29 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("capabilities", Capabilities); - props.Add("campaignId", CampaignId); - props.Add("phoneNumber", PhoneNumber); - props.Add("voiceEnabled", VoiceEnabled); - props.Add("smsEnabled", SmsEnabled); - props.Add("region", Region); - props.Add("country", Country); + AddToDictionary(props, "capabilities", Capabilities); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "phoneNumber", PhoneNumber); + AddToDictionary(props, "voiceEnabled", VoiceEnabled); + AddToDictionary(props, "smsEnabled", SmsEnabled); + AddToDictionary(props, "region", Region); + AddToDictionary(props, "country", Country); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/AvailableNumberList.cs b/src/freeclimb/Model/AvailableNumberList.cs index 2abbef94..09d7691a 100644 --- a/src/freeclimb/Model/AvailableNumberList.cs +++ b/src/freeclimb/Model/AvailableNumberList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in AvailablePhoneNumbers) + if (AvailablePhoneNumbers != null) { - nested.Add(item); + foreach (var item in AvailablePhoneNumbers) + { + nested.Add(item.ToKvp()); + } } - props.Add("availablePhoneNumbers", nested); + AddToDictionary(props, "availablePhoneNumbers", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/BuyIncomingNumberRequest.cs b/src/freeclimb/Model/BuyIncomingNumberRequest.cs index 80f4ba1c..ce88116c 100644 --- a/src/freeclimb/Model/BuyIncomingNumberRequest.cs +++ b/src/freeclimb/Model/BuyIncomingNumberRequest.cs @@ -109,7 +109,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -120,12 +121,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("phoneNumber", PhoneNumber); - props.Add("alias", Alias); - props.Add("applicationId", ApplicationId); + AddToDictionary(props, "phoneNumber", PhoneNumber); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "applicationId", ApplicationId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CallControlWebhook.cs b/src/freeclimb/Model/CallControlWebhook.cs index 3b6c18cc..01fcf5dc 100644 --- a/src/freeclimb/Model/CallControlWebhook.cs +++ b/src/freeclimb/Model/CallControlWebhook.cs @@ -144,7 +144,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -155,14 +156,27 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("conferenceId", ConferenceId); - props.Add("digits", Digits); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "digits", Digits); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CallList.cs b/src/freeclimb/Model/CallList.cs index 5be75bb8..b5b147ea 100644 --- a/src/freeclimb/Model/CallList.cs +++ b/src/freeclimb/Model/CallList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Calls) + if (Calls != null) { - nested.Add(item); + foreach (var item in Calls) + { + nested.Add(item.ToKvp()); + } } - props.Add("calls", nested); + AddToDictionary(props, "calls", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CallResult.cs b/src/freeclimb/Model/CallResult.cs index 08cf1c4b..1d33d698 100644 --- a/src/freeclimb/Model/CallResult.cs +++ b/src/freeclimb/Model/CallResult.cs @@ -297,7 +297,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -308,29 +309,42 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("callId", CallId); - props.Add("parentCallId", ParentCallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("phoneNumberId", PhoneNumberId); - props.Add("callStatus", CallStatus); - props.Add("startTime", StartTime); - props.Add("connectTime", ConnectTime); - props.Add("endTime", EndTime); - props.Add("duration", Duration); - props.Add("connectDuration", ConnectDuration); - props.Add("direction", Direction); - props.Add("answeredBy", AnsweredBy); - props.Add("subresourceUris", SubresourceUris); - props.Add("applicationId", ApplicationId); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "parentCallId", ParentCallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "phoneNumberId", PhoneNumberId); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "startTime", StartTime); + AddToDictionary(props, "connectTime", ConnectTime); + AddToDictionary(props, "endTime", EndTime); + AddToDictionary(props, "duration", Duration); + AddToDictionary(props, "connectDuration", ConnectDuration); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "answeredBy", AnsweredBy); + AddToDictionary(props, "subresourceUris", SubresourceUris); + AddToDictionary(props, "applicationId", ApplicationId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CallStatusWebhook.cs b/src/freeclimb/Model/CallStatusWebhook.cs index 2b60f50e..d34c4b8b 100644 --- a/src/freeclimb/Model/CallStatusWebhook.cs +++ b/src/freeclimb/Model/CallStatusWebhook.cs @@ -201,7 +201,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -212,19 +213,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("callEndedReason", CallEndedReason); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "callEndedReason", CallEndedReason); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Capabilities.cs b/src/freeclimb/Model/Capabilities.cs index af04be97..b786a327 100644 --- a/src/freeclimb/Model/Capabilities.cs +++ b/src/freeclimb/Model/Capabilities.cs @@ -161,7 +161,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -172,14 +173,27 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("voice", Voice); - props.Add("sms", Sms); - props.Add("tollFree", TollFree); - props.Add("tenDLC", TenDLC); - props.Add("shortCode", ShortCode); + AddToDictionary(props, "voice", Voice); + AddToDictionary(props, "sms", Sms); + AddToDictionary(props, "tollFree", TollFree); + AddToDictionary(props, "tenDLC", TenDLC); + AddToDictionary(props, "shortCode", ShortCode); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CompletionRequest.cs b/src/freeclimb/Model/CompletionRequest.cs index e7fa08ae..81d5e94b 100644 --- a/src/freeclimb/Model/CompletionRequest.cs +++ b/src/freeclimb/Model/CompletionRequest.cs @@ -83,7 +83,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -94,10 +95,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("query", Query); + AddToDictionary(props, "query", Query); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CompletionResult.cs b/src/freeclimb/Model/CompletionResult.cs index a657ded6..d3c13bcf 100644 --- a/src/freeclimb/Model/CompletionResult.cs +++ b/src/freeclimb/Model/CompletionResult.cs @@ -96,7 +96,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -107,11 +108,24 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("response", Response); - props.Add("status", Status); + AddToDictionary(props, "response", Response); + AddToDictionary(props, "status", Status); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceList.cs b/src/freeclimb/Model/ConferenceList.cs index c261bdbc..ce2a3ad2 100644 --- a/src/freeclimb/Model/ConferenceList.cs +++ b/src/freeclimb/Model/ConferenceList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Conferences) + if (Conferences != null) { - nested.Add(item); + foreach (var item in Conferences) + { + nested.Add(item.ToKvp()); + } } - props.Add("conferences", nested); + AddToDictionary(props, "conferences", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceParticipantList.cs b/src/freeclimb/Model/ConferenceParticipantList.cs index c73c3b4f..f38de7be 100644 --- a/src/freeclimb/Model/ConferenceParticipantList.cs +++ b/src/freeclimb/Model/ConferenceParticipantList.cs @@ -157,7 +157,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -168,22 +169,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Participants) + if (Participants != null) { - nested.Add(item); + foreach (var item in Participants) + { + nested.Add(item.ToKvp()); + } } - props.Add("participants", nested); + AddToDictionary(props, "participants", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceParticipantResult.cs b/src/freeclimb/Model/ConferenceParticipantResult.cs index dd9fd96e..07224cf4 100644 --- a/src/freeclimb/Model/ConferenceParticipantResult.cs +++ b/src/freeclimb/Model/ConferenceParticipantResult.cs @@ -192,7 +192,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -203,20 +204,33 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("accountId", AccountId); - props.Add("conferenceId", ConferenceId); - props.Add("callId", CallId); - props.Add("talk", Talk); - props.Add("listen", Listen); - props.Add("dtmfPassThrough", DtmfPassThrough); - props.Add("startConfOnEnter", StartConfOnEnter); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "talk", Talk); + AddToDictionary(props, "listen", Listen); + AddToDictionary(props, "dtmfPassThrough", DtmfPassThrough); + AddToDictionary(props, "startConfOnEnter", StartConfOnEnter); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceRecordingStatusWebhook.cs b/src/freeclimb/Model/ConferenceRecordingStatusWebhook.cs index 8fcee7c8..64559eb6 100644 --- a/src/freeclimb/Model/ConferenceRecordingStatusWebhook.cs +++ b/src/freeclimb/Model/ConferenceRecordingStatusWebhook.cs @@ -237,7 +237,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -248,22 +249,35 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("status", Status); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingId", RecordingId); - props.Add("recordingDurationSec", RecordingDurationSec); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingDurationSec", RecordingDurationSec); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceResult.cs b/src/freeclimb/Model/ConferenceResult.cs index 1119ef71..4c1944b6 100644 --- a/src/freeclimb/Model/ConferenceResult.cs +++ b/src/freeclimb/Model/ConferenceResult.cs @@ -226,7 +226,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -237,23 +238,36 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("conferenceId", ConferenceId); - props.Add("accountId", AccountId); - props.Add("alias", Alias); - props.Add("playBeep", PlayBeep); - props.Add("record", Record); - props.Add("status", Status); - props.Add("waitUrl", WaitUrl); - props.Add("actionUrl", ActionUrl); - props.Add("statusCallbackUrl", StatusCallbackUrl); - props.Add("subresourceUris", SubresourceUris); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "record", Record); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "waitUrl", WaitUrl); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "subresourceUris", SubresourceUris); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/ConferenceStatusWebhook.cs b/src/freeclimb/Model/ConferenceStatusWebhook.cs index e2a09d71..6e3b7ce2 100644 --- a/src/freeclimb/Model/ConferenceStatusWebhook.cs +++ b/src/freeclimb/Model/ConferenceStatusWebhook.cs @@ -237,7 +237,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -248,22 +249,35 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("status", Status); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingId", RecordingId); - props.Add("recordingDurationSec", RecordingDurationSec); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingDurationSec", RecordingDurationSec); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CreateConference.cs b/src/freeclimb/Model/CreateConference.cs index 447f9050..a071160e 100644 --- a/src/freeclimb/Model/CreateConference.cs +++ b/src/freeclimb/Model/CreateConference.cs @@ -148,13 +148,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -164,17 +162,30 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("alias", Alias); - props.Add("playBeep", PlayBeep); - props.Add("record", Record); - props.Add("statusCallbackUrl", StatusCallbackUrl); - props.Add("waitUrl", WaitUrl); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "record", Record); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "waitUrl", WaitUrl); IDictionary command = new Dictionary(); command.Add("CreateConference", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CreateConferenceRequest.cs b/src/freeclimb/Model/CreateConferenceRequest.cs index 6175e8dd..2c1734e2 100644 --- a/src/freeclimb/Model/CreateConferenceRequest.cs +++ b/src/freeclimb/Model/CreateConferenceRequest.cs @@ -132,7 +132,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -143,14 +144,27 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("alias", Alias); - props.Add("playBeep", PlayBeep); - props.Add("record", Record); - props.Add("waitUrl", WaitUrl); - props.Add("statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "record", Record); + AddToDictionary(props, "waitUrl", WaitUrl); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CreateConferenceWebhook.cs b/src/freeclimb/Model/CreateConferenceWebhook.cs index 3c6d248b..0640dcdf 100644 --- a/src/freeclimb/Model/CreateConferenceWebhook.cs +++ b/src/freeclimb/Model/CreateConferenceWebhook.cs @@ -237,7 +237,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -248,22 +249,35 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("status", Status); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingId", RecordingId); - props.Add("recordingDurationSec", RecordingDurationSec); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingDurationSec", RecordingDurationSec); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/CreateWebRTCToken.cs b/src/freeclimb/Model/CreateWebRTCToken.cs index 9d73313b..a86b3051 100644 --- a/src/freeclimb/Model/CreateWebRTCToken.cs +++ b/src/freeclimb/Model/CreateWebRTCToken.cs @@ -116,7 +116,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -127,12 +128,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("to", To); - props.Add("from", From); - props.Add("uses", Uses); + AddToDictionary(props, "to", To); + AddToDictionary(props, "from", From); + AddToDictionary(props, "uses", Uses); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Dequeue.cs b/src/freeclimb/Model/Dequeue.cs index 289d2833..29562f06 100644 --- a/src/freeclimb/Model/Dequeue.cs +++ b/src/freeclimb/Model/Dequeue.cs @@ -61,13 +61,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -82,6 +80,19 @@ public override IDictionary ToKvp() return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/DequeueWebhook.cs b/src/freeclimb/Model/DequeueWebhook.cs index 0ac24e55..5a39d33f 100644 --- a/src/freeclimb/Model/DequeueWebhook.cs +++ b/src/freeclimb/Model/DequeueWebhook.cs @@ -214,7 +214,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -225,20 +226,33 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("queueResult", QueueResult); - props.Add("queueTime", QueueTime); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "queueResult", QueueResult); + AddToDictionary(props, "queueTime", QueueTime); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Enqueue.cs b/src/freeclimb/Model/Enqueue.cs index dbd5ec93..6ff429f3 100644 --- a/src/freeclimb/Model/Enqueue.cs +++ b/src/freeclimb/Model/Enqueue.cs @@ -139,13 +139,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -155,15 +153,28 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("notificationUrl", NotificationUrl); - props.Add("queueId", QueueId); - props.Add("waitUrl", WaitUrl); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "notificationUrl", NotificationUrl); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "waitUrl", WaitUrl); IDictionary command = new Dictionary(); command.Add("Enqueue", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/FilterLogsRequest.cs b/src/freeclimb/Model/FilterLogsRequest.cs index a399d480..9ee8d2e9 100644 --- a/src/freeclimb/Model/FilterLogsRequest.cs +++ b/src/freeclimb/Model/FilterLogsRequest.cs @@ -83,7 +83,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -94,10 +95,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("pql", Pql); + AddToDictionary(props, "pql", Pql); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/GetDigits.cs b/src/freeclimb/Model/GetDigits.cs index f3ac6739..c73abc37 100644 --- a/src/freeclimb/Model/GetDigits.cs +++ b/src/freeclimb/Model/GetDigits.cs @@ -185,13 +185,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -201,25 +199,41 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("digitTimeoutMs", DigitTimeoutMs); - props.Add("finishOnKey", FinishOnKey); - props.Add("flushBuffer", FlushBuffer); - props.Add("initialTimeoutMs", InitialTimeoutMs); - props.Add("maxDigits", MaxDigits); - props.Add("minDigits", MinDigits); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "digitTimeoutMs", DigitTimeoutMs); + AddToDictionary(props, "finishOnKey", FinishOnKey); + AddToDictionary(props, "flushBuffer", FlushBuffer); + AddToDictionary(props, "initialTimeoutMs", InitialTimeoutMs); + AddToDictionary(props, "maxDigits", MaxDigits); + AddToDictionary(props, "minDigits", MinDigits); List nested = new List(); - foreach (var item in Prompts) + if (Prompts != null) { - nested.Add(item); + foreach (var item in Prompts) + { + nested.Add(item.ToKvp()); + } } - props.Add("prompts", nested); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "prompts", nested); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("GetDigits", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/GetDigitsWebhook.cs b/src/freeclimb/Model/GetDigitsWebhook.cs index 3a304bbf..1637d527 100644 --- a/src/freeclimb/Model/GetDigitsWebhook.cs +++ b/src/freeclimb/Model/GetDigitsWebhook.cs @@ -225,7 +225,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -236,21 +237,34 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("digits", Digits); - props.Add("reason", Reason); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "digits", Digits); + AddToDictionary(props, "reason", Reason); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/GetSpeech.cs b/src/freeclimb/Model/GetSpeech.cs index 00935f41..e0d2f517 100644 --- a/src/freeclimb/Model/GetSpeech.cs +++ b/src/freeclimb/Model/GetSpeech.cs @@ -241,13 +241,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -257,29 +255,45 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("grammarType", GrammarType); - props.Add("grammarFile", GrammarFile); - props.Add("grammarRule", GrammarRule); - props.Add("playBeep", PlayBeep); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "grammarType", GrammarType); + AddToDictionary(props, "grammarFile", GrammarFile); + AddToDictionary(props, "grammarRule", GrammarRule); + AddToDictionary(props, "playBeep", PlayBeep); List nested = new List(); - foreach (var item in Prompts) + if (Prompts != null) { - nested.Add(item); + foreach (var item in Prompts) + { + nested.Add(item.ToKvp()); + } } - props.Add("prompts", nested); - props.Add("noInputTimeoutMs", NoInputTimeoutMs); - props.Add("recognitionTimeoutMs", RecognitionTimeoutMs); - props.Add("confidenceThreshold", ConfidenceThreshold); - props.Add("sensitivityLevel", SensitivityLevel); - props.Add("speechCompleteTimeoutMs", SpeechCompleteTimeoutMs); - props.Add("speechIncompleteTimeoutMs", SpeechIncompleteTimeoutMs); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "prompts", nested); + AddToDictionary(props, "noInputTimeoutMs", NoInputTimeoutMs); + AddToDictionary(props, "recognitionTimeoutMs", RecognitionTimeoutMs); + AddToDictionary(props, "confidenceThreshold", ConfidenceThreshold); + AddToDictionary(props, "sensitivityLevel", SensitivityLevel); + AddToDictionary(props, "speechCompleteTimeoutMs", SpeechCompleteTimeoutMs); + AddToDictionary(props, "speechIncompleteTimeoutMs", SpeechIncompleteTimeoutMs); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("GetSpeech", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/GetSpeechWebhook.cs b/src/freeclimb/Model/GetSpeechWebhook.cs index 2f5f6faa..b213aced 100644 --- a/src/freeclimb/Model/GetSpeechWebhook.cs +++ b/src/freeclimb/Model/GetSpeechWebhook.cs @@ -285,7 +285,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -296,26 +297,39 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("reason", Reason); - props.Add("recognitionResult", RecognitionResult); - props.Add("confidence", Confidence); - props.Add("parentCallId", ParentCallId); - props.Add("completionReason", CompletionReason); - props.Add("completionCause", CompletionCause); - props.Add("mrcpCode", MrcpCode); - props.Add("mrcpDiagnostic", MrcpDiagnostic); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "reason", Reason); + AddToDictionary(props, "recognitionResult", RecognitionResult); + AddToDictionary(props, "confidence", Confidence); + AddToDictionary(props, "parentCallId", ParentCallId); + AddToDictionary(props, "completionReason", CompletionReason); + AddToDictionary(props, "completionCause", CompletionCause); + AddToDictionary(props, "mrcpCode", MrcpCode); + AddToDictionary(props, "mrcpDiagnostic", MrcpDiagnostic); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Hangup.cs b/src/freeclimb/Model/Hangup.cs index 44f43fbf..124ddfb2 100644 --- a/src/freeclimb/Model/Hangup.cs +++ b/src/freeclimb/Model/Hangup.cs @@ -73,13 +73,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -89,12 +87,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("reason", Reason); + AddToDictionary(props, "reason", Reason); IDictionary command = new Dictionary(); command.Add("Hangup", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/InboundCallWebhook.cs b/src/freeclimb/Model/InboundCallWebhook.cs index beb2ce64..7e66882e 100644 --- a/src/freeclimb/Model/InboundCallWebhook.cs +++ b/src/freeclimb/Model/InboundCallWebhook.cs @@ -201,7 +201,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -212,19 +213,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/IncomingNumberList.cs b/src/freeclimb/Model/IncomingNumberList.cs index 57e157cc..97d6c6a1 100644 --- a/src/freeclimb/Model/IncomingNumberList.cs +++ b/src/freeclimb/Model/IncomingNumberList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in IncomingPhoneNumbers) + if (IncomingPhoneNumbers != null) { - nested.Add(item); + foreach (var item in IncomingPhoneNumbers) + { + nested.Add(item.ToKvp()); + } } - props.Add("incomingPhoneNumbers", nested); + AddToDictionary(props, "incomingPhoneNumbers", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/IncomingNumberRequest.cs b/src/freeclimb/Model/IncomingNumberRequest.cs index f01db395..fabbbe3b 100644 --- a/src/freeclimb/Model/IncomingNumberRequest.cs +++ b/src/freeclimb/Model/IncomingNumberRequest.cs @@ -96,7 +96,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -107,12 +108,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("applicationId", ApplicationId); - props.Add("alias", Alias); - props.Add("campaignId", CampaignId); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "campaignId", CampaignId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/IncomingNumberResult.cs b/src/freeclimb/Model/IncomingNumberResult.cs index 9519cdd9..ef2901eb 100644 --- a/src/freeclimb/Model/IncomingNumberResult.cs +++ b/src/freeclimb/Model/IncomingNumberResult.cs @@ -264,7 +264,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -275,26 +276,39 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("capabilities", Capabilities); - props.Add("campaignId", CampaignId); - props.Add("phoneNumberId", PhoneNumberId); - props.Add("accountId", AccountId); - props.Add("applicationId", ApplicationId); - props.Add("phoneNumber", PhoneNumber); - props.Add("alias", Alias); - props.Add("region", Region); - props.Add("country", Country); - props.Add("voiceEnabled", VoiceEnabled); - props.Add("smsEnabled", SmsEnabled); - props.Add("offnet", Offnet); - props.Add("tfn", Tfn); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "capabilities", Capabilities); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "phoneNumberId", PhoneNumberId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "phoneNumber", PhoneNumber); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "region", Region); + AddToDictionary(props, "country", Country); + AddToDictionary(props, "voiceEnabled", VoiceEnabled); + AddToDictionary(props, "smsEnabled", SmsEnabled); + AddToDictionary(props, "offnet", Offnet); + AddToDictionary(props, "tfn", Tfn); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/LeaveConferenceWebhook.cs b/src/freeclimb/Model/LeaveConferenceWebhook.cs index c95e4a9f..7f8e365b 100644 --- a/src/freeclimb/Model/LeaveConferenceWebhook.cs +++ b/src/freeclimb/Model/LeaveConferenceWebhook.cs @@ -190,7 +190,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -201,18 +202,31 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/LogList.cs b/src/freeclimb/Model/LogList.cs index 02be2bab..c008700d 100644 --- a/src/freeclimb/Model/LogList.cs +++ b/src/freeclimb/Model/LogList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Logs) + if (Logs != null) { - nested.Add(item); + foreach (var item in Logs) + { + nested.Add(item.ToKvp()); + } } - props.Add("logs", nested); + AddToDictionary(props, "logs", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/LogResult.cs b/src/freeclimb/Model/LogResult.cs index 1725f34a..f5b73dd0 100644 --- a/src/freeclimb/Model/LogResult.cs +++ b/src/freeclimb/Model/LogResult.cs @@ -143,7 +143,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -154,16 +155,29 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("timestamp", Timestamp); - props.Add("level", Level); - props.Add("requestId", RequestId); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("message", Message); - props.Add("metadata", Metadata); + AddToDictionary(props, "timestamp", Timestamp); + AddToDictionary(props, "level", Level); + AddToDictionary(props, "requestId", RequestId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "message", Message); + AddToDictionary(props, "metadata", Metadata); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MachineDetectedWebhook.cs b/src/freeclimb/Model/MachineDetectedWebhook.cs index b53356f2..7a3be329 100644 --- a/src/freeclimb/Model/MachineDetectedWebhook.cs +++ b/src/freeclimb/Model/MachineDetectedWebhook.cs @@ -213,7 +213,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -224,20 +225,33 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("callId", CallId); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("parentCallId", ParentCallId); - props.Add("machineType", MachineType); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "parentCallId", ParentCallId); + AddToDictionary(props, "machineType", MachineType); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MakeCallRequest.cs b/src/freeclimb/Model/MakeCallRequest.cs index 1ffe91b7..a6d81c2e 100644 --- a/src/freeclimb/Model/MakeCallRequest.cs +++ b/src/freeclimb/Model/MakeCallRequest.cs @@ -200,7 +200,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -211,19 +212,32 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("from", From); - props.Add("to", To); - props.Add("applicationId", ApplicationId); - props.Add("sendDigits", SendDigits); - props.Add("ifMachine", IfMachine); - props.Add("ifMachineUrl", IfMachineUrl); - props.Add("timeout", Timeout); - props.Add("parentCallId", ParentCallId); - props.Add("privacyMode", PrivacyMode); - props.Add("callConnectUrl", CallConnectUrl); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "sendDigits", SendDigits); + AddToDictionary(props, "ifMachine", IfMachine); + AddToDictionary(props, "ifMachineUrl", IfMachineUrl); + AddToDictionary(props, "timeout", Timeout); + AddToDictionary(props, "parentCallId", ParentCallId); + AddToDictionary(props, "privacyMode", PrivacyMode); + AddToDictionary(props, "callConnectUrl", CallConnectUrl); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MessageDeliveryWebhook.cs b/src/freeclimb/Model/MessageDeliveryWebhook.cs index e778c6fb..d4aae86a 100644 --- a/src/freeclimb/Model/MessageDeliveryWebhook.cs +++ b/src/freeclimb/Model/MessageDeliveryWebhook.cs @@ -204,7 +204,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -215,19 +216,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("from", From); - props.Add("to", To); - props.Add("text", Text); - props.Add("direction", Direction); - props.Add("applicationId", ApplicationId); - props.Add("status", Status); - props.Add("phoneNumberId", PhoneNumberId); - props.Add("uri", Uri); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "phoneNumberId", PhoneNumberId); + AddToDictionary(props, "uri", Uri); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MessageRequest.cs b/src/freeclimb/Model/MessageRequest.cs index 4e2a0e6f..be03242d 100644 --- a/src/freeclimb/Model/MessageRequest.cs +++ b/src/freeclimb/Model/MessageRequest.cs @@ -195,7 +195,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -206,23 +207,36 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("from", From); - props.Add("to", To); - props.Add("text", Text); - props.Add("notificationUrl", NotificationUrl); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "notificationUrl", NotificationUrl); List nested = new List(); - foreach (var item in MediaUrls) + if (MediaUrls != null) { - nested.Add(item); + nested.Add(MediaUrls); } - props.Add("mediaUrls", nested); + AddToDictionary(props, "mediaUrls", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MessageResult.cs b/src/freeclimb/Model/MessageResult.cs index be417c60..f2803441 100644 --- a/src/freeclimb/Model/MessageResult.cs +++ b/src/freeclimb/Model/MessageResult.cs @@ -286,7 +286,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -297,33 +298,46 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("accountId", AccountId); - props.Add("messageId", MessageId); - props.Add("status", Status); - props.Add("from", From); - props.Add("to", To); - props.Add("text", Text); - props.Add("direction", Direction); - props.Add("notificationUrl", NotificationUrl); - props.Add("brandId", BrandId); - props.Add("campaignId", CampaignId); - props.Add("segmentCount", SegmentCount); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "messageId", MessageId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "notificationUrl", NotificationUrl); + AddToDictionary(props, "brandId", BrandId); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "segmentCount", SegmentCount); List nested = new List(); - foreach (var item in MediaUrls) + if (MediaUrls != null) { - nested.Add(item); + nested.Add(MediaUrls); } - props.Add("mediaUrls", nested); - props.Add("tfn", Tfn); - props.Add("phoneNumberId", PhoneNumberId); - props.Add("applicationId", ApplicationId); + AddToDictionary(props, "mediaUrls", nested); + AddToDictionary(props, "tfn", Tfn); + AddToDictionary(props, "phoneNumberId", PhoneNumberId); + AddToDictionary(props, "applicationId", ApplicationId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MessageStatusWebhook.cs b/src/freeclimb/Model/MessageStatusWebhook.cs index ae0ef28d..4b891f08 100644 --- a/src/freeclimb/Model/MessageStatusWebhook.cs +++ b/src/freeclimb/Model/MessageStatusWebhook.cs @@ -215,7 +215,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -226,20 +227,33 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("messageId", MessageId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("text", Text); - props.Add("direction", Direction); - props.Add("applicationId", ApplicationId); - props.Add("status", Status); - props.Add("phoneNumberId", PhoneNumberId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "messageId", MessageId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "applicationId", ApplicationId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "phoneNumberId", PhoneNumberId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MessagesList.cs b/src/freeclimb/Model/MessagesList.cs index 5b3f31ad..2fbda24e 100644 --- a/src/freeclimb/Model/MessagesList.cs +++ b/src/freeclimb/Model/MessagesList.cs @@ -157,7 +157,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -168,22 +169,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Messages) + if (Messages != null) { - nested.Add(item); + foreach (var item in Messages) + { + nested.Add(item.ToKvp()); + } } - props.Add("messages", nested); + AddToDictionary(props, "messages", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/MutableResourceModel.cs b/src/freeclimb/Model/MutableResourceModel.cs index 58249020..4fc3097e 100644 --- a/src/freeclimb/Model/MutableResourceModel.cs +++ b/src/freeclimb/Model/MutableResourceModel.cs @@ -108,7 +108,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -119,13 +120,26 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/OutDial.cs b/src/freeclimb/Model/OutDial.cs index 7c5089e0..3301a696 100644 --- a/src/freeclimb/Model/OutDial.cs +++ b/src/freeclimb/Model/OutDial.cs @@ -217,13 +217,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -233,21 +231,34 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("callConnectUrl", CallConnectUrl); - props.Add("callingNumber", CallingNumber); - props.Add("destination", Destination); - props.Add("ifMachine", IfMachine); - props.Add("ifMachineUrl", IfMachineUrl); - props.Add("sendDigits", SendDigits); - props.Add("statusCallbackUrl", StatusCallbackUrl); - props.Add("timeout", Timeout); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "callConnectUrl", CallConnectUrl); + AddToDictionary(props, "callingNumber", CallingNumber); + AddToDictionary(props, "destination", Destination); + AddToDictionary(props, "ifMachine", IfMachine); + AddToDictionary(props, "ifMachineUrl", IfMachineUrl); + AddToDictionary(props, "sendDigits", SendDigits); + AddToDictionary(props, "statusCallbackUrl", StatusCallbackUrl); + AddToDictionary(props, "timeout", Timeout); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("OutDial", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/OutDialApiConnectWebhook.cs b/src/freeclimb/Model/OutDialApiConnectWebhook.cs index 5a4c6b30..5337130e 100644 --- a/src/freeclimb/Model/OutDialApiConnectWebhook.cs +++ b/src/freeclimb/Model/OutDialApiConnectWebhook.cs @@ -202,7 +202,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -213,19 +214,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/OutDialConnectWebhook.cs b/src/freeclimb/Model/OutDialConnectWebhook.cs index 0f91b09b..a0d90035 100644 --- a/src/freeclimb/Model/OutDialConnectWebhook.cs +++ b/src/freeclimb/Model/OutDialConnectWebhook.cs @@ -202,7 +202,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -213,19 +214,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/OutDialStartWebhook.cs b/src/freeclimb/Model/OutDialStartWebhook.cs index 4e99ba2f..0212aeb0 100644 --- a/src/freeclimb/Model/OutDialStartWebhook.cs +++ b/src/freeclimb/Model/OutDialStartWebhook.cs @@ -214,7 +214,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -225,20 +226,33 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("dialCallId", DialCallId); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "dialCallId", DialCallId); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/PaginationModel.cs b/src/freeclimb/Model/PaginationModel.cs index d28b7d94..e198c88d 100644 --- a/src/freeclimb/Model/PaginationModel.cs +++ b/src/freeclimb/Model/PaginationModel.cs @@ -144,7 +144,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -155,16 +156,29 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Park.cs b/src/freeclimb/Model/Park.cs index 8ec60d3b..78bf28a7 100644 --- a/src/freeclimb/Model/Park.cs +++ b/src/freeclimb/Model/Park.cs @@ -120,13 +120,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -136,14 +134,27 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("waitUrl", WaitUrl); - props.Add("actionUrl", ActionUrl); - props.Add("notificationUrl", NotificationUrl); + AddToDictionary(props, "waitUrl", WaitUrl); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "notificationUrl", NotificationUrl); IDictionary command = new Dictionary(); command.Add("Park", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Pause.cs b/src/freeclimb/Model/Pause.cs index 5fd63ac7..d4627e53 100644 --- a/src/freeclimb/Model/Pause.cs +++ b/src/freeclimb/Model/Pause.cs @@ -79,13 +79,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -95,12 +93,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("length", Length); + AddToDictionary(props, "length", Length); IDictionary command = new Dictionary(); command.Add("Pause", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/PerclCommand.cs b/src/freeclimb/Model/PerclCommand.cs index 06dcf3bd..a7bbe7ee 100644 --- a/src/freeclimb/Model/PerclCommand.cs +++ b/src/freeclimb/Model/PerclCommand.cs @@ -96,13 +96,11 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -112,10 +110,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("command", Command); + AddToDictionary(props, "command", Command); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/PerclScript.cs b/src/freeclimb/Model/PerclScript.cs index 38e0c11d..960056b9 100644 --- a/src/freeclimb/Model/PerclScript.cs +++ b/src/freeclimb/Model/PerclScript.cs @@ -68,8 +68,10 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; List list = new List(); foreach (PerclCommand command in this.Commands.ToList()) @@ -77,10 +79,7 @@ public virtual string ToJson() list.Add(command.ToKvp()); } - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), list); - - return strb.ToString(); + return JsonConvert.SerializeObject(list, settings); } /// @@ -91,14 +90,30 @@ public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); List nested = new List(); - foreach (var item in Commands) + if (Commands != null) { - nested.Add(item); + foreach (var item in Commands) + { + nested.Add(item.ToKvp()); + } } - props.Add("commands", nested); + AddToDictionary(props, "commands", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Play.cs b/src/freeclimb/Model/Play.cs index 46dfb84f..2ba2e75c 100644 --- a/src/freeclimb/Model/Play.cs +++ b/src/freeclimb/Model/Play.cs @@ -113,13 +113,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -129,14 +127,27 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("file", File); - props.Add("loop", Loop); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "file", File); + AddToDictionary(props, "loop", Loop); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("Play", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/PlayEarlyMedia.cs b/src/freeclimb/Model/PlayEarlyMedia.cs index 7893bb19..717cc38f 100644 --- a/src/freeclimb/Model/PlayEarlyMedia.cs +++ b/src/freeclimb/Model/PlayEarlyMedia.cs @@ -86,13 +86,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -102,12 +100,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("file", File); + AddToDictionary(props, "file", File); IDictionary command = new Dictionary(); command.Add("PlayEarlyMedia", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueList.cs b/src/freeclimb/Model/QueueList.cs index c00235cf..d15ec59f 100644 --- a/src/freeclimb/Model/QueueList.cs +++ b/src/freeclimb/Model/QueueList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Queues) + if (Queues != null) { - nested.Add(item); + foreach (var item in Queues) + { + nested.Add(item.ToKvp()); + } } - props.Add("queues", nested); + AddToDictionary(props, "queues", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueMember.cs b/src/freeclimb/Model/QueueMember.cs index be5b1ecb..4f8bf099 100644 --- a/src/freeclimb/Model/QueueMember.cs +++ b/src/freeclimb/Model/QueueMember.cs @@ -120,7 +120,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -131,14 +132,27 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("callId", CallId); - props.Add("waitTime", WaitTime); - props.Add("position", Position); - props.Add("dateEnqueued", DateEnqueued); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "waitTime", WaitTime); + AddToDictionary(props, "position", Position); + AddToDictionary(props, "dateEnqueued", DateEnqueued); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueMemberList.cs b/src/freeclimb/Model/QueueMemberList.cs index eaae313b..83876461 100644 --- a/src/freeclimb/Model/QueueMemberList.cs +++ b/src/freeclimb/Model/QueueMemberList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in QueueMembers) + if (QueueMembers != null) { - nested.Add(item); + foreach (var item in QueueMembers) + { + nested.Add(item.ToKvp()); + } } - props.Add("queueMembers", nested); + AddToDictionary(props, "queueMembers", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueRequest.cs b/src/freeclimb/Model/QueueRequest.cs index 1bf4d935..40397f0b 100644 --- a/src/freeclimb/Model/QueueRequest.cs +++ b/src/freeclimb/Model/QueueRequest.cs @@ -81,7 +81,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -92,11 +93,24 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("alias", Alias); - props.Add("maxSize", MaxSize); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "maxSize", MaxSize); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueResult.cs b/src/freeclimb/Model/QueueResult.cs index d4c24e43..14cf7ee3 100644 --- a/src/freeclimb/Model/QueueResult.cs +++ b/src/freeclimb/Model/QueueResult.cs @@ -192,7 +192,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -203,20 +204,33 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("accountId", AccountId); - props.Add("queueId", QueueId); - props.Add("alias", Alias); - props.Add("maxSize", MaxSize); - props.Add("currentSize", CurrentSize); - props.Add("averageQueueRemovalTime", AverageQueueRemovalTime); - props.Add("subresourceUris", SubresourceUris); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "maxSize", MaxSize); + AddToDictionary(props, "currentSize", CurrentSize); + AddToDictionary(props, "averageQueueRemovalTime", AverageQueueRemovalTime); + AddToDictionary(props, "subresourceUris", SubresourceUris); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/QueueWaitWebhook.cs b/src/freeclimb/Model/QueueWaitWebhook.cs index 3434cbcd..98addc15 100644 --- a/src/freeclimb/Model/QueueWaitWebhook.cs +++ b/src/freeclimb/Model/QueueWaitWebhook.cs @@ -226,7 +226,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -237,21 +238,34 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("queuePosition", QueuePosition); - props.Add("queueTime", QueueTime); - props.Add("currentQueueSize", CurrentQueueSize); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "queuePosition", QueuePosition); + AddToDictionary(props, "queueTime", QueueTime); + AddToDictionary(props, "currentQueueSize", CurrentQueueSize); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RecordUtterance.cs b/src/freeclimb/Model/RecordUtterance.cs index 194e2b1e..18516118 100644 --- a/src/freeclimb/Model/RecordUtterance.cs +++ b/src/freeclimb/Model/RecordUtterance.cs @@ -161,13 +161,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -177,18 +175,31 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("silenceTimeoutMs", SilenceTimeoutMs); - props.Add("finishOnKey", FinishOnKey); - props.Add("maxLengthSec", MaxLengthSec); - props.Add("playBeep", PlayBeep); - props.Add("autoStart", AutoStart); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "silenceTimeoutMs", SilenceTimeoutMs); + AddToDictionary(props, "finishOnKey", FinishOnKey); + AddToDictionary(props, "maxLengthSec", MaxLengthSec); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "autoStart", AutoStart); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("RecordUtterance", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RecordWebhook.cs b/src/freeclimb/Model/RecordWebhook.cs index 7da85280..cfa2aeee 100644 --- a/src/freeclimb/Model/RecordWebhook.cs +++ b/src/freeclimb/Model/RecordWebhook.cs @@ -285,7 +285,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -296,26 +297,39 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("recordingId", RecordingId); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingSize", RecordingSize); - props.Add("recordingFormat", RecordingFormat); - props.Add("recordingDurationSec", RecordingDurationSec); - props.Add("termReason", TermReason); - props.Add("parentCallId", ParentCallId); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingSize", RecordingSize); + AddToDictionary(props, "recordingFormat", RecordingFormat); + AddToDictionary(props, "recordingDurationSec", RecordingDurationSec); + AddToDictionary(props, "termReason", TermReason); + AddToDictionary(props, "parentCallId", ParentCallId); + AddToDictionary(props, "privacyMode", PrivacyMode); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RecordingList.cs b/src/freeclimb/Model/RecordingList.cs index ba112c8b..01b5cc0a 100644 --- a/src/freeclimb/Model/RecordingList.cs +++ b/src/freeclimb/Model/RecordingList.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Recordings) + if (Recordings != null) { - nested.Add(item); + foreach (var item in Recordings) + { + nested.Add(item.ToKvp()); + } } - props.Add("recordings", nested); + AddToDictionary(props, "recordings", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RecordingResult.cs b/src/freeclimb/Model/RecordingResult.cs index 2ba6e93b..1a119c89 100644 --- a/src/freeclimb/Model/RecordingResult.cs +++ b/src/freeclimb/Model/RecordingResult.cs @@ -168,7 +168,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -179,18 +180,31 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("uri", Uri); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); - props.Add("recordingId", RecordingId); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("durationSec", DurationSec); - props.Add("conferenceId", ConferenceId); + AddToDictionary(props, "uri", Uri); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "durationSec", DurationSec); + AddToDictionary(props, "conferenceId", ConferenceId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Redirect.cs b/src/freeclimb/Model/Redirect.cs index 661f3628..e7112379 100644 --- a/src/freeclimb/Model/Redirect.cs +++ b/src/freeclimb/Model/Redirect.cs @@ -86,13 +86,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -102,12 +100,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); + AddToDictionary(props, "actionUrl", ActionUrl); IDictionary command = new Dictionary(); command.Add("Redirect", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RedirectWebhook.cs b/src/freeclimb/Model/RedirectWebhook.cs index 586fb18e..8cade4a2 100644 --- a/src/freeclimb/Model/RedirectWebhook.cs +++ b/src/freeclimb/Model/RedirectWebhook.cs @@ -202,7 +202,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -213,19 +214,32 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("parentCallId", ParentCallId); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "parentCallId", ParentCallId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Reject.cs b/src/freeclimb/Model/Reject.cs index f1c1d450..b58656eb 100644 --- a/src/freeclimb/Model/Reject.cs +++ b/src/freeclimb/Model/Reject.cs @@ -73,13 +73,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -89,12 +87,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("reason", Reason); + AddToDictionary(props, "reason", Reason); IDictionary command = new Dictionary(); command.Add("Reject", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RemoveFromConference.cs b/src/freeclimb/Model/RemoveFromConference.cs index f4ee3347..25376fb9 100644 --- a/src/freeclimb/Model/RemoveFromConference.cs +++ b/src/freeclimb/Model/RemoveFromConference.cs @@ -61,13 +61,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -82,6 +80,19 @@ public override IDictionary ToKvp() return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/RemoveFromQueueNotificationWebhook.cs b/src/freeclimb/Model/RemoveFromQueueNotificationWebhook.cs index 1956cffd..6f8c6965 100644 --- a/src/freeclimb/Model/RemoveFromQueueNotificationWebhook.cs +++ b/src/freeclimb/Model/RemoveFromQueueNotificationWebhook.cs @@ -213,7 +213,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -224,20 +225,33 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("callStatus", CallStatus); - props.Add("direction", Direction); - props.Add("conferenceId", ConferenceId); - props.Add("queueId", QueueId); - props.Add("queueResult", QueueResult); - props.Add("queueTime", QueueTime); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "callStatus", CallStatus); + AddToDictionary(props, "direction", Direction); + AddToDictionary(props, "conferenceId", ConferenceId); + AddToDictionary(props, "queueId", QueueId); + AddToDictionary(props, "queueResult", QueueResult); + AddToDictionary(props, "queueTime", QueueTime); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCBrand.cs b/src/freeclimb/Model/SMSTenDLCBrand.cs index 6f01b338..2a7fe060 100644 --- a/src/freeclimb/Model/SMSTenDLCBrand.cs +++ b/src/freeclimb/Model/SMSTenDLCBrand.cs @@ -526,7 +526,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -537,40 +538,53 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("entityType", EntityType); - props.Add("cspId", CspId); - props.Add("brandId", BrandId); - props.Add("firstName", FirstName); - props.Add("lastName", LastName); - props.Add("displayName", DisplayName); - props.Add("companyName", CompanyName); - props.Add("ein", Ein); - props.Add("einIssuingCountry", EinIssuingCountry); - props.Add("phone", Phone); - props.Add("street", Street); - props.Add("city", City); - props.Add("state", State); - props.Add("postalCode", PostalCode); - props.Add("country", Country); - props.Add("email", Email); - props.Add("stockSymbol", StockSymbol); - props.Add("stockExchange", StockExchange); - props.Add("ipAddress", IpAddress); - props.Add("website", Website); - props.Add("brandRelationship", BrandRelationship); - props.Add("vertical", Vertical); - props.Add("altBusinessId", AltBusinessId); - props.Add("altBusinessIdType", AltBusinessIdType); - props.Add("universalEin", UniversalEin); - props.Add("referenceId", ReferenceId); - props.Add("optionalAttributes", OptionalAttributes); - props.Add("mock", Mock); - props.Add("identityStatus", IdentityStatus); - props.Add("createDate", CreateDate); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "entityType", EntityType); + AddToDictionary(props, "cspId", CspId); + AddToDictionary(props, "brandId", BrandId); + AddToDictionary(props, "firstName", FirstName); + AddToDictionary(props, "lastName", LastName); + AddToDictionary(props, "displayName", DisplayName); + AddToDictionary(props, "companyName", CompanyName); + AddToDictionary(props, "ein", Ein); + AddToDictionary(props, "einIssuingCountry", EinIssuingCountry); + AddToDictionary(props, "phone", Phone); + AddToDictionary(props, "street", Street); + AddToDictionary(props, "city", City); + AddToDictionary(props, "state", State); + AddToDictionary(props, "postalCode", PostalCode); + AddToDictionary(props, "country", Country); + AddToDictionary(props, "email", Email); + AddToDictionary(props, "stockSymbol", StockSymbol); + AddToDictionary(props, "stockExchange", StockExchange); + AddToDictionary(props, "ipAddress", IpAddress); + AddToDictionary(props, "website", Website); + AddToDictionary(props, "brandRelationship", BrandRelationship); + AddToDictionary(props, "vertical", Vertical); + AddToDictionary(props, "altBusinessId", AltBusinessId); + AddToDictionary(props, "altBusinessIdType", AltBusinessIdType); + AddToDictionary(props, "universalEin", UniversalEin); + AddToDictionary(props, "referenceId", ReferenceId); + AddToDictionary(props, "optionalAttributes", OptionalAttributes); + AddToDictionary(props, "mock", Mock); + AddToDictionary(props, "identityStatus", IdentityStatus); + AddToDictionary(props, "createDate", CreateDate); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCBrandsListResult.cs b/src/freeclimb/Model/SMSTenDLCBrandsListResult.cs index bd9b0fc2..6cca0bf8 100644 --- a/src/freeclimb/Model/SMSTenDLCBrandsListResult.cs +++ b/src/freeclimb/Model/SMSTenDLCBrandsListResult.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Brands) + if (Brands != null) { - nested.Add(item); + foreach (var item in Brands) + { + nested.Add(item.ToKvp()); + } } - props.Add("brands", nested); + AddToDictionary(props, "brands", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCCampaign.cs b/src/freeclimb/Model/SMSTenDLCCampaign.cs index 266d61c2..0e93ae9e 100644 --- a/src/freeclimb/Model/SMSTenDLCCampaign.cs +++ b/src/freeclimb/Model/SMSTenDLCCampaign.cs @@ -543,7 +543,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -554,50 +555,63 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("campaignId", CampaignId); - props.Add("cspId", CspId); - props.Add("resellerId", ResellerId); - props.Add("status", Status); - props.Add("createDate", CreateDate); - props.Add("autoRenewal", AutoRenewal); - props.Add("billedDate", BilledDate); - props.Add("brandId", BrandId); - props.Add("usecase", Usecase); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "cspId", CspId); + AddToDictionary(props, "resellerId", ResellerId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "createDate", CreateDate); + AddToDictionary(props, "autoRenewal", AutoRenewal); + AddToDictionary(props, "billedDate", BilledDate); + AddToDictionary(props, "brandId", BrandId); + AddToDictionary(props, "usecase", Usecase); List nested = new List(); - foreach (var item in SubUsecases) + if (SubUsecases != null) { - nested.Add(item); + nested.Add(SubUsecases); } - props.Add("subUsecases", nested); - props.Add("description", Description); - props.Add("embeddedLink", EmbeddedLink); - props.Add("embeddedPhone", EmbeddedPhone); - props.Add("affiliateMarketing", AffiliateMarketing); - props.Add("numberPool", NumberPool); - props.Add("ageGated", AgeGated); - props.Add("directLending", DirectLending); - props.Add("subscriberOptin", SubscriberOptin); - props.Add("subscriberOptout", SubscriberOptout); - props.Add("subscriberHelp", SubscriberHelp); - props.Add("sample1", Sample1); - props.Add("sample2", Sample2); - props.Add("sample3", Sample3); - props.Add("sample4", Sample4); - props.Add("sample5", Sample5); - props.Add("messageFlow", MessageFlow); - props.Add("helpMessage", HelpMessage); - props.Add("optinKeywords", OptinKeywords); - props.Add("optoutKeywords", OptoutKeywords); - props.Add("helpKeywords", HelpKeywords); - props.Add("optinMessage", OptinMessage); - props.Add("optoutMessage", OptoutMessage); - props.Add("referenceId", ReferenceId); - props.Add("mock", Mock); - props.Add("nextRenewalOrExpirationDate", NextRenewalOrExpirationDate); + AddToDictionary(props, "subUsecases", nested); + AddToDictionary(props, "description", Description); + AddToDictionary(props, "embeddedLink", EmbeddedLink); + AddToDictionary(props, "embeddedPhone", EmbeddedPhone); + AddToDictionary(props, "affiliateMarketing", AffiliateMarketing); + AddToDictionary(props, "numberPool", NumberPool); + AddToDictionary(props, "ageGated", AgeGated); + AddToDictionary(props, "directLending", DirectLending); + AddToDictionary(props, "subscriberOptin", SubscriberOptin); + AddToDictionary(props, "subscriberOptout", SubscriberOptout); + AddToDictionary(props, "subscriberHelp", SubscriberHelp); + AddToDictionary(props, "sample1", Sample1); + AddToDictionary(props, "sample2", Sample2); + AddToDictionary(props, "sample3", Sample3); + AddToDictionary(props, "sample4", Sample4); + AddToDictionary(props, "sample5", Sample5); + AddToDictionary(props, "messageFlow", MessageFlow); + AddToDictionary(props, "helpMessage", HelpMessage); + AddToDictionary(props, "optinKeywords", OptinKeywords); + AddToDictionary(props, "optoutKeywords", OptoutKeywords); + AddToDictionary(props, "helpKeywords", HelpKeywords); + AddToDictionary(props, "optinMessage", OptinMessage); + AddToDictionary(props, "optoutMessage", OptoutMessage); + AddToDictionary(props, "referenceId", ReferenceId); + AddToDictionary(props, "mock", Mock); + AddToDictionary(props, "nextRenewalOrExpirationDate", NextRenewalOrExpirationDate); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCCampaignsListResult.cs b/src/freeclimb/Model/SMSTenDLCCampaignsListResult.cs index 71ebab33..3a405362 100644 --- a/src/freeclimb/Model/SMSTenDLCCampaignsListResult.cs +++ b/src/freeclimb/Model/SMSTenDLCCampaignsListResult.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Campaigns) + if (Campaigns != null) { - nested.Add(item); + foreach (var item in Campaigns) + { + nested.Add(item.ToKvp()); + } } - props.Add("campaigns", nested); + AddToDictionary(props, "campaigns", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCPartnerCampaign.cs b/src/freeclimb/Model/SMSTenDLCPartnerCampaign.cs index f2744de6..f0f82123 100644 --- a/src/freeclimb/Model/SMSTenDLCPartnerCampaign.cs +++ b/src/freeclimb/Model/SMSTenDLCPartnerCampaign.cs @@ -439,7 +439,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -450,38 +451,51 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("campaignId", CampaignId); - props.Add("status", Status); - props.Add("createDate", CreateDate); - props.Add("brandId", BrandId); - props.Add("usecase", Usecase); - props.Add("description", Description); - props.Add("embeddedLink", EmbeddedLink); - props.Add("embeddedPhone", EmbeddedPhone); - props.Add("affiliateMarketing", AffiliateMarketing); - props.Add("numberPool", NumberPool); - props.Add("ageGated", AgeGated); - props.Add("directLending", DirectLending); - props.Add("subscriberOptin", SubscriberOptin); - props.Add("subscriberOptout", SubscriberOptout); - props.Add("subscriberHelp", SubscriberHelp); - props.Add("sample1", Sample1); - props.Add("sample2", Sample2); - props.Add("sample3", Sample3); - props.Add("sample4", Sample4); - props.Add("sample5", Sample5); - props.Add("messageFlow", MessageFlow); - props.Add("helpMessage", HelpMessage); - props.Add("optinKeywords", OptinKeywords); - props.Add("optoutKeywords", OptoutKeywords); - props.Add("helpKeywords", HelpKeywords); - props.Add("optinMessage", OptinMessage); - props.Add("optoutMessage", OptoutMessage); - props.Add("brand", Brand); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "status", Status); + AddToDictionary(props, "createDate", CreateDate); + AddToDictionary(props, "brandId", BrandId); + AddToDictionary(props, "usecase", Usecase); + AddToDictionary(props, "description", Description); + AddToDictionary(props, "embeddedLink", EmbeddedLink); + AddToDictionary(props, "embeddedPhone", EmbeddedPhone); + AddToDictionary(props, "affiliateMarketing", AffiliateMarketing); + AddToDictionary(props, "numberPool", NumberPool); + AddToDictionary(props, "ageGated", AgeGated); + AddToDictionary(props, "directLending", DirectLending); + AddToDictionary(props, "subscriberOptin", SubscriberOptin); + AddToDictionary(props, "subscriberOptout", SubscriberOptout); + AddToDictionary(props, "subscriberHelp", SubscriberHelp); + AddToDictionary(props, "sample1", Sample1); + AddToDictionary(props, "sample2", Sample2); + AddToDictionary(props, "sample3", Sample3); + AddToDictionary(props, "sample4", Sample4); + AddToDictionary(props, "sample5", Sample5); + AddToDictionary(props, "messageFlow", MessageFlow); + AddToDictionary(props, "helpMessage", HelpMessage); + AddToDictionary(props, "optinKeywords", OptinKeywords); + AddToDictionary(props, "optoutKeywords", OptoutKeywords); + AddToDictionary(props, "helpKeywords", HelpKeywords); + AddToDictionary(props, "optinMessage", OptinMessage); + AddToDictionary(props, "optoutMessage", OptoutMessage); + AddToDictionary(props, "brand", Brand); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCPartnerCampaignBrand.cs b/src/freeclimb/Model/SMSTenDLCPartnerCampaignBrand.cs index f6c073cd..a8856377 100644 --- a/src/freeclimb/Model/SMSTenDLCPartnerCampaignBrand.cs +++ b/src/freeclimb/Model/SMSTenDLCPartnerCampaignBrand.cs @@ -235,7 +235,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -246,20 +247,33 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("brandId", BrandId); - props.Add("firstName", FirstName); - props.Add("lastName", LastName); - props.Add("displayName", DisplayName); - props.Add("companyName", CompanyName); - props.Add("phone", Phone); - props.Add("email", Email); - props.Add("website", Website); - props.Add("optionalAttributes", OptionalAttributes); - props.Add("evpVettingScore", EvpVettingScore); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "brandId", BrandId); + AddToDictionary(props, "firstName", FirstName); + AddToDictionary(props, "lastName", LastName); + AddToDictionary(props, "displayName", DisplayName); + AddToDictionary(props, "companyName", CompanyName); + AddToDictionary(props, "phone", Phone); + AddToDictionary(props, "email", Email); + AddToDictionary(props, "website", Website); + AddToDictionary(props, "optionalAttributes", OptionalAttributes); + AddToDictionary(props, "evpVettingScore", EvpVettingScore); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTenDLCPartnerCampaignsListResult.cs b/src/freeclimb/Model/SMSTenDLCPartnerCampaignsListResult.cs index dcc7b048..a35c6197 100644 --- a/src/freeclimb/Model/SMSTenDLCPartnerCampaignsListResult.cs +++ b/src/freeclimb/Model/SMSTenDLCPartnerCampaignsListResult.cs @@ -157,7 +157,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -168,22 +169,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in PartnerCampaigns) + if (PartnerCampaigns != null) { - nested.Add(item); + foreach (var item in PartnerCampaigns) + { + nested.Add(item.ToKvp()); + } } - props.Add("partnerCampaigns", nested); + AddToDictionary(props, "partnerCampaigns", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTollFreeCampaign.cs b/src/freeclimb/Model/SMSTollFreeCampaign.cs index 306c5acb..bf3d5907 100644 --- a/src/freeclimb/Model/SMSTollFreeCampaign.cs +++ b/src/freeclimb/Model/SMSTollFreeCampaign.cs @@ -181,7 +181,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -192,16 +193,29 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("campaignId", CampaignId); - props.Add("useCase", UseCase); - props.Add("registrationStatus", RegistrationStatus); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "useCase", UseCase); + AddToDictionary(props, "registrationStatus", RegistrationStatus); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "revision", Revision); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SMSTollFreeCampaignsListResult.cs b/src/freeclimb/Model/SMSTollFreeCampaignsListResult.cs index c630b407..8f371a7c 100644 --- a/src/freeclimb/Model/SMSTollFreeCampaignsListResult.cs +++ b/src/freeclimb/Model/SMSTollFreeCampaignsListResult.cs @@ -156,7 +156,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -167,22 +168,38 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("total", Total); - props.Add("start", Start); - props.Add("end", End); - props.Add("page", Page); - props.Add("numPages", NumPages); - props.Add("pageSize", PageSize); - props.Add("nextPageUri", NextPageUri); + AddToDictionary(props, "total", Total); + AddToDictionary(props, "start", Start); + AddToDictionary(props, "end", End); + AddToDictionary(props, "page", Page); + AddToDictionary(props, "numPages", NumPages); + AddToDictionary(props, "pageSize", PageSize); + AddToDictionary(props, "nextPageUri", NextPageUri); List nested = new List(); - foreach (var item in Brands) + if (Brands != null) { - nested.Add(item); + foreach (var item in Brands) + { + nested.Add(item.ToKvp()); + } } - props.Add("brands", nested); + AddToDictionary(props, "brands", nested); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Say.cs b/src/freeclimb/Model/Say.cs index b296004c..c1697749 100644 --- a/src/freeclimb/Model/Say.cs +++ b/src/freeclimb/Model/Say.cs @@ -125,13 +125,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -141,15 +139,28 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("text", Text); - props.Add("language", Language); - props.Add("loop", Loop); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "language", Language); + AddToDictionary(props, "loop", Loop); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("Say", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SendDigits.cs b/src/freeclimb/Model/SendDigits.cs index 4e318073..63e894e8 100644 --- a/src/freeclimb/Model/SendDigits.cs +++ b/src/freeclimb/Model/SendDigits.cs @@ -113,13 +113,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -129,14 +127,27 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("digits", Digits); - props.Add("pauseMs", PauseMs); - props.Add("privacyMode", PrivacyMode); + AddToDictionary(props, "digits", Digits); + AddToDictionary(props, "pauseMs", PauseMs); + AddToDictionary(props, "privacyMode", PrivacyMode); IDictionary command = new Dictionary(); command.Add("SendDigits", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SetDTMFPassThrough.cs b/src/freeclimb/Model/SetDTMFPassThrough.cs index e3fcce86..e887b52f 100644 --- a/src/freeclimb/Model/SetDTMFPassThrough.cs +++ b/src/freeclimb/Model/SetDTMFPassThrough.cs @@ -76,13 +76,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -92,12 +90,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("dtmfPassThrough", DtmfPassThrough); + AddToDictionary(props, "dtmfPassThrough", DtmfPassThrough); IDictionary command = new Dictionary(); command.Add("SetDTMFPassThrough", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SetListen.cs b/src/freeclimb/Model/SetListen.cs index 222305d4..858ddc46 100644 --- a/src/freeclimb/Model/SetListen.cs +++ b/src/freeclimb/Model/SetListen.cs @@ -73,13 +73,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -89,12 +87,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("listen", Listen); + AddToDictionary(props, "listen", Listen); IDictionary command = new Dictionary(); command.Add("SetListen", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/SetTalk.cs b/src/freeclimb/Model/SetTalk.cs index f1a97526..941a7595 100644 --- a/src/freeclimb/Model/SetTalk.cs +++ b/src/freeclimb/Model/SetTalk.cs @@ -73,13 +73,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -89,12 +87,25 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("talk", Talk); + AddToDictionary(props, "talk", Talk); IDictionary command = new Dictionary(); command.Add("SetTalk", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Sms.cs b/src/freeclimb/Model/Sms.cs index b71d97ec..cd973859 100644 --- a/src/freeclimb/Model/Sms.cs +++ b/src/freeclimb/Model/Sms.cs @@ -139,13 +139,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -155,15 +153,28 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("to", To); - props.Add("from", From); - props.Add("text", Text); - props.Add("notificationUrl", NotificationUrl); + AddToDictionary(props, "to", To); + AddToDictionary(props, "from", From); + AddToDictionary(props, "text", Text); + AddToDictionary(props, "notificationUrl", NotificationUrl); IDictionary command = new Dictionary(); command.Add("Sms", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/StartRecordCall.cs b/src/freeclimb/Model/StartRecordCall.cs index 849399cf..b426a394 100644 --- a/src/freeclimb/Model/StartRecordCall.cs +++ b/src/freeclimb/Model/StartRecordCall.cs @@ -61,13 +61,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -82,6 +80,19 @@ public override IDictionary ToKvp() return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TFN.cs b/src/freeclimb/Model/TFN.cs index 85c54ade..d8ab43e9 100644 --- a/src/freeclimb/Model/TFN.cs +++ b/src/freeclimb/Model/TFN.cs @@ -83,7 +83,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -94,10 +95,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("campaignId", CampaignId); + AddToDictionary(props, "campaignId", CampaignId); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TFNCampaign.cs b/src/freeclimb/Model/TFNCampaign.cs index c617a63f..12782c0b 100644 --- a/src/freeclimb/Model/TFNCampaign.cs +++ b/src/freeclimb/Model/TFNCampaign.cs @@ -220,7 +220,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -231,18 +232,31 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("accountId", AccountId); - props.Add("campaignId", CampaignId); - props.Add("useCase", UseCase); - props.Add("registrationStatus", RegistrationStatus); - props.Add("dateCreated", DateCreated); - props.Add("dateUpdated", DateUpdated); - props.Add("dateCreatedISO", DateCreatedISO); - props.Add("dateUpdatedISO", DateUpdatedISO); - props.Add("revision", Revision); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "campaignId", CampaignId); + AddToDictionary(props, "useCase", UseCase); + AddToDictionary(props, "registrationStatus", RegistrationStatus); + AddToDictionary(props, "dateCreated", DateCreated); + AddToDictionary(props, "dateUpdated", DateUpdated); + AddToDictionary(props, "dateCreatedISO", DateCreatedISO); + AddToDictionary(props, "dateUpdatedISO", DateUpdatedISO); + AddToDictionary(props, "revision", Revision); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TerminateConference.cs b/src/freeclimb/Model/TerminateConference.cs index fee9507e..2ff4c659 100644 --- a/src/freeclimb/Model/TerminateConference.cs +++ b/src/freeclimb/Model/TerminateConference.cs @@ -61,13 +61,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -82,6 +80,19 @@ public override IDictionary ToKvp() return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TranscribeUtterance.cs b/src/freeclimb/Model/TranscribeUtterance.cs index a85a51b4..2ed21d7a 100644 --- a/src/freeclimb/Model/TranscribeUtterance.cs +++ b/src/freeclimb/Model/TranscribeUtterance.cs @@ -143,13 +143,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -159,22 +157,38 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("actionUrl", ActionUrl); - props.Add("playBeep", PlayBeep); - props.Add("record", Record); - props.Add("privacyForLogging", PrivacyForLogging); - props.Add("privacyForRecording", PrivacyForRecording); + AddToDictionary(props, "actionUrl", ActionUrl); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "record", Record); + AddToDictionary(props, "privacyForLogging", PrivacyForLogging); + AddToDictionary(props, "privacyForRecording", PrivacyForRecording); List nested = new List(); - foreach (var item in Prompts) + if (Prompts != null) { - nested.Add(item); + foreach (var item in Prompts) + { + nested.Add(item.ToKvp()); + } } - props.Add("prompts", nested); + AddToDictionary(props, "prompts", nested); IDictionary command = new Dictionary(); command.Add("TranscribeUtterance", props); return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TranscribeUtteranceRecord.cs b/src/freeclimb/Model/TranscribeUtteranceRecord.cs index 7911375b..929ddbc4 100644 --- a/src/freeclimb/Model/TranscribeUtteranceRecord.cs +++ b/src/freeclimb/Model/TranscribeUtteranceRecord.cs @@ -95,7 +95,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -106,12 +107,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("saveRecording", SaveRecording); - props.Add("maxLengthSec", MaxLengthSec); - props.Add("rcrdTerminationSilenceTimeMs", RcrdTerminationSilenceTimeMs); + AddToDictionary(props, "saveRecording", SaveRecording); + AddToDictionary(props, "maxLengthSec", MaxLengthSec); + AddToDictionary(props, "rcrdTerminationSilenceTimeMs", RcrdTerminationSilenceTimeMs); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/TranscribeWebhook.cs b/src/freeclimb/Model/TranscribeWebhook.cs index 68bc2b0e..b4d62169 100644 --- a/src/freeclimb/Model/TranscribeWebhook.cs +++ b/src/freeclimb/Model/TranscribeWebhook.cs @@ -354,7 +354,8 @@ public override string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -365,32 +366,45 @@ public override string ToJson() public override IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); - props.Add("accountId", AccountId); - props.Add("callId", CallId); - props.Add("from", From); - props.Add("to", To); - props.Add("recordingId", RecordingId); - props.Add("recordingUrl", RecordingUrl); - props.Add("recordingSize", RecordingSize); - props.Add("recordingFormat", RecordingFormat); - props.Add("recordingDurationMs", RecordingDurationMs); - props.Add("termReason", TermReason); - props.Add("recordTermReason", RecordTermReason); - props.Add("digit", Digit); - props.Add("privacyForLogging", PrivacyForLogging); - props.Add("privacyForRecording", PrivacyForRecording); - props.Add("bargeInReason", BargeInReason); - props.Add("bargedInPromptNo", BargedInPromptNo); - props.Add("bargedInPromptMs", BargedInPromptMs); - props.Add("bargedInPromptLoopNo", BargedInPromptLoopNo); - props.Add("bargeInTimeMs", BargeInTimeMs); - props.Add("transcript", Transcript); - props.Add("transcribeReason", TranscribeReason); - props.Add("transcriptionDurationMs", TranscriptionDurationMs); + AddToDictionary(props, "requestType", RequestType); + AddToDictionary(props, "accountId", AccountId); + AddToDictionary(props, "callId", CallId); + AddToDictionary(props, "from", From); + AddToDictionary(props, "to", To); + AddToDictionary(props, "recordingId", RecordingId); + AddToDictionary(props, "recordingUrl", RecordingUrl); + AddToDictionary(props, "recordingSize", RecordingSize); + AddToDictionary(props, "recordingFormat", RecordingFormat); + AddToDictionary(props, "recordingDurationMs", RecordingDurationMs); + AddToDictionary(props, "termReason", TermReason); + AddToDictionary(props, "recordTermReason", RecordTermReason); + AddToDictionary(props, "digit", Digit); + AddToDictionary(props, "privacyForLogging", PrivacyForLogging); + AddToDictionary(props, "privacyForRecording", PrivacyForRecording); + AddToDictionary(props, "bargeInReason", BargeInReason); + AddToDictionary(props, "bargedInPromptNo", BargedInPromptNo); + AddToDictionary(props, "bargedInPromptMs", BargedInPromptMs); + AddToDictionary(props, "bargedInPromptLoopNo", BargedInPromptLoopNo); + AddToDictionary(props, "bargeInTimeMs", BargeInTimeMs); + AddToDictionary(props, "transcript", Transcript); + AddToDictionary(props, "transcribeReason", TranscribeReason); + AddToDictionary(props, "transcriptionDurationMs", TranscriptionDurationMs); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Unpark.cs b/src/freeclimb/Model/Unpark.cs index d2340507..aa6dc89c 100644 --- a/src/freeclimb/Model/Unpark.cs +++ b/src/freeclimb/Model/Unpark.cs @@ -61,13 +61,11 @@ public override string ToString() /// JSON string presentation of the object public override string ToJson() { - JsonSerializer jsonSerializer = JsonSerializer.Create(); - jsonSerializer.NullValueHandling = NullValueHandling.Ignore; - - StringBuilder strb = new StringBuilder(); - jsonSerializer.Serialize(new StringWriter(strb), ToKvp()); - - return strb.ToString(); + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + return JsonConvert.SerializeObject(ToKvp(), settings); } /// @@ -82,6 +80,19 @@ public override IDictionary ToKvp() return command; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/UpdateCallRequest.cs b/src/freeclimb/Model/UpdateCallRequest.cs index 915f57cc..644cd924 100644 --- a/src/freeclimb/Model/UpdateCallRequest.cs +++ b/src/freeclimb/Model/UpdateCallRequest.cs @@ -75,7 +75,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -86,10 +87,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("status", Status); + AddToDictionary(props, "status", Status); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/UpdateConferenceParticipantRequest.cs b/src/freeclimb/Model/UpdateConferenceParticipantRequest.cs index 4b344d5b..01c76e1a 100644 --- a/src/freeclimb/Model/UpdateConferenceParticipantRequest.cs +++ b/src/freeclimb/Model/UpdateConferenceParticipantRequest.cs @@ -96,7 +96,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -107,12 +108,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("talk", Talk); - props.Add("listen", Listen); - props.Add("dtmfPassThrough", DtmfPassThrough); + AddToDictionary(props, "talk", Talk); + AddToDictionary(props, "listen", Listen); + AddToDictionary(props, "dtmfPassThrough", DtmfPassThrough); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/UpdateConferenceRequest.cs b/src/freeclimb/Model/UpdateConferenceRequest.cs index f1e348cf..b3ddc472 100644 --- a/src/freeclimb/Model/UpdateConferenceRequest.cs +++ b/src/freeclimb/Model/UpdateConferenceRequest.cs @@ -94,7 +94,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -105,12 +106,25 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("alias", Alias); - props.Add("playBeep", PlayBeep); - props.Add("status", Status); + AddToDictionary(props, "alias", Alias); + AddToDictionary(props, "playBeep", PlayBeep); + AddToDictionary(props, "status", Status); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/Model/Webhook.cs b/src/freeclimb/Model/Webhook.cs index c16c1214..897dc91a 100644 --- a/src/freeclimb/Model/Webhook.cs +++ b/src/freeclimb/Model/Webhook.cs @@ -104,7 +104,8 @@ public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject( this, - Newtonsoft.Json.Formatting.Indented + Newtonsoft.Json.Formatting.Indented, + new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore } ); } @@ -115,10 +116,23 @@ public virtual string ToJson() public virtual IDictionary ToKvp() { IDictionary props = new Dictionary(); - props.Add("requestType", RequestType); + AddToDictionary(props, "requestType", RequestType); return props; } + private IDictionary AddToDictionary( + IDictionary dict, + string key, + object value + ) + { + if (value != null) + { + dict.Add(key, value); + } + return dict; + } + /// /// To validate all properties of the instance /// diff --git a/src/freeclimb/freeclimb.csproj b/src/freeclimb/freeclimb.csproj index e4edad1b..79f8001b 100644 --- a/src/freeclimb/freeclimb.csproj +++ b/src/freeclimb/freeclimb.csproj @@ -12,7 +12,7 @@ A library generated from a OpenAPI doc No Copyright freeclimb - 5.1.1 + 5.1.2 bin\$(Configuration)\$(TargetFramework)\freeclimb.xml https://github.com/freeclimbapi/csharp-sdk.git git diff --git a/yarn.lock b/yarn.lock index 6aeaf0f1..b156f3e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27,7 +27,7 @@ resolved "https://registry.yarnpkg.com/@jsep-plugin/regex/-/regex-1.0.4.tgz#cb2fc423220fa71c609323b9ba7f7d344a755fcc" integrity sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg== -"@stoplight/http-spec@^7.0.2", "@stoplight/http-spec@^7.0.3": +"@stoplight/http-spec@^7.0.3": version "7.1.0" resolved "https://registry.yarnpkg.com/@stoplight/http-spec/-/http-spec-7.1.0.tgz#516fec5f4b08cc93dadfb4969a6f9616165b0553" integrity sha512-Z2XqKX2SV8a1rrgSzFqccX2TolfcblT+l4pNvUU+THaLl50tKDoeidwWWZTzYUzqU0+UV97ponvqEbWWN3PaXg== @@ -86,10 +86,10 @@ "@types/json-schema" "^7.0.7" json-pointer "^0.6.1" -"@stoplight/json@3.20.0", "@stoplight/json@3.21.7", "@stoplight/json@^3.18.1": - version "3.20.0" - resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.20.0.tgz#3acd893c6ed3394ac0a32b383038bd9710a167f9" - integrity sha512-xR5nnO2HSy7hGzchUAv1/p7V94EXwHmpbm5ORim4BQm8w/u1sF2ttIYqDx8BesTLWTybRxLysyDH+QHjpQnQdw== +"@stoplight/json@3.21.7", "@stoplight/json@^3.18.1": + version "3.21.7" + resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.21.7.tgz#102f5fd11921984c96672ce4307850daa1cbfc7b" + integrity sha512-xcJXgKFqv/uCEgtGlPxy3tPA+4I+ZI4vAuMJ885+ThkTHFVkC+0Fm58lA9NlsyjnkpxFh4YiQWpH+KefHdbA0A== dependencies: "@stoplight/ordered-object-literal" "^1.0.3" "@stoplight/path" "^1.3.2" @@ -108,33 +108,33 @@ resolved "https://registry.yarnpkg.com/@stoplight/path/-/path-1.3.2.tgz#96e591496b72fde0f0cdae01a61d64f065bd9ede" integrity sha512-lyIc6JUlUA8Ve5ELywPC8I2Sdnh1zc1zmbYgVarhXIp9YeAB0ReeqmGEOWNtlHkbP2DAA1AL65Wfn2ncjK/jtQ== -"@stoplight/prism-cli@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.6.0.tgz#fc6590936eb290bf60bfe289eb6ac3b3366c2031" - integrity sha512-BCCeWKjmjtFDQQv0qCATIE3L0HtnQQa3tUNvcMoCfZWIEe2McSGZkudckBsmGFfv6xycUrTkHSI/HNxhKYp5fg== +"@stoplight/prism-cli@5.14.2": + version "5.14.2" + resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.14.2.tgz#4729662fddb08f4ce03a7ccb98817f368e3940e1" + integrity sha512-S/x47zQa7NgoGAD0Q1JlijV7GRDd1zP/FcIpxSh+cJRUUImfALJJm1R3ONLweP97oG/b9BrwRyC+0GNYuzrviw== dependencies: - "@stoplight/http-spec" "^7.0.2" - "@stoplight/json" "^3.18.1" + "@stoplight/json" "3.21.7" "@stoplight/json-schema-ref-parser" "9.2.7" - "@stoplight/prism-core" "^5.6.0" - "@stoplight/prism-http" "^5.6.0" - "@stoplight/prism-http-server" "^5.6.0" + "@stoplight/prism-core" "^5.8.0" + "@stoplight/prism-http" "5.12.0" + "@stoplight/prism-http-server" "^5.12.0" "@stoplight/types" "^14.1.0" chalk "^4.1.2" chokidar "^3.5.2" fp-ts "^2.11.5" - json-schema-faker "0.5.3" + json-schema-faker "0.5.8" + jsonrepair "^3.12.0" lodash "^4.17.21" node-fetch "^2.6.5" pino "^6.13.3" signale "^1.4.0" - split2 "^3.2.2" + split2 "^4.2.0" tslib "^2.3.1" uri-template-lite "^22.9.0" urijs "^1.19.11" yargs "^16.2.0" -"@stoplight/prism-core@^5.6.0", "@stoplight/prism-core@^5.8.0": +"@stoplight/prism-core@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@stoplight/prism-core/-/prism-core-5.8.0.tgz#850917e1c45bfcd92012b3b235d20e3087600372" integrity sha512-fmH7n6e0thzOGcD5uZBu/Xx1iFNfpc9ACTxPie+lFD54SJ214M2FIFXD7kV+NCFlC+w5OFw+lJRaYM859uMnAg== @@ -144,10 +144,10 @@ pino "^6.13.3" tslib "^2.3.1" -"@stoplight/prism-http-server@^5.6.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.0.tgz#c1fdc86bcb7d42d3420b9b84f05f9ae8977bc953" - integrity sha512-rnACUB950kvgDGXk1MsVk1v8nAZNCRaxdrTlACoJpQA0qzF8eBszYikoDsVmx2BbGsOrCC/49+nQc+HyFFpMdQ== +"@stoplight/prism-http-server@^5.12.0": + version "5.12.2" + resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.2.tgz#d8de94f6b3506b464a5c89ff049b1e0fc9822ef9" + integrity sha512-h7MpOuv/WPvf4MhQmXw3CygAZp64Ts0SOM4BdoafcgAOJZyvRAOjUNJeelGJsHYdPK0aB9NZsqsaKBtNfkYj+A== dependencies: "@stoplight/prism-core" "^5.8.0" "@stoplight/prism-http" "^5.12.0" @@ -162,7 +162,7 @@ tslib "^2.3.1" type-is "^1.6.18" -"@stoplight/prism-http@^5.12.0", "@stoplight/prism-http@^5.6.0": +"@stoplight/prism-http@5.12.0", "@stoplight/prism-http@^5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@stoplight/prism-http/-/prism-http-5.12.0.tgz#b763292c5044e9213b558cbc44e5a2187cfffea4" integrity sha512-H+B/SO4SgQ6DT3CHIDCMQFGOe48Yecj0Eu+6rXwrs5m1JFyA2nlDwz+r73QJLGQanN4Biod2s0V9pZRcs2JnPA== @@ -252,11 +252,11 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node@*": - version "22.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" - integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== + version "24.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.10.tgz#f65a169779bf0d70203183a1890be7bee8ca2ddb" + integrity sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA== dependencies: - undici-types "~6.20.0" + undici-types "~7.8.0" "@types/swagger-schema-official@~2.0.22": version "2.0.25" @@ -264,9 +264,9 @@ integrity sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg== "@types/type-is@^1.6.3": - version "1.6.6" - resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.6.tgz#0adeafa0d6879f0ce17c81228d487270e8b80d7d" - integrity sha512-fs1KHv/f9OvmTMsu4sBNaUu32oyda9Y9uK25naJG8gayxNrfqGIjPQsbLIYyfe7xFkppnPlJB+BuTldOaX9bXw== + version "1.6.7" + resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.7.tgz#4d7934d2c795749800e767cd9af7ffbd4f16cf1c" + integrity sha512-gEsh7n8824nusZ2Sidh6POxNsIdTSvIAl5gXbeFj+TUaD1CO2r4i7MQYNMfEQkChU42s2bVWAda6x6BzIhtFbQ== dependencies: "@types/node" "*" @@ -475,9 +475,9 @@ cross-fetch@^3.1.5: node-fetch "^2.7.0" debug@4: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + version "4.4.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" + integrity sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ== dependencies: ms "^2.1.3" @@ -524,16 +524,23 @@ fast-safe-stringify@^2.0.8: integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== fast-uri@^3.0.1: - version "3.0.5" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" - integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== + version "3.0.6" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== -fast-xml-parser@^4.2.0, fast-xml-parser@^4.5.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz#a7e665ff79b7919100a5202f23984b6150f9b31e" - integrity sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w== +fast-xml-parser@^4.2.0: + version "4.5.3" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz#c54d6b35aa0f23dc1ea60b6c884340c006dc6efb" + integrity sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig== + dependencies: + strnum "^1.1.1" + +fast-xml-parser@^5.2.5: + version "5.2.5" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz#4809fdfb1310494e341098c25cb1341a01a9144a" + integrity sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ== dependencies: - strnum "^1.0.5" + strnum "^2.1.0" fastestsmallesttextencoderdecoder@^1.0.22: version "1.0.22" @@ -587,9 +594,9 @@ format-util@^1.0.3: integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== fp-ts@^2.11.5: - version "2.16.9" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.9.tgz#99628fc5e0bb3b432c4a16d8f4455247380bae8a" - integrity sha512-+I2+FnVB+tVaxcYyQkHUq7ZdKScaBlX53A41mxQtpIccsfyv8PzdzP7fzp2AY832T4aoK6UZ5WRX/ebGd8uZuQ== + version "2.16.10" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.10.tgz#829b82a46571c2dc202bed38a9c2eeec603e38c4" + integrity sha512-vuROzbNVfCmUkZSUbnWSltR1sbheyQbTzug7LB/46fEa1c0EucLeBaCEUE0gF3ZGUGBt9lVUiziGOhhj6K1ORA== fsevents@~2.3.2: version "2.3.3" @@ -657,11 +664,6 @@ iconv-lite@0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - io-ts@^2.2.16: version "2.2.22" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.22.tgz#5ab0d3636fe8494a275f0266461ab019da4b8d0b" @@ -748,14 +750,6 @@ json-schema-compare@^0.2.2: dependencies: lodash "^4.17.4" -json-schema-faker@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.3.tgz#92f8a102037acf68e1c8e3a2e7c85726d285512d" - integrity sha512-BeIrR0+YSrTbAR9dOMnjbFl1MvHyXnq+Wpdw1FpWZDHWKLzK229hZ5huyPcmzFUfVq1ODwf40WdGVoE266UBUg== - dependencies: - json-schema-ref-parser "^6.1.0" - jsonpath-plus "^7.2.0" - json-schema-faker@0.5.8: version "0.5.8" resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.8.tgz#13e8b53fef4d86de5c5d164763c80427da892b0c" @@ -783,16 +777,7 @@ jsonc-parser@~2.2.1: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== -jsonpath-plus@^10.1.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.2.0.tgz#84d680544d9868579cc7c8f59bbe153a5aad54c4" - integrity sha512-T9V+8iNYKFL2n2rF+w02LBOT2JjDnTjioaNFrxRy0Bv1y/hNsqR/EBK7Ojy2ythRHwmz2cRIls+9JitQGZC/sw== - dependencies: - "@jsep-plugin/assignment" "^1.3.0" - "@jsep-plugin/regex" "^1.0.4" - jsep "^1.4.0" - -jsonpath-plus@^10.3.0: +jsonpath-plus@^10.1.0, jsonpath-plus@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.3.0.tgz#59e22e4fa2298c68dfcd70659bb47f0cad525238" integrity sha512-8TNmfeTCk2Le33A3vRRwtuworG/L5RrgMvdjhKZxvyShO+mBu2fP50OWUjRLNtvw344DdDarFh9buFAZs5ujeA== @@ -801,10 +786,10 @@ jsonpath-plus@^10.3.0: "@jsep-plugin/regex" "^1.0.4" jsep "^1.4.0" -jsonpath-plus@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-7.2.0.tgz#7ad94e147b3ed42f7939c315d2b9ce490c5a3899" - integrity sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA== +jsonrepair@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/jsonrepair/-/jsonrepair-3.12.0.tgz#a0c9f97f5628156a44b78597fc8cdaf3561db751" + integrity sha512-SWfjz8SuQ0wZjwsxtSJ3Zy8vvLg6aO/kxcp9TWNPGwJKgTZVfhNEQBMk/vPOpYCDFWRxD6QWuI6IHR1t615f0w== liquid-json@0.3.1: version "0.3.1" @@ -1052,15 +1037,6 @@ quick-format-unescaped@^4.0.3: resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== -readable-stream@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1078,11 +1054,6 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-stable-stringify@^1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" @@ -1120,12 +1091,10 @@ sonic-boom@^1.0.2: atomic-sleep "^1.0.0" flatstr "^1.0.12" -split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== sprintf-js@~1.0.2: version "1.0.3" @@ -1141,13 +1110,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -1160,10 +1122,15 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== -strnum@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" - integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== +strnum@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4" + integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA== + +strnum@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.1.1.tgz#cf2a6e0cf903728b8b2c4b971b7e36b4e82d46ab" + integrity sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw== supports-color@^5.3.0: version "5.5.0" @@ -1204,10 +1171,10 @@ type-is@^1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== +undici-types@~7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294" + integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw== uri-template-lite@^22.9.0: version "22.9.0" @@ -1219,11 +1186,6 @@ urijs@^1.19.11: resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.11.tgz#204b0d6b605ae80bea54bea39280cdb7c9f923cc" integrity sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ== -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - utility-types@^3.10.0: version "3.11.0" resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c"